> 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/talus-docs-v2.1.0/reference/move/nexus_interface/graph.md).

# graph

* [Struct `Vertex`](#struct-vertex)
* [Struct `EntryGroup`](#struct-entrygroup)
* [Struct `OutputVariant`](#struct-outputvariant)
* [Struct `OutputPort`](#struct-outputport)
  * [Example](#example)
* [Struct `InputPort`](#struct-inputport)
* [Struct `VertexEvaluations`](#struct-vertexevaluations)
* [Struct `VertexEvaluationsInnerV1`](#struct-vertexevaluationsinnerv1)
* [Struct `VertexInfo`](#struct-vertexinfo)
* [Struct `OutputVariantPort`](#struct-outputvariantport)
* [Struct `VertexInputPort`](#struct-vertexinputport)
* [Struct `Edge`](#struct-edge)
* [Enum `RuntimeVertex`](#enum-runtimevertex)
* [Enum `VertexKind`](#enum-vertexkind)
* [Enum `PostFailureAction`](#enum-postfailureaction)
* [Enum `EdgeKind`](#enum-edgekind)
* [Enum `PortData`](#enum-portdata)
* [Constants](#constants)
* [Function `vertex_on_chain`](#function-vertex_on_chain)
* [Function `vertex_off_chain`](#function-vertex_off_chain)
* [Function `vertex_from_string`](#function-vertex_from_string)
* [Function `vertex_into_string`](#function-vertex_into_string)
* [Function `runtime_vertex_plain_from_vertex`](#function-runtime_vertex_plain_from_vertex)
* [Function `runtime_vertex_plain_from_string`](#function-runtime_vertex_plain_from_string)
* [Function `runtime_vertex_with_iterator_from_vertex`](#function-runtime_vertex_with_iterator_from_vertex)
* [Function `runtime_vertex_with_iterator_from_string`](#function-runtime_vertex_with_iterator_from_string)
* [Function `edge_kind_normal`](#function-edge_kind_normal)
* [Function `edge_kind_for_each`](#function-edge_kind_for_each)
* [Function `edge_kind_collect`](#function-edge_kind_collect)
* [Function `edge_kind_do_while`](#function-edge_kind_do_while)
* [Function `edge_kind_break`](#function-edge_kind_break)
* [Function `edge_kind_static`](#function-edge_kind_static)
* [Function `post_failure_action_terminate`](#function-post_failure_action_terminate)
* [Function `post_failure_action_transient_continue`](#function-post_failure_action_transient_continue)
* [Function `output_variant_from_string`](#function-output_variant_from_string)
* [Function `output_variant_into_string`](#function-output_variant_into_string)
* [Function `output_port_from_string`](#function-output_port_from_string)
* [Function `output_port_from_raw`](#function-output_port_from_raw)
* [Function `output_port_into_string`](#function-output_port_into_string)
* [Function `input_port_from_string`](#function-input_port_from_string)
* [Function `input_port_into_string`](#function-input_port_into_string)
* [Function `port_data_single`](#function-port_data_single)
* [Function `port_data_single_static`](#function-port_data_single_static)
* [Function `port_data_many`](#function-port_data_many)
* [Function `new_vertex_evaluations`](#function-new_vertex_evaluations)
* [Function `vertex_evaluations_ports_to_data`](#function-vertex_evaluations_ports_to_data)
* [Function `vertex_evaluations_ports_to_data_mut`](#function-vertex_evaluations_ports_to_data_mut)
* [Function `port_data_runtime_vertex_input`](#function-port_data_runtime_vertex_input)
* [Function `port_data_is_single`](#function-port_data_is_single)
* [Function `port_data_single_matches`](#function-port_data_single_matches)
* [Function `port_data_single_is_static`](#function-port_data_single_is_static)
* [Function `port_data_many_keys`](#function-port_data_many_keys)
* [Function `port_data_many_total_iterations`](#function-port_data_many_total_iterations)
* [Function `port_data_many_len`](#function-port_data_many_len)
* [Function `port_data_many_contains`](#function-port_data_many_contains)
* [Function `port_data_many_value`](#function-port_data_many_value)
* [Function `port_data_many_insert`](#function-port_data_many_insert)
* [Function `port_data_many_remove`](#function-port_data_many_remove)
* [Function `default_entry_group`](#function-default_entry_group)
* [Function `entry_group_from_string`](#function-entry_group_from_string)
* [Function `entry_group_into_string`](#function-entry_group_into_string)
* [Function `runtime_vertex_is_plain`](#function-runtime_vertex_is_plain)
* [Function `runtime_vertex_is_with_iterator`](#function-runtime_vertex_is_with_iterator)
* [Function `runtime_vertex_iteration_or_zero`](#function-runtime_vertex_iteration_or_zero)
* [Function `runtime_vertex_iteration`](#function-runtime_vertex_iteration)
* [Function `runtime_vertex_out_of`](#function-runtime_vertex_out_of)
* [Function `vertex_kind_is_on_chain`](#function-vertex_kind_is_on_chain)
* [Function `vertex_kind_is_off_chain`](#function-vertex_kind_is_off_chain)
* [Function `vertex_kind_tool_fqn`](#function-vertex_kind_tool_fqn)
* [Function `output_variant_is_err_eval`](#function-output_variant_is_err_eval)
* [Function `vertex_input_port`](#function-vertex_input_port)
* [Function `vertex_input_port_from_string`](#function-vertex_input_port_from_string)
* [Function `vertex_input_port_vertex`](#function-vertex_input_port_vertex)
* [Function `vertex_input_port_port`](#function-vertex_input_port_port)
* [Function `output_variant_port`](#function-output_variant_port)
* [Function `output_variant_port_variant`](#function-output_variant_port_variant)
* [Function `output_variant_port_port`](#function-output_variant_port_port)
* [Function `edge`](#function-edge)
* [Function `edge_from`](#function-edge_from)
* [Function `edge_to`](#function-edge_to)
* [Function `edge_kind`](#function-edge_kind)
* [Function `edge_from_variant`](#function-edge_from_variant)
* [Function `edge_from_port`](#function-edge_from_port)
* [Function `edge_to_vertex`](#function-edge_to_vertex)
* [Function `edge_to_port`](#function-edge_to_port)
* [Function `inputs_to_begin_execution`](#function-inputs_to_begin_execution)
* [Function `tagged_output_to_dag_types`](#function-tagged_output_to_dag_types)
* [Function `tagged_output_parts_to_dag_types`](#function-tagged_output_parts_to_dag_types)
* [Function `vertex_name`](#function-vertex_name)
* [Function `sorted_output_ports`](#function-sorted_output_ports)
* [Function `submitted_output_payload_sha256`](#function-submitted_output_payload_sha256)
* [Function `sorted_input_ports`](#function-sorted_input_ports)

### Struct `Vertex`

A named node in the DAG, identified by its ASCII name.

```move
public struct Vertex has copy, drop, store
```

<details>

<summary>Fields</summary>

`name: std::ascii::String`

</details>

#### Struct `EntryGroup`

DAGs can group several \[Vertex]s into a single entry point.

```move
public struct EntryGroup has copy, drop, store
```

<details>

<summary>Fields</summary>

`name: std::ascii::String`

</details>

#### Struct `OutputVariant`

Names one mutually exclusive output variant of a Tool evaluation, such as `ok` or `err`. Together with \[[`OutputPort`](#nexus_interface_graph_OutputPort)], variants model an algebraic sum whose selected case carries named fields.

```move
public struct OutputVariant has copy, drop, store
```

<details>

<summary>Fields</summary>

`name: std::ascii::String`

</details>

#### Struct `OutputPort`

Names one payload port within an output variant. This models algebraic enumeration type of first degree.

**Example**

Let's model computation that can fail, or it can succeed with some image data and some JSON metadata.

There would be a \[Vertex] which with two \[OutputVariant]s: "ok" and "err". The "err" \[OutputVariant] has one \[OutputPort]: "reason". The "ok" \[OutputVariant] has two \[OutputPort]s: "img" and "metadata".

```move
public struct OutputPort has copy, drop, store
```

<details>

<summary>Fields</summary>

`name: std::ascii::String`

</details>

#### Struct `InputPort`

An input port is a named input to a vertex.

```move
public struct InputPort has copy, drop, store
```

<details>

<summary>Fields</summary>

`name: std::ascii::String`

</details>

#### Struct `VertexEvaluations`

Runtime input data collected for a vertex evaluation.

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

<details>

<summary>Fields</summary>

`id: sui::object::UID`

</details>

#### Struct `VertexEvaluationsInnerV1`

Version one stored layout for \[[`VertexEvaluations`](#nexus_interface_graph_VertexEvaluations)].

The stable \[[`VertexEvaluations`](#nexus_interface_graph_VertexEvaluations)] cannot contain this map because its published layout must remain unchanged while stored data evolves.

```move
public struct VertexEvaluationsInnerV1 has store
```

<details>

<summary>Fields</summary>

`ports_to_data: sui::vec_map::VecMap<`[`nexus_interface::graph::InputPort`](#nexus_interface_graph_InputPort)`,` [`nexus_interface::graph::PortData`](#nexus_interface_graph_PortData)`>`

</details>

#### Struct `VertexInfo`

Describes a vertex and its one explicit offchain verifier selection.

```move
public struct VertexInfo has copy, drop, store
```

<details>

<summary>Fields</summary>

`kind:` [`nexus_interface::graph::VertexKind`](#nexus_interface_graph_VertexKind)`input_ports: sui::vec_set::VecSet<`[`nexus_interface::graph::InputPort`](#nexus_interface_graph_InputPort)`>`Input ports that must be evaluated by tools before this vertex can run.`post_failure_action: std::option::Option<`[`nexus_interface::graph::PostFailureAction`](#nexus_interface_graph_PostFailureAction)`>`Vertex-level post failure action override.`tool_id: sui::object::ID`Stable Tool object ID, bound while constructing the DAG.[`meta_schema`](/talus-docs-v2.1.0/reference/move/nexus_interface/meta_schema.md#nexus_interface_meta_schema)`: std::option::Option<`[`nexus_interface::meta_schema::MetaSchema`](/talus-docs-v2.1.0/reference/move/nexus_interface/meta_schema.md#nexus_interface_meta_schema_MetaSchema)`>`Immutable Tool schema. None exists only before registry binding.`verifier_mode:` [`nexus_interface::verifier::ToolVerifierMode`](/talus-docs-v2.1.0/reference/move/nexus_interface/verifier.md#nexus_interface_verifier_ToolVerifierMode)Offchain verification mode; ignored for onchain vertices.

</details>

#### Struct `OutputVariantPort`

A union of \[OutputVariant], and \[OutputPort] identifies an output port of a \[Vertex].

```move
public struct OutputVariantPort has copy, drop, store
```

<details>

<summary>Fields</summary>

`variant:` [`nexus_interface::graph::OutputVariant`](#nexus_interface_graph_OutputVariant)`port:` [`nexus_interface::graph::OutputPort`](#nexus_interface_graph_OutputPort)

</details>

#### Struct `VertexInputPort`

A union of \[Vertex] and \[InputPort] uniquely identifies an input port within a DAG graph.

```move
public struct VertexInputPort has copy, drop, store
```

<details>

<summary>Fields</summary>

`vertex:` [`nexus_interface::graph::Vertex`](#nexus_interface_graph_Vertex)`port:` [`nexus_interface::graph::InputPort`](#nexus_interface_graph_InputPort)

</details>

#### Struct `Edge`

Maps output from a unique output port to an input of another vertex.

```move
public struct Edge has copy, drop, store
```

<details>

<summary>Fields</summary>

`from:` [`nexus_interface::graph::OutputVariantPort`](#nexus_interface_graph_OutputVariantPort)`to:` [`nexus_interface::graph::VertexInputPort`](#nexus_interface_graph_VertexInputPort)`kind:` [`nexus_interface::graph::EdgeKind`](#nexus_interface_graph_EdgeKind)

</details>

#### Enum `RuntimeVertex`

Identifies a DAG vertex at runtime, with optional loop iteration state. Iterator state is attached at runtime because the static DAG stores each vertex once.

```move
public enum RuntimeVertex has copy, drop, store
```

<details>

<summary>Variants</summary>

Variant `WithIteratorvertex:` [`nexus_interface::graph::Vertex`](#nexus_interface_graph_Vertex)`iteration: u64`Zero-based iteration currently being evaluated.`out_of: u64`Total number of iterations in this runtime expansion.Variant `Plainvertex:` [`nexus_interface::graph::Vertex`](#nexus_interface_graph_Vertex)

</details>

#### Enum `VertexKind`

Distinguishes whether a vertex is executed on-chain or off-chain.

```move
public enum VertexKind has copy, drop, store
```

<details>

<summary>Variants</summary>

Variant `OnChain`Executes through the on-chain Tool result flow, whose UID proof requirements bind participation.`tool_fqn: std::ascii::String`Variant `OffChain`Delegates execution to an off-chain Tool and receives its result in a later transaction.`tool_fqn: std::ascii::String`

</details>

#### Enum `PostFailureAction`

Action applied when a vertex resolves to failure evidence with no matching outgoing edge. `Terminate` aborts the execution; `TransientContinue` lets unrelated walks continue.

```move
public enum PostFailureAction has copy, drop, store
```

<details>

<summary>Variants</summary>

Variant `Terminate`Variant `TransientContinue`

</details>

#### Enum `EdgeKind`

Defines how data moves across an edge, including loop and collection semantics.

```move
public enum EdgeKind has copy, drop, store
```

<details>

<summary>Variants</summary>

Variant `Normal`Variant `ForEach`Can loop over each element in \[`nexus_primitives::data::NexusData::Many`].Variant `Collect`Can collect multiple elements of the same type into a single \[`nexus_primitives::data::NexusData::Many`].Variant `DoWhile`Can create a pseudo-loop in the DAG.Variant `Break`Exits a do-while loop.Variant `Static`Static edges provide values to looped vertices from outside the loop.

</details>

#### Enum `PortData`

Runtime input data for a single input port, either a single value or one keyed per loop iteration.

```move
public enum PortData has copy, drop, store
```

<details>

<summary>Variants</summary>

Variant `Singledata:` [`nexus_primitives::data::NexusData`](/talus-docs-v2.1.0/reference/move/nexus_primitives/data.md#nexus_primitives_data_NexusData)`is_static: bool`Variant `Manydata: sui::vec_map::VecMap<u64,` [`nexus_primitives::data::NexusData`](/talus-docs-v2.1.0/reference/move/nexus_primitives/data.md#nexus_primitives_data_NexusData)`>total_iterations: u64`

</details>

#### Constants

```move
#[error]
const ERuntimeVertexIterationUnavailable: vector<u8> = b"Runtime vertex does not carry iterator position";
```

```move
#[error]
const ERuntimeVertexOutOfUnavailable: vector<u8> = b"Runtime vertex does not carry iterator bound";
```

#### Function `vertex_on_chain`

Creates an on-chain vertex kind for the given tool fully-qualified name.

```move
public fun vertex_on_chain(tool_fqn: std::ascii::String): nexus_interface::graph::VertexKind
```

#### Function `vertex_off_chain`

Creates an off-chain vertex kind for the given tool fully-qualified name.

```move
public fun vertex_off_chain(tool_fqn: std::ascii::String): nexus_interface::graph::VertexKind
```

#### Function `vertex_from_string`

Creates a vertex from its ASCII name.

```move
public fun vertex_from_string(name: std::ascii::String): nexus_interface::graph::Vertex
```

#### Function `vertex_into_string`

Returns the vertex's ASCII name.

```move
public fun vertex_into_string(vertex: nexus_interface::graph::Vertex): std::ascii::String
```

#### Function `runtime_vertex_plain_from_vertex`

Creates a plain runtime vertex (without iterator state) from a vertex.

```move
public fun runtime_vertex_plain_from_vertex(vertex: nexus_interface::graph::Vertex): nexus_interface::graph::RuntimeVertex
```

#### Function `runtime_vertex_plain_from_string`

Creates a plain runtime vertex (without iterator state) from an ASCII name.

```move
public fun runtime_vertex_plain_from_string(name: std::ascii::String): nexus_interface::graph::RuntimeVertex
```

#### Function `runtime_vertex_with_iterator_from_vertex`

Creates a runtime vertex carrying iterator position and bound from a vertex.

```move
public fun runtime_vertex_with_iterator_from_vertex(vertex: nexus_interface::graph::Vertex, iteration: u64, out_of: u64): nexus_interface::graph::RuntimeVertex
```

#### Function `runtime_vertex_with_iterator_from_string`

Creates a runtime vertex carrying iterator position and bound from an ASCII name.

```move
public fun runtime_vertex_with_iterator_from_string(name: std::ascii::String, iteration: u64, out_of: u64): nexus_interface::graph::RuntimeVertex
```

#### Function `edge_kind_normal`

Returns the `Normal` edge kind.

```move
public fun edge_kind_normal(): nexus_interface::graph::EdgeKind
```

#### Function `edge_kind_for_each`

Returns the `ForEach` edge kind.

```move
public fun edge_kind_for_each(): nexus_interface::graph::EdgeKind
```

#### Function `edge_kind_collect`

Returns the `Collect` edge kind.

```move
public fun edge_kind_collect(): nexus_interface::graph::EdgeKind
```

#### Function `edge_kind_do_while`

Returns the `DoWhile` edge kind.

```move
public fun edge_kind_do_while(): nexus_interface::graph::EdgeKind
```

#### Function `edge_kind_break`

Returns the `Break` edge kind.

```move
public fun edge_kind_break(): nexus_interface::graph::EdgeKind
```

#### Function `edge_kind_static`

Returns the `Static` edge kind.

```move
public fun edge_kind_static(): nexus_interface::graph::EdgeKind
```

#### Function `post_failure_action_terminate`

Returns the `Terminate` post-failure action value.

```move
public fun post_failure_action_terminate(): nexus_interface::graph::PostFailureAction
```

#### Function `post_failure_action_transient_continue`

Returns the `TransientContinue` post-failure action value.

```move
public fun post_failure_action_transient_continue(): nexus_interface::graph::PostFailureAction
```

#### Function `output_variant_from_string`

Creates an output variant from its ASCII name.

```move
public fun output_variant_from_string(name: std::ascii::String): nexus_interface::graph::OutputVariant
```

#### Function `output_variant_into_string`

Returns the output variant's ASCII name.

```move
public fun output_variant_into_string(variant: nexus_interface::graph::OutputVariant): std::ascii::String
```

#### Function `output_port_from_string`

Creates an output port from its ASCII name.

```move
public fun output_port_from_string(name: std::ascii::String): nexus_interface::graph::OutputPort
```

#### Function `output_port_from_raw`

Builds the port from raw.

```move
public fun output_port_from_raw(name: vector<u8>): nexus_interface::graph::OutputPort
```

#### Function `output_port_into_string`

Returns the output port's ASCII name.

```move
public fun output_port_into_string(port: nexus_interface::graph::OutputPort): std::ascii::String
```

#### Function `input_port_from_string`

Creates an input port from its ASCII name.

```move
public fun input_port_from_string(name: std::ascii::String): nexus_interface::graph::InputPort
```

#### Function `input_port_into_string`

Returns the input port's ASCII name.

```move
public fun input_port_into_string(port: nexus_interface::graph::InputPort): std::ascii::String
```

#### Function `port_data_single`

Creates single-valued, non-static port data.

```move
public fun port_data_single(data: nexus_primitives::data::NexusData): nexus_interface::graph::PortData
```

#### Function `port_data_single_static`

Creates single-valued port data marked as originating from a static edge.

```move
public fun port_data_single_static(data: nexus_primitives::data::NexusData): nexus_interface::graph::PortData
```

#### Function `port_data_many`

Creates port data keyed by iteration number for a looped vertex.

```move
public fun port_data_many(data: sui::vec_map::VecMap<u64, nexus_primitives::data::NexusData>, total_iterations: u64): nexus_interface::graph::PortData
```

#### Function `new_vertex_evaluations`

Creates an empty [`VertexEvaluations`](#nexus_interface_graph_VertexEvaluations) object with a fresh UID.

```move
public fun new_vertex_evaluations(ctx: &mut sui::tx_context::TxContext): nexus_interface::graph::VertexEvaluations
```

#### Function `vertex_evaluations_ports_to_data`

Returns a reference to the map from input port to its collected port data.

```move
public fun vertex_evaluations_ports_to_data(self: &nexus_interface::graph::VertexEvaluations): &sui::vec_map::VecMap<nexus_interface::graph::InputPort, nexus_interface::graph::PortData>
```

#### Function `vertex_evaluations_ports_to_data_mut`

Returns a mutable reference to the map from input port to its port data.

```move
public fun vertex_evaluations_ports_to_data_mut(self: &mut nexus_interface::graph::VertexEvaluations): &mut sui::vec_map::VecMap<nexus_interface::graph::InputPort, nexus_interface::graph::PortData>
```

#### Function `port_data_runtime_vertex_input`

Returns the port data value applicable to the given runtime vertex. For single data the value is always returned; for iteration-keyed data the value for the vertex's current iteration is returned, or none if the vertex has no iterator or no value is stored for that iteration.

```move
public fun port_data_runtime_vertex_input(self: &nexus_interface::graph::PortData, expected_vertex: &nexus_interface::graph::RuntimeVertex): std::option::Option<nexus_primitives::data::NexusData>
```

#### Function `port_data_is_single`

Returns true if the port data is a single value rather than iteration-keyed.

```move
public fun port_data_is_single(self: &nexus_interface::graph::PortData): bool
```

#### Function `port_data_single_matches`

Returns true if this is single port data whose value and static flag both equal the given arguments.

```move
public fun port_data_single_matches(self: &nexus_interface::graph::PortData, data: nexus_primitives::data::NexusData, is_static: bool): bool
```

#### Function `port_data_single_is_static`

Returns true if this is single port data that came from a static edge.

```move
public fun port_data_single_is_static(self: &nexus_interface::graph::PortData): bool
```

#### Function `port_data_many_keys`

Returns the iteration keys for iteration-keyed port data, or none if single.

```move
public fun port_data_many_keys(self: &nexus_interface::graph::PortData): std::option::Option<vector<u64>>
```

#### Function `port_data_many_total_iterations`

Returns the total iteration count for iteration-keyed port data, or none if single.

```move
public fun port_data_many_total_iterations(self: &nexus_interface::graph::PortData): std::option::Option<u64>
```

#### Function `port_data_many_len`

Returns the number of stored iteration entries, or none if single port data.

```move
public fun port_data_many_len(self: &nexus_interface::graph::PortData): std::option::Option<u64>
```

#### Function `port_data_many_contains`

Returns true if iteration-keyed port data holds a value for the given iteration.

```move
public fun port_data_many_contains(self: &nexus_interface::graph::PortData, iteration: u64): bool
```

#### Function `port_data_many_value`

Returns the value stored for the given iteration, or none if single port data or no value exists for that iteration.

```move
public fun port_data_many_value(self: &nexus_interface::graph::PortData, iteration: u64): std::option::Option<nexus_primitives::data::NexusData>
```

#### Function `port_data_many_insert`

Inserts a value for the given iteration into iteration-keyed port data, returning true on success, or false if this is single port data.

```move
public fun port_data_many_insert(self: &mut nexus_interface::graph::PortData, iteration: u64, data: nexus_primitives::data::NexusData): bool
```

#### Function `port_data_many_remove`

Removes and returns the value for the given iteration, or none if single port data or no value exists for that iteration.

```move
public fun port_data_many_remove(self: &mut nexus_interface::graph::PortData, iteration: u64): std::option::Option<nexus_primitives::data::NexusData>
```

#### Function `default_entry_group`

Returns the entry group.

```move
public fun default_entry_group(): nexus_interface::graph::EntryGroup
```

#### Function `entry_group_from_string`

Creates an entry group from its ASCII name.

```move
public fun entry_group_from_string(name: std::ascii::String): nexus_interface::graph::EntryGroup
```

#### Function `entry_group_into_string`

Returns the entry group's ASCII name.

```move
public fun entry_group_into_string(group: nexus_interface::graph::EntryGroup): std::ascii::String
```

#### Function `runtime_vertex_is_plain`

Returns true if the runtime vertex is plain (has no iterator state).

```move
public fun runtime_vertex_is_plain(vertex: &nexus_interface::graph::RuntimeVertex): bool
```

#### Function `runtime_vertex_is_with_iterator`

Returns true if the runtime vertex carries iterator state.

```move
public fun runtime_vertex_is_with_iterator(vertex: &nexus_interface::graph::RuntimeVertex): bool
```

#### Function `runtime_vertex_iteration_or_zero`

Returns the current iteration of the runtime vertex, or zero if plain.

```move
public fun runtime_vertex_iteration_or_zero(vertex: &nexus_interface::graph::RuntimeVertex): u64
```

#### Function `runtime_vertex_iteration`

Returns the current iteration of the runtime vertex. Aborts with [`ERuntimeVertexIterationUnavailable`](#nexus_interface_graph_ERuntimeVertexIterationUnavailable) if the vertex is plain.

```move
public fun runtime_vertex_iteration(vertex: &nexus_interface::graph::RuntimeVertex): u64
```

#### Function `runtime_vertex_out_of`

Returns the total iteration bound of the runtime vertex. Aborts with [`ERuntimeVertexOutOfUnavailable`](#nexus_interface_graph_ERuntimeVertexOutOfUnavailable) if the vertex is plain.

```move
public fun runtime_vertex_out_of(vertex: &nexus_interface::graph::RuntimeVertex): u64
```

#### Function `vertex_kind_is_on_chain`

Returns true if the vertex kind is on-chain.

```move
public fun vertex_kind_is_on_chain(kind: &nexus_interface::graph::VertexKind): bool
```

#### Function `vertex_kind_is_off_chain`

Returns true if the vertex kind is off-chain.

```move
public fun vertex_kind_is_off_chain(kind: &nexus_interface::graph::VertexKind): bool
```

#### Function `vertex_kind_tool_fqn`

Returns the tool fully-qualified name of the vertex kind.

```move
public fun vertex_kind_tool_fqn(kind: &nexus_interface::graph::VertexKind): std::ascii::String
```

#### Function `output_variant_is_err_eval`

Returns true if the output variant is the reserved `_err_eval` variant.

```move
public fun output_variant_is_err_eval(variant: &nexus_interface::graph::OutputVariant): bool
```

#### Function `vertex_input_port`

Derives the input port.

```move
public fun vertex_input_port(vertex: nexus_interface::graph::Vertex, port: nexus_interface::graph::InputPort): nexus_interface::graph::VertexInputPort
```

#### Function `vertex_input_port_from_string`

Builds a vertex input port from the vertex and port ASCII names.

```move
public fun vertex_input_port_from_string(vertex: std::ascii::String, port: std::ascii::String): nexus_interface::graph::VertexInputPort
```

#### Function `vertex_input_port_vertex`

Returns the vertex component of the vertex input port.

```move
public fun vertex_input_port_vertex(port: &nexus_interface::graph::VertexInputPort): nexus_interface::graph::Vertex
```

#### Function `vertex_input_port_port`

Returns the input port component of the vertex input port.

```move
public fun vertex_input_port_port(port: &nexus_interface::graph::VertexInputPort): nexus_interface::graph::InputPort
```

#### Function `output_variant_port`

Combines an output variant and output port into an output variant port.

```move
public fun output_variant_port(variant: nexus_interface::graph::OutputVariant, port: nexus_interface::graph::OutputPort): nexus_interface::graph::OutputVariantPort
```

#### Function `output_variant_port_variant`

Returns the output variant component of the output variant port.

```move
public fun output_variant_port_variant(port: &nexus_interface::graph::OutputVariantPort): nexus_interface::graph::OutputVariant
```

#### Function `output_variant_port_port`

Returns the output port component of the output variant port.

```move
public fun output_variant_port_port(port: &nexus_interface::graph::OutputVariantPort): nexus_interface::graph::OutputPort
```

#### Function `edge`

Creates an edge from an output variant port to a vertex input port with the given kind.

```move
public fun edge(from: nexus_interface::graph::OutputVariantPort, to: nexus_interface::graph::VertexInputPort, kind: nexus_interface::graph::EdgeKind): nexus_interface::graph::Edge
```

#### Function `edge_from`

Returns the edge's source output variant port.

```move
public fun edge_from(edge: &nexus_interface::graph::Edge): nexus_interface::graph::OutputVariantPort
```

#### Function `edge_to`

Returns the edge's destination vertex input port.

```move
public fun edge_to(edge: &nexus_interface::graph::Edge): nexus_interface::graph::VertexInputPort
```

#### Function `edge_kind`

Returns the edge's kind.

```move
public fun edge_kind(edge: &nexus_interface::graph::Edge): nexus_interface::graph::EdgeKind
```

#### Function `edge_from_variant`

Returns the output variant of the edge's source port.

```move
public fun edge_from_variant(edge: &nexus_interface::graph::Edge): nexus_interface::graph::OutputVariant
```

#### Function `edge_from_port`

Returns the output port of the edge's source port.

```move
public fun edge_from_port(edge: &nexus_interface::graph::Edge): nexus_interface::graph::OutputPort
```

#### Function `edge_to_vertex`

Returns the destination vertex of the edge.

```move
public fun edge_to_vertex(edge: &nexus_interface::graph::Edge): nexus_interface::graph::Vertex
```

#### Function `edge_to_port`

Returns the destination input port of the edge.

```move
public fun edge_to_port(edge: &nexus_interface::graph::Edge): nexus_interface::graph::InputPort
```

#### Function `inputs_to_begin_execution`

Helper to construct inputs for \[execution\_entries::begin\_execution]. Creates a map from a row based input (ie. repeat vertex name for each row).

```move
public fun inputs_to_begin_execution(vertices: vector<nexus_interface::graph::Vertex>, ports: vector<nexus_interface::graph::InputPort>, data: vector<nexus_primitives::data::NexusData>): sui::vec_map::VecMap<nexus_interface::graph::Vertex, sui::vec_map::VecMap<nexus_interface::graph::InputPort, nexus_primitives::data::NexusData>>
```

#### Function `tagged_output_to_dag_types`

Converts a tagged output into its DAG output variant and per-port data map.

```move
public fun tagged_output_to_dag_types(tagged_output: nexus_primitives::tagged_output::TaggedOutput): (nexus_interface::graph::OutputVariant, sui::vec_map::VecMap<nexus_interface::graph::OutputPort, nexus_primitives::data::NexusData>)
```

#### Function `tagged_output_parts_to_dag_types`

Converts raw tagged-output parts into a DAG output variant and per-port data map.

```move
public fun tagged_output_parts_to_dag_types(variant_bytes: vector<u8>, ports: sui::vec_map::VecMap<vector<u8>, nexus_primitives::data::NexusData>): (nexus_interface::graph::OutputVariant, sui::vec_map::VecMap<nexus_interface::graph::OutputPort, nexus_primitives::data::NexusData>)
```

#### Function `vertex_name`

Returns the vertex name.

```move
public fun vertex_name(vertex: &nexus_interface::graph::RuntimeVertex): nexus_interface::graph::Vertex
```

#### Function `sorted_output_ports`

Returns the map's output ports sorted ascending by their name bytes.

```move
public fun sorted_output_ports(variant_ports_to_data: &sui::vec_map::VecMap<nexus_interface::graph::OutputPort, nexus_primitives::data::NexusData>): vector<nexus_interface::graph::OutputPort>
```

#### Function `submitted_output_payload_sha256`

Computes a deterministic SHA-256 digest over the output variant name and its ports and data, sorted by port name for a stable ordering.

```move
public fun submitted_output_payload_sha256(variant: nexus_interface::graph::OutputVariant, variant_ports_to_data: &sui::vec_map::VecMap<nexus_interface::graph::OutputPort, nexus_primitives::data::NexusData>): vector<u8>
```

#### Function `sorted_input_ports`

Returns the input ports sorted ascending by their name bytes.

```move
public fun sorted_input_ports(input_ports: &sui::vec_set::VecSet<nexus_interface::graph::InputPort>): vector<nexus_interface::graph::InputPort>
```


---

# 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/talus-docs-v2.1.0/reference/move/nexus_interface/graph.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.
