> For the complete documentation index, see [llms.txt](https://docs.talus.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.talus.network/reference/move/nexus_interface/dag.md).

# dag

* [Struct `OverDAG`](#struct-overdag)
* [Struct `DAG`](#struct-dag)
* [Struct `DAGInnerV1`](#struct-daginnerv1)
* [Struct `DAGCreatedEvent`](#struct-dagcreatedevent)
* [Struct `DAGVertexAddedEvent`](#struct-dagvertexaddedevent)
* [Struct `DAGEntryVertexInputPortAddedEvent`](#struct-dagentryvertexinputportaddedevent)
* [Struct `DAGEdgeAddedEvent`](#struct-dagedgeaddedevent)
* [Struct `DAGOutputAddedEvent`](#struct-dagoutputaddedevent)
* [Struct `DAGDefaultValueAddedEvent`](#struct-dagdefaultvalueaddedevent)
* [Struct `DAGFinalizedEvent`](#struct-dagfinalizedevent)
* [Constants](#constants)
* [Function `new`](#function-new)
* [Function `new_with_owner_cap`](#function-new_with_owner_cap)
* [Function `finalize`](#function-finalize)
* [Function `add_vertex`](#function-add_vertex)
* [Function `with_post_failure_action`](#function-with_post_failure_action)
* [Function `with_vertex_post_failure_action`](#function-with_vertex_post_failure_action)
* [Function `set_vertex_verifier_mode`](#function-set_vertex_verifier_mode)
* [Function `with_entry_port`](#function-with_entry_port)
* [Function `with_entry_port_in_group`](#function-with_entry_port_in_group)
* [Function `with_entry`](#function-with_entry)
* [Function `with_entry_in_group`](#function-with_entry_in_group)
* [Function `with_edge`](#function-with_edge)
* [Function `with_output`](#function-with_output)
* [Function `with_default_value`](#function-with_default_value)
* [Function `rebuild`](#function-rebuild)
* [Function `is_finalized`](#function-is_finalized)
* [Function `assert_finalized`](#function-assert_finalized)
* [Function `assert_dag_owner`](#function-assert_dag_owner)
* [Function `dag_vertex_tool_fqn`](#function-dag_vertex_tool_fqn)
* [Function `vertex_count`](#function-vertex_count)
* [Function `has_vertex`](#function-has_vertex)
* [Function `is_vertex_onchain_tool`](#function-is_vertex_onchain_tool)
* [Function `dag_runtime_vertex_tool_fqn`](#function-dag_runtime_vertex_tool_fqn)
* [Function `dag_vertex_tool_id`](#function-dag_vertex_tool_id)
* [Function `dag_vertex_meta_schema`](#function-dag_vertex_meta_schema)
* [Function `dag_vertex_verifier_mode`](#function-dag_vertex_verifier_mode)
* [Function `dag_vertex_post_failure_action`](#function-dag_vertex_post_failure_action)
* [Function `has_entry_group`](#function-has_entry_group)
* [Function `entry_group_vertex_count`](#function-entry_group_vertex_count)
* [Function `is_entry_group_vertex`](#function-is_entry_group_vertex)
* [Function `entry_group_vertex_port_count`](#function-entry_group_vertex_port_count)
* [Function `is_entry_group_vertex_port`](#function-is_entry_group_vertex_port)
* [Function `default_value_for_input`](#function-default_value_for_input)
* [Function `effective_input_payload_sha256`](#function-effective_input_payload_sha256)
* [Function `vertex_input_ports_len`](#function-vertex_input_ports_len)
* [Function `sorted_input_ports_for_vertex`](#function-sorted_input_ports_for_vertex)
* [Function `is_vertex_offchain_tool`](#function-is_vertex_offchain_tool)
* [Function `vertex_tool_fqns`](#function-vertex_tool_fqns)
* [Function `vertex_names`](#function-vertex_names)
* [Function `has_edges_from`](#function-has_edges_from)
* [Function `has_outgoing_edges_for_variant`](#function-has_outgoing_edges_for_variant)
* [Function `edges_from`](#function-edges_from)
* [Function `resolve_err_eval_failure_policy`](#function-resolve_err_eval_failure_policy)
* [Function `err_eval_record_outcome_for_variant`](#function-err_eval_record_outcome_for_variant)

### Struct `OverDAG`

Capability witness for migration and identity replacement of one \[[`DAG`](#nexus_interface_dag_DAG)].

```move
public struct OverDAG has drop
```

<details>

<summary>Fields</summary>

</details>

#### Struct `DAG`

A directed acyclic graph (DAG) is a collection of \[Vertex]s and \[Edge]s that describe how to walk the graph.

```move
public struct DAG has key, store
```

<details>

<summary>Fields</summary>

`id: sui::object::UID`

</details>

#### Struct `DAGInnerV1`

Version one stored layout for \[[`DAG`](#nexus_interface_dag_DAG)].

The stable \[[`DAG`](#nexus_interface_dag_DAG)] cannot contain these fields because its published layout must remain unchanged while stored data evolves.

```move
public struct DAGInnerV1 has store
```

<details>

<summary>Fields</summary>

`finalized: bool`True after construction authority is consumed. Production finalization also freezes the outer object, making this promise independent of code.`vertices: sui::linked_table::LinkedTable<`[`nexus_interface::graph::Vertex`](/reference/move/nexus_interface/graph.md#nexus_interface_graph_Vertex)`,` [`nexus_interface::graph::VertexInfo`](/reference/move/nexus_interface/graph.md#nexus_interface_graph_VertexInfo)`>`Lists all vertices in insertion order and maps them to their bound \[`VertexInfo`].`entry_groups: sui::vec_map::VecMap<`[`nexus_interface::graph::EntryGroup`](/reference/move/nexus_interface/graph.md#nexus_interface_graph_EntryGroup)`, sui::vec_map::VecMap<`[`nexus_interface::graph::Vertex`](/reference/move/nexus_interface/graph.md#nexus_interface_graph_Vertex)`, sui::vec_set::VecSet<`[`nexus_interface::graph::InputPort`](/reference/move/nexus_interface/graph.md#nexus_interface_graph_InputPort)`>>>`Defines entry points to the DAG. The outer map is a list of groups. Only one group can be used to start the execution. Those DAGs that don't care about entry groups can use the default one defined in \[default\_entry\_group]. Within a group, all vertex-port pairs are entry and must all be provided with a value when beginning an execution. For each vertex in the group the DAG will spawn a walk if all vertex input ports defined in the `vertices` map have a value. It is possible to provide entry values for vertices that will be executed at a later point and not when the execution begins. Default values cannot be overridden.`edges: sui::table::Table<`[`nexus_interface::graph::Vertex`](/reference/move/nexus_interface/graph.md#nexus_interface_graph_Vertex)`, vector<`[`nexus_interface::graph::Edge`](/reference/move/nexus_interface/graph.md#nexus_interface_graph_Edge)`>>`Maps the outputs of vertices to the inputs of other vertices. The value is never an empty vector.`outputs: sui::table::Table<`[`nexus_interface::graph::Vertex`](/reference/move/nexus_interface/graph.md#nexus_interface_graph_Vertex)`, vector<`[`nexus_interface::graph::OutputVariantPort`](/reference/move/nexus_interface/graph.md#nexus_interface_graph_OutputVariantPort)`>>`Marks output ports on vertices that are meant to be shared as execution results.`defaults_to_input_ports: sui::table::Table<`[`nexus_interface::graph::VertexInputPort`](/reference/move/nexus_interface/graph.md#nexus_interface_graph_VertexInputPort)`,` [`nexus_primitives::data::NexusData`](/reference/move/nexus_primitives/data.md#nexus_primitives_data_NexusData)`>`Maps \[VertexInputPort] to default values. No \[Edge] may lead to this \[VertexInputPort]. We'll ignore any default value if there's an \[Edge] leading to the port. Useful for configurations such as LLM system prompts.`post_failure_action: std::option::Option<`[`nexus_interface::graph::PostFailureAction`](/reference/move/nexus_interface/graph.md#nexus_interface_graph_PostFailureAction)`>`Optional DAG-wide default post-failure action.

</details>

#### Struct `DAGCreatedEvent`

Emitted when a new DAG is created.

```move
public struct DAGCreatedEvent has copy, drop
```

<details>

<summary>Fields</summary>

[`dag`](#nexus_interface_dag)`: sui::object::ID`

</details>

#### Struct `DAGVertexAddedEvent`

Emitted when a vertex is added to a DAG.

```move
public struct DAGVertexAddedEvent has copy, drop
```

<details>

<summary>Fields</summary>

[`dag`](#nexus_interface_dag)`: sui::object::IDvertex:` [`nexus_interface::graph::Vertex`](/reference/move/nexus_interface/graph.md#nexus_interface_graph_Vertex)`kind:` [`nexus_interface::graph::VertexKind`](/reference/move/nexus_interface/graph.md#nexus_interface_graph_VertexKind)

</details>

#### Struct `DAGEntryVertexInputPortAddedEvent`

Emitted when an entry input port is added to a vertex within an entry group.

```move
public struct DAGEntryVertexInputPortAddedEvent has copy, drop
```

<details>

<summary>Fields</summary>

[`dag`](#nexus_interface_dag)`: sui::object::IDvertex:` [`nexus_interface::graph::Vertex`](/reference/move/nexus_interface/graph.md#nexus_interface_graph_Vertex)`entry_port:` [`nexus_interface::graph::InputPort`](/reference/move/nexus_interface/graph.md#nexus_interface_graph_InputPort)`entry_group:` [`nexus_interface::graph::EntryGroup`](/reference/move/nexus_interface/graph.md#nexus_interface_graph_EntryGroup)

</details>

#### Struct `DAGEdgeAddedEvent`

Emitted when an edge is added to a DAG.

```move
public struct DAGEdgeAddedEvent has copy, drop
```

<details>

<summary>Fields</summary>

[`dag`](#nexus_interface_dag)`: sui::object::IDfrom_vertex:` [`nexus_interface::graph::Vertex`](/reference/move/nexus_interface/graph.md#nexus_interface_graph_Vertex)`edge:` [`nexus_interface::graph::Edge`](/reference/move/nexus_interface/graph.md#nexus_interface_graph_Edge)

</details>

#### Struct `DAGOutputAddedEvent`

Emitted when an output is added to a vertex in a DAG.

```move
public struct DAGOutputAddedEvent has copy, drop
```

<details>

<summary>Fields</summary>

[`dag`](#nexus_interface_dag)`: sui::object::IDvertex:` [`nexus_interface::graph::Vertex`](/reference/move/nexus_interface/graph.md#nexus_interface_graph_Vertex)`output:` [`nexus_interface::graph::OutputVariantPort`](/reference/move/nexus_interface/graph.md#nexus_interface_graph_OutputVariantPort)

</details>

#### Struct `DAGDefaultValueAddedEvent`

Emitted when a default value is added to a vertex input port in a DAG.

```move
public struct DAGDefaultValueAddedEvent has copy, drop
```

<details>

<summary>Fields</summary>

[`dag`](#nexus_interface_dag)`: sui::object::IDvertex:` [`nexus_interface::graph::Vertex`](/reference/move/nexus_interface/graph.md#nexus_interface_graph_Vertex)`port:` [`nexus_interface::graph::InputPort`](/reference/move/nexus_interface/graph.md#nexus_interface_graph_InputPort)`value:` [`nexus_primitives::data::NexusData`](/reference/move/nexus_primitives/data.md#nexus_primitives_data_NexusData)

</details>

#### Struct `DAGFinalizedEvent`

Emitted when a DAG becomes an immutable execution contract.

```move
public struct DAGFinalizedEvent has copy, drop
```

<details>

<summary>Fields</summary>

[`dag`](#nexus_interface_dag)`: sui::object::ID`

</details>

#### Constants

```move
#[error]
const EVertexNotFound: vector<u8> = b"Input vertex does not exist";
```

```move
#[error]
const EDynamicInputAndDefaultValueAreMutuallyExclusive: vector<u8> = b"A dynamic input source and a default value are mutually exclusive";
```

```move
#[error]
const EEntryInputAndEdgeAreMutuallyExclusive: vector<u8> = b"An entry input and an edge are mutually exclusive";
```

```move
#[error]
const EVertexInputPortAlreadyHasDefaultValue: vector<u8> = b"Vertex input port already has a default value";
```

```move
#[error]
const EVertexAlreadyHasEdge: vector<u8> = b"The vertex already has an edge, cannot have outputs";
```

```move
#[error]
const EVertexAlreadyHasOutput: vector<u8> = b"The vertex already has an output, cannot have edges";
```

```move
#[error]
const EVerifierOnlyForOffchainTool: vector<u8> = b"Only offchain vertices select a verifier";
```

```move
#[error]
const EDAGOwnerMismatch: vector<u8> = b"DAG owner capability does not match the DAG";
```

```move
#[error]
const EDAGFinalized: vector<u8> = b"Finalized DAGs cannot be changed";
```

```move
#[error]
const EDAGNotFinalized: vector<u8> = b"DAG must be finalized before admission";
```

```move
#[error]
const EVertexToolSchemaMismatch: vector<u8> = b"DAG port is not declared by the bound Tool schema";
```

```move
#[error]
const EEdgeSchemaMismatch: vector<u8> = b"DAG edge schemas are incompatible";
```

#### Function `new`

Creates a new empty DAG and returns its bound owner capability.

```move
public fun new(ctx: &mut sui::tx_context::TxContext): (nexus_interface::dag::DAG, nexus_primitives::owner_cap::CloneableOwnerCap<nexus_interface::dag::OverDAG>)
```

#### Function `new_with_owner_cap`

Alias for \[[`new`](#nexus_interface_dag_new)] that makes capability custody explicit at call sites.

```move
public fun new_with_owner_cap(ctx: &mut sui::tx_context::TxContext): (nexus_interface::dag::DAG, nexus_primitives::owner_cap::CloneableOwnerCap<nexus_interface::dag::OverDAG>)
```

#### Function `finalize`

Consumes construction authority and freezes this DAG as an immutable promise.

Any cloned owner capabilities become inert because a frozen object can never be passed by mutable reference. Callers should complete Tool registration and Agent skill binding before this transition.

```move
public fun finalize(self: nexus_interface::dag::DAG, owner: nexus_primitives::owner_cap::CloneableOwnerCap<nexus_interface::dag::OverDAG>)
```

#### Function `add_vertex`

Adds one vertex already bound to its registered Tool ID and immutable schema.

Tool Registry is the active caller because it owns the authoritative registration mapping.

```move
public fun add_vertex(self: &mut nexus_interface::dag::DAG, owner: &mut nexus_primitives::owner_cap::CloneableOwnerCap<nexus_interface::dag::OverDAG>, name: nexus_interface::graph::Vertex, kind: nexus_interface::graph::VertexKind, tool_id: sui::object::ID, schema: nexus_interface::meta_schema::MetaSchema)
```

#### Function `with_post_failure_action`

Configures the DAG-wide default post-failure action.

Runtime precedence is vertex override, then DAG default, then implicit `Terminate`.

```move
public fun with_post_failure_action(self: nexus_interface::dag::DAG, action: nexus_interface::graph::PostFailureAction): nexus_interface::dag::DAG
```

#### Function `with_vertex_post_failure_action`

Configures the vertex-level post-failure action override.

Runtime precedence is vertex override, then DAG default, then implicit `Terminate`.

```move
public fun with_vertex_post_failure_action(self: nexus_interface::dag::DAG, vertex: nexus_interface::graph::Vertex, action: nexus_interface::graph::PostFailureAction): nexus_interface::dag::DAG
```

#### Function `set_vertex_verifier_mode`

Selects the verifier for one offchain vertex. New vertices default to `None`.

```move
public fun set_vertex_verifier_mode(self: &mut nexus_interface::dag::DAG, owner: &mut nexus_primitives::owner_cap::CloneableOwnerCap<nexus_interface::dag::OverDAG>, vertex: nexus_interface::graph::Vertex, mode: nexus_interface::verifier::ToolVerifierMode)
```

#### Function `with_entry_port`

Add a new input port to the vertex which has to be provided by the client when they begin execution with the default entry group.

```move
public fun with_entry_port(self: nexus_interface::dag::DAG, vertex: nexus_interface::graph::Vertex, entry_port: nexus_interface::graph::InputPort): nexus_interface::dag::DAG
```

#### Function `with_entry_port_in_group`

Add a new input port to the vertex which has to be provided by the client when they begin execution with the provided entry group.

An entry input is a dynamic source. The port cannot already have a default value or an incoming edge; the same constraint applies whichever construction call comes first.

```move
public fun with_entry_port_in_group(self: nexus_interface::dag::DAG, vertex: nexus_interface::graph::Vertex, entry_port: nexus_interface::graph::InputPort, entry_group: nexus_interface::graph::EntryGroup): nexus_interface::dag::DAG
```

#### Function `with_entry`

Use this after \[add\_vertex] to add that vertex to the default entry group.

See also \[with\_entry\_in\_group]

```move
public fun with_entry(self: nexus_interface::dag::DAG, vertex: nexus_interface::graph::Vertex): nexus_interface::dag::DAG
```

#### Function `with_entry_in_group`

Use this after \[add\_vertex] to add that vertex to the given entry group.

Special case for vertices that are meant to have no input ports and should be executed as soon as the execution begins.

\[begin\_execution] will start execution of this vertex only if it has no input ports.

```move
public fun with_entry_in_group(self: nexus_interface::dag::DAG, vertex: nexus_interface::graph::Vertex, entry_group: nexus_interface::graph::EntryGroup): nexus_interface::dag::DAG
```

#### Function `with_edge`

Adds a new edge to the DAG. The caller must ensure all constraints required by the workflow engine are upheld.

```move
public fun with_edge(self: nexus_interface::dag::DAG, from_vertex: nexus_interface::graph::Vertex, from_variant: nexus_interface::graph::OutputVariant, from_port: nexus_interface::graph::OutputPort, to_vertex: nexus_interface::graph::Vertex, to_port: nexus_interface::graph::InputPort, kind: nexus_interface::graph::EdgeKind): nexus_interface::dag::DAG
```

#### Function `with_output`

Adds a new output to the DAG.

```move
public fun with_output(self: nexus_interface::dag::DAG, vertex: nexus_interface::graph::Vertex, variant: nexus_interface::graph::OutputVariant, port: nexus_interface::graph::OutputPort): nexus_interface::dag::DAG
```

#### Function `with_default_value`

The input port must not have a dynamic input source. A default excludes both an incoming edge and an entry input, regardless of construction order. Compatible multiple edge routes remain allowed where the edge shape permits them.

```move
public fun with_default_value(self: nexus_interface::dag::DAG, vertex: nexus_interface::graph::Vertex, port: nexus_interface::graph::InputPort, value: nexus_primitives::data::NexusData): nexus_interface::dag::DAG
```

#### Function `rebuild`

Consumes the input \[DAG] and returns a copy of it with a new ID.

This is useful if you want to build a \[DAG] over multiple txs or ahead of time.

The \[DAG] can be an owned object only to be rebuilt and shared at a more convenient time.

(On Sui an object can be shared only in the tx that created it.)

```move
public fun rebuild(self: nexus_interface::dag::DAG, owner: nexus_primitives::owner_cap::CloneableOwnerCap<nexus_interface::dag::OverDAG>, ctx: &mut sui::tx_context::TxContext): (nexus_interface::dag::DAG, nexus_primitives::owner_cap::CloneableOwnerCap<nexus_interface::dag::OverDAG>)
```

#### Function `is_finalized`

Returns whether construction authority has been closed for this DAG.

```move
public fun is_finalized(self: &nexus_interface::dag::DAG): bool
```

#### Function `assert_finalized`

Requires the DAG to be an immutable execution contract.

```move
public fun assert_finalized(self: &nexus_interface::dag::DAG)
```

#### Function `assert_dag_owner`

Assert that `owner` controls this \[[`DAG`](#nexus_interface_dag_DAG)].

```move
public fun assert_dag_owner(self: &nexus_interface::dag::DAG, owner: &mut nexus_primitives::owner_cap::CloneableOwnerCap<nexus_interface::dag::OverDAG>)
```

#### Function `dag_vertex_tool_fqn`

Returns the fully qualified tool name of the given vertex.

Aborts with [`EVertexNotFound`](#nexus_interface_dag_EVertexNotFound) if the vertex does not exist in the DAG.

```move
public fun dag_vertex_tool_fqn(self: &nexus_interface::dag::DAG, vertex: nexus_interface::graph::Vertex): std::ascii::String
```

#### Function `vertex_count`

Returns the number of vertices in the DAG.

```move
public fun vertex_count(self: &nexus_interface::dag::DAG): u64
```

#### Function `has_vertex`

Returns true if the DAG contains the given vertex.

```move
public fun has_vertex(self: &nexus_interface::dag::DAG, vertex: nexus_interface::graph::Vertex): bool
```

#### Function `is_vertex_onchain_tool`

Returns whether the vertex uses an on-chain Tool.

```move
public fun is_vertex_onchain_tool(self: &nexus_interface::dag::DAG, vertex: nexus_interface::graph::Vertex): bool
```

#### Function `dag_runtime_vertex_tool_fqn`

Returns the fully qualified tool name of the given runtime vertex.

Aborts with [`EVertexNotFound`](#nexus_interface_dag_EVertexNotFound) if the vertex does not exist in the DAG.

```move
public fun dag_runtime_vertex_tool_fqn(self: &nexus_interface::dag::DAG, vertex: nexus_interface::graph::RuntimeVertex): std::ascii::String
```

#### Function `dag_vertex_tool_id`

Returns the stable Tool object ID pinned to a DAG vertex.

```move
public fun dag_vertex_tool_id(self: &nexus_interface::dag::DAG, vertex: nexus_interface::graph::Vertex): sui::object::ID
```

#### Function `dag_vertex_meta_schema`

Returns the immutable Tool interface bound to a DAG vertex.

```move
public fun dag_vertex_meta_schema(self: &nexus_interface::dag::DAG, vertex: nexus_interface::graph::Vertex): &nexus_interface::meta_schema::MetaSchema
```

#### Function `dag_vertex_verifier_mode`

Returns the verifier selected for an offchain vertex.

```move
public fun dag_vertex_verifier_mode(self: &nexus_interface::dag::DAG, vertex: nexus_interface::graph::Vertex): nexus_interface::verifier::ToolVerifierMode
```

#### Function `dag_vertex_post_failure_action`

Returns the post-failure action configured for a DAG vertex.

```move
public fun dag_vertex_post_failure_action(self: &nexus_interface::dag::DAG, vertex: nexus_interface::graph::Vertex, evidence_kind: nexus_interface::verifier::FailureEvidenceKind): nexus_interface::graph::PostFailureAction
```

#### Function `has_entry_group`

Returns true if the DAG contains the given entry group.

```move
public fun has_entry_group(self: &nexus_interface::dag::DAG, entry_group: &nexus_interface::graph::EntryGroup): bool
```

#### Function `entry_group_vertex_count`

Returns the number of vertices in an entry group.

```move
public fun entry_group_vertex_count(self: &nexus_interface::dag::DAG, entry_group: &nexus_interface::graph::EntryGroup): u64
```

#### Function `is_entry_group_vertex`

Returns whether an entry group contains a vertex.

```move
public fun is_entry_group_vertex(self: &nexus_interface::dag::DAG, entry_group: &nexus_interface::graph::EntryGroup, vertex: &nexus_interface::graph::Vertex): bool
```

#### Function `entry_group_vertex_port_count`

Returns the number of required ports for one entry vertex.

```move
public fun entry_group_vertex_port_count(self: &nexus_interface::dag::DAG, entry_group: &nexus_interface::graph::EntryGroup, vertex: &nexus_interface::graph::Vertex): u64
```

#### Function `is_entry_group_vertex_port`

Returns whether an entry vertex requires a port.

```move
public fun is_entry_group_vertex_port(self: &nexus_interface::dag::DAG, entry_group: &nexus_interface::graph::EntryGroup, vertex: &nexus_interface::graph::Vertex, port: &nexus_interface::graph::InputPort): bool
```

#### Function `default_value_for_input`

Returns the default value configured for a vertex input port, or none if there is none.

```move
public fun default_value_for_input(self: &nexus_interface::dag::DAG, vertex_input: nexus_interface::graph::VertexInputPort): std::option::Option<nexus_primitives::data::NexusData>
```

#### Function `effective_input_payload_sha256`

Returns the SHA-256 hash of a vertex's effective input payload, or an empty vector if any input port has no value.

```move
public fun effective_input_payload_sha256(self: &nexus_interface::dag::DAG, expected_vertex: nexus_interface::graph::RuntimeVertex, evaluations: &sui::vec_map::VecMap<nexus_interface::graph::InputPort, nexus_interface::graph::PortData>): vector<u8>
```

#### Function `vertex_input_ports_len`

Returns the number of input ports on the given vertex.

Aborts with [`EVertexNotFound`](#nexus_interface_dag_EVertexNotFound) if the vertex does not exist in the DAG.

```move
public fun vertex_input_ports_len(self: &nexus_interface::dag::DAG, vertex: nexus_interface::graph::Vertex): u64
```

#### Function `sorted_input_ports_for_vertex`

Returns the input ports of the given vertex in sorted order.

Aborts with [`EVertexNotFound`](#nexus_interface_dag_EVertexNotFound) if the vertex does not exist in the DAG.

```move
public fun sorted_input_ports_for_vertex(self: &nexus_interface::dag::DAG, vertex: nexus_interface::graph::Vertex): vector<nexus_interface::graph::InputPort>
```

#### Function `is_vertex_offchain_tool`

Returns whether the vertex uses an off-chain Tool.

Aborts with [`EVertexNotFound`](#nexus_interface_dag_EVertexNotFound) if the vertex does not exist in the DAG.

```move
public fun is_vertex_offchain_tool(self: &nexus_interface::dag::DAG, vertex: nexus_interface::graph::Vertex): bool
```

#### Function `vertex_tool_fqns`

Returns the fully qualified tool names of all vertices in the DAG.

```move
public fun vertex_tool_fqns(self: &nexus_interface::dag::DAG): vector<std::ascii::String>
```

#### Function `vertex_names`

Returns the names of all vertices in linked-table order.

```move
public fun vertex_names(self: &nexus_interface::dag::DAG): vector<nexus_interface::graph::Vertex>
```

#### Function `has_edges_from`

Returns true if the vertex has any outgoing edges.

```move
public fun has_edges_from(self: &nexus_interface::dag::DAG, vertex: nexus_interface::graph::Vertex): bool
```

#### Function `has_outgoing_edges_for_variant`

Returns true if the vertex has an outgoing edge originating from the given output variant.

```move
public fun has_outgoing_edges_for_variant(self: &nexus_interface::dag::DAG, vertex: nexus_interface::graph::Vertex, variant: nexus_interface::graph::OutputVariant): bool
```

#### Function `edges_from`

Returns the outgoing edges of the given vertex.

Aborts if the vertex has no outgoing edges.

```move
public fun edges_from(self: &nexus_interface::dag::DAG, vertex: nexus_interface::graph::Vertex): &vector<nexus_interface::graph::Edge>
```

#### Function `resolve_err_eval_failure_policy`

Resolve `_err_eval` failure policy from DAG policy and evidence kind.

```move
public fun resolve_err_eval_failure_policy(self: &nexus_interface::dag::DAG, evaluated_vertex: nexus_interface::graph::RuntimeVertex, failure_evidence_kind: nexus_interface::verifier::FailureEvidenceKind): nexus_interface::graph::PostFailureAction
```

#### Function `err_eval_record_outcome_for_variant`

Return the `_err_eval` outcome that matches the current output variant.

```move
public fun err_eval_record_outcome_for_variant(self: &nexus_interface::dag::DAG, evaluated_vertex: nexus_interface::graph::RuntimeVertex, failure_evidence_kind: nexus_interface::verifier::FailureEvidenceKind, variant: nexus_interface::graph::OutputVariant): nexus_interface::graph::PostFailureAction
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.talus.network/reference/move/nexus_interface/dag.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
