Skip to main content

2.3 DAG Execution Model

Node Output Schema

Every DAG node produces output in this schema:

{
"text": "primary textual output (max 16 KB)",
"artifacts": {
"code": "optional code string (max 64 KB)",
"metadata": {}
}
}

DataRef Syntax

Nodes reference earlier outputs using DataRef patterns:

"${<step_id>.output.<field_path>}"

Examples:

  • "${step_1.output.text}" — text output from step_1
  • "${step_2.output.artifacts.code}" — code artifact from step_2

Execution Contract

The validator executor follows these 5 steps:

  1. Topological sort — derive execution plan from edges. Nodes with no shared dependency run concurrently in the same execution tier.
  2. Store outputs — after each node completes, store result in context[node_id].
  3. Resolve DataRefs — before executing node K, resolve ${...} patterns referencing completed upstream nodes.
  4. Budget ceiling check — before dispatching each node:
    budget_ceiling = min(constraints["max_budget_tao"],
    1.5 * workflow_plan["total_estimated_cost"])
    if cumulative_tao >= budget_ceiling:
    for node in remaining_nodes:
    context[node.id] = {"status": "budget_abort", "output": None}
    break
  5. Failure propagation — if a referenced field doesn't exist or the upstream node failed, current step is marked a hard failure.

Parallel DAG Rules

MetricSequential DAGParallel DAG
completion_ratiosteps_completed / total_nodessteps_completed / total_nodes (same)
S_latencywall-clock end-to-endwall-clock end-to-end (parallel compresses it)
S_costsum of all step costssum of all step costs (both charged)
DataRef failure propagationupstream fail → downstream failsonly if specific referenced node failed

Example: A→C and B→C (A and B independent). A completes, B fails. C only needs ${A.output.text}. C proceeds; B's failure reduces completion_ratio by 1/3 but does not block C.

Miners must not implement their own DataRef resolvers. All resolution is performed by the validator executor.


← Previous2.2 WorkflowSynapse Protocol
→ Next3.1 Emission Structure
IndexDocumentation Index