Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

πŸ”€dag

Struct OverDAG

Capability witness for migration and identity replacement of one [DAG].

Fields

Struct DAG

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

Fields

id: sui::object::UID

Struct DAGInnerV1

Version one stored layout for [DAG].

The stable [DAG] cannot contain these fields because its published layout must remain unchanged while stored data evolves.

Fields

finalized: boolTrue 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, 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, sui::vec_map::VecMap<nexus_interface::graph::Vertex, sui::vec_set::VecSet<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, vector<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, vector<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, 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>Optional DAG-wide default post-failure action.

Struct DAGCreatedEvent

Emitted when a new DAG is created.

Fields

dag: sui::object::ID

Struct DAGVertexAddedEvent

Emitted when a vertex is added to a DAG.

Fields

Struct DAGEntryVertexInputPortAddedEvent

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

Fields

Struct DAGEdgeAddedEvent

Emitted when an edge is added to a DAG.

Fields

Struct DAGOutputAddedEvent

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

Fields

Struct DAGDefaultValueAddedEvent

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

Fields

Struct DAGFinalizedEvent

Emitted when a DAG becomes an immutable execution contract.

Fields

dag: sui::object::ID

Constants

Function new

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

Function new_with_owner_cap

Alias for [new] that makes capability custody explicit at call sites.

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.

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.

Function with_post_failure_action

Configures the DAG-wide default post-failure action.

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

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.

Function set_vertex_verifier_mode

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

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.

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.

Function with_entry

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

See also [with_entry_in_group]

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.

Function with_edge

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

Function with_output

Adds a new output to the 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.

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.)

Function is_finalized

Returns whether construction authority has been closed for this DAG.

Function assert_finalized

Requires the DAG to be an immutable execution contract.

Function assert_dag_owner

Assert that owner controls this [DAG].

Function dag_vertex_tool_fqn

Returns the fully qualified tool name of the given vertex.

Aborts with EVertexNotFound if the vertex does not exist in the DAG.

Function vertex_count

Returns the number of vertices in the DAG.

Function has_vertex

Returns true if the DAG contains the given vertex.

Function is_vertex_onchain_tool

Returns whether the vertex uses an on-chain Tool.

Function dag_runtime_vertex_tool_fqn

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

Aborts with EVertexNotFound if the vertex does not exist in the DAG.

Function dag_vertex_tool_id

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

Function dag_vertex_meta_schema

Returns the immutable Tool interface bound to a DAG vertex.

Function dag_vertex_verifier_mode

Returns the verifier selected for an offchain vertex.

Function dag_vertex_post_failure_action

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

Function has_entry_group

Returns true if the DAG contains the given entry group.

Function entry_group_vertex_count

Returns the number of vertices in an entry group.

Function is_entry_group_vertex

Returns whether an entry group contains a vertex.

Function entry_group_vertex_port_count

Returns the number of required ports for one entry vertex.

Function is_entry_group_vertex_port

Returns whether an entry vertex requires a port.

Function default_value_for_input

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

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.

Function vertex_input_ports_len

Returns the number of input ports on the given vertex.

Aborts with EVertexNotFound if the vertex does not exist in the DAG.

Function sorted_input_ports_for_vertex

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

Aborts with EVertexNotFound if the vertex does not exist in the DAG.

Function is_vertex_offchain_tool

Returns whether the vertex uses an off-chain Tool.

Aborts with EVertexNotFound if the vertex does not exist in the DAG.

Function vertex_tool_fqns

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

Function vertex_names

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

Function has_edges_from

Returns true if the vertex has any outgoing edges.

Function has_outgoing_edges_for_variant

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

Function edges_from

Returns the outgoing edges of the given vertex.

Aborts if the vertex has no outgoing edges.

Function resolve_err_eval_failure_policy

Resolve _err_eval failure policy from DAG policy and evidence kind.

Function err_eval_record_outcome_for_variant

Return the _err_eval outcome that matches the current output variant.

Last updated