Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions nexus/packages/reference/nexus_workflow/dag.md
Original file line number Diff line number Diff line change
Expand Up @@ -2062,9 +2062,11 @@ Won't add the walk if it's already there.
Advances the walk by evaluating the vertex and following the edges if possible.


<pre><code><b>fun</b> <a href="../nexus_workflow/dag.md#(nexus_workflow=0x0)_dag_advance_walk">advance_walk</a>(<a href="../nexus_workflow/dag.md#(nexus_workflow=0x0)_dag">dag</a>: &(nexus_workflow=0x0)::<a href="../nexus_workflow/dag.md#(nexus_workflow=0x0)_dag_DAG">dag::DAG</a>, execution: &<b>mut</b> (nexus_workflow=0x0)::<a href="../nexus_workflow/dag.md#(nexus_workflow=0x0)_dag_DAGExecution">dag::DAGExecution</a>, <a href="../nexus_workflow/dag.md#(nexus_workflow=0x0)_dag_request_walk_execution">request_walk_execution</a>: &<b>mut</b> (nexus_workflow=0x0)::<a href="../nexus_workflow/dag.md#(nexus_workflow=0x0)_dag_RequestWalkExecution">dag::RequestWalkExecution</a>, walk_index: u64, expected_vertex: (nexus_workflow=0x0)::<a href="../nexus_workflow/dag.md#(nexus_workflow=0x0)_dag_Vertex">dag::Vertex</a>, variant: (nexus_workflow=0x0)::<a href="../nexus_workflow/dag.md#(nexus_workflow=0x0)_dag_OutputVariant">dag::OutputVariant</a>, variant_ports_to_data: <a href="../dependencies/sui/vec_map.md#sui_vec_map_VecMap">sui::vec_map::VecMap</a>&lt;(nexus_workflow=0x0)::<a href="../nexus_workflow/dag.md#(nexus_workflow=0x0)_dag_OutputPort">dag::OutputPort</a>, (nexus_primitives=0x0)::data::NexusData&gt;, ctx: &<b>mut</b> <a href="../dependencies/sui/tx_context.md#sui_tx_context_TxContext">sui::tx_context::TxContext</a>)
<pre><code><b>fun</b> <a href="../nexus_workflow/dag.md#(nexus_workflow=0x0)_dag_advance_walk">advance_walk</a>(<a href="../nexus_workflow/dag.md#(nexus_workflow=0x0)_dag">dag</a>: &(nexus_workflow=0x0)::<a href="../nexus_workflow/dag.md#(nexus_workflow=0x0)_dag_DAG">dag::DAG</a>, execution: &<b>mut</b> (nexus_workflow=0x0)::<a href="../nexus_workflow/dag.md#(nexus_workflow=0x0)_dag_DAGExecution">dag::DAGExecution</a>, <a href="../nexus_workflow/dag.md#(nexus_workflow=0x0)_dag_request_walk_execution">request_walk_execution</a>: &<b>mut</b> (nexus_workflow=0x0)::<a href="../nexus_workflow/dag.md#(nexus_workflow=0x0)_dag_RequestWalkExecution">dag::RequestWalkExecution</a>, walk_index: u64, expected_vertex: (nexus_workflow=0x0)::<a href="../nexus_workflow/dag.md#(nexus_workflow=0x0)_dag_RuntimeVertex">dag::RuntimeVertex</a>, variant: (nexus_workflow=0x0)::<a href="../nexus_workflow/dag.md#(nexus_workflow=0x0)_dag_OutputVariant">dag::OutputVariant</a>, variant_ports_to_data: <a href="../dependencies/sui/vec_map.md#sui_vec_map_VecMap">sui::vec_map::VecMap</a>&lt;(nexus_workflow=0x0)::<a href="../nexus_workflow/dag.md#(nexus_workflow=0x0)_dag_OutputPort">dag::OutputPort</a>, (nexus_primitives=0x0)::data::NexusData&gt;, failure_evidence_kind: (nexus_workflow=0x0)::<a href="../nexus_workflow/dag.md#(nexus_workflow=0x0)_dag_FailureEvidenceKind">dag::FailureEvidenceKind</a>, clock: &<a href="../dependencies/sui/clock.md#sui_clock_Clock">sui::clock::Clock</a>, ctx: &<b>mut</b> <a href="../dependencies/sui/tx_context.md#sui_tx_context_TxContext">sui::tx_context::TxContext</a>)
</code></pre>

If <code>variant</code> is <code>_err_eval</code>, tool evidence follows outgoing <code>_err_eval</code> edges first. When no such edge is available, the runtime resolves the effective post-failure action using vertex override, then DAG default, then terminate. Leader-evidence paths such as expired execution aborts are terminal-only and record <code>TerminalErrEvalRecordedEvent</code> instead of continuing through <code>_err_eval</code> edges.




Expand All @@ -2079,6 +2081,3 @@ Will emit an event if the execution is done.
<pre><code><b>fun</b> <a href="../nexus_workflow/dag.md#(nexus_workflow=0x0)_dag_if_finished_emit_final_event">if_finished_emit_final_event</a>(self: &(nexus_workflow=0x0)::<a href="../nexus_workflow/dag.md#(nexus_workflow=0x0)_dag_DAGExecution">dag::DAGExecution</a>)
</code></pre>




38 changes: 38 additions & 0 deletions nexus/packages/workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,44 @@ Currently, the workflow engine reserves the following output variants:
1. Tool invocation failed
1. Output data could not be parsed or does not pass the tool's validation schema

### Post-failure action

The workflow stores an optional `post_failure_action` on the DAG and an optional
`post_failure_action` on each executable vertex.

Resolution order is:

1. The executable vertex override.
1. The DAG default.
1. `Terminate`.

Supported actions are:

- `continue`
- `terminate`

Fixture and DAG authoring use the same JSON shape. For example:

```json
{
"post_failure_action": "continue",
"vertices": [
{
"name": "failable",
"post_failure_action": "terminate"
}
]
}
```

Runtime behavior follows the simplified walk model:

- Tool `_err_eval` is edge-first. If `_err_eval` edges exist, the engine follows them first.
- If no `_err_eval` edge exists, runtime resolves `continue` versus `terminate` using the precedence above.
- Timeout handling is terminal-only and records terminal `_err_eval` state regardless of configured `continue`.
- `terminate` records terminal `_err_eval`, aborts the walk, and cancels peer unfinished walks.
- When execution finishes with no active work remaining, consumed blocked walks normalize to `Cancelled`.

### Entry ports

Entry ports are input ports that must receive data from the client before execution can begin. These ports are explicitly defined via `with_entry_port` or `with_entry_port_in_group`. They cannot have any default values or incoming edges.
Expand Down
Loading