diff --git a/nexus/packages/reference/nexus_workflow/dag.md b/nexus/packages/reference/nexus_workflow/dag.md index 342c039..a024524 100644 --- a/nexus/packages/reference/nexus_workflow/dag.md +++ b/nexus/packages/reference/nexus_workflow/dag.md @@ -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. -
fun advance_walk(dag: &(nexus_workflow=0x0)::dag::DAG, execution: &mut (nexus_workflow=0x0)::dag::DAGExecution, request_walk_execution: &mut (nexus_workflow=0x0)::dag::RequestWalkExecution, walk_index: u64, expected_vertex: (nexus_workflow=0x0)::dag::Vertex, variant: (nexus_workflow=0x0)::dag::OutputVariant, variant_ports_to_data: sui::vec_map::VecMap<(nexus_workflow=0x0)::dag::OutputPort, (nexus_primitives=0x0)::data::NexusData>, ctx: &mut sui::tx_context::TxContext)
+fun advance_walk(dag: &(nexus_workflow=0x0)::dag::DAG, execution: &mut (nexus_workflow=0x0)::dag::DAGExecution, request_walk_execution: &mut (nexus_workflow=0x0)::dag::RequestWalkExecution, walk_index: u64, expected_vertex: (nexus_workflow=0x0)::dag::RuntimeVertex, variant: (nexus_workflow=0x0)::dag::OutputVariant, variant_ports_to_data: sui::vec_map::VecMap<(nexus_workflow=0x0)::dag::OutputPort, (nexus_primitives=0x0)::data::NexusData>, failure_evidence_kind: (nexus_workflow=0x0)::dag::FailureEvidenceKind, clock: &sui::clock::Clock, ctx: &mut sui::tx_context::TxContext)
+If variant is _err_eval, tool evidence follows outgoing _err_eval 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 TerminalErrEvalRecordedEvent instead of continuing through _err_eval edges.
+
@@ -2079,6 +2081,3 @@ Will emit an event if the execution is done.
fun if_finished_emit_final_event(self: &(nexus_workflow=0x0)::dag::DAGExecution)
-
-
-
diff --git a/nexus/packages/workflow.md b/nexus/packages/workflow.md
index 07569c8..dc42848 100644
--- a/nexus/packages/workflow.md
+++ b/nexus/packages/workflow.md
@@ -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.