Nous.Workflow.State (nous v0.13.3)
View SourceTyped state that flows between workflow nodes.
Each node receives the state as input and returns an updated version.
User data lives in data, while node_results provides access to
any previous node's raw output by ID.
Fields
| Field | Type | Description |
|---|---|---|
data | map() | User-defined workflow data |
node_results | map() | Results keyed by node ID |
metadata | map() | Workflow-level metadata (hooks, notify_pid, etc.) |
errors | list() | Errors recorded during execution |
started_at | DateTime.t() | When the workflow started |
updated_at | DateTime.t() | Last state update |
Examples
state = Nous.Workflow.State.new(%{query: "research topic"})
state.data.query
#=> "research topic"
Summary
Functions
Create a new workflow state from initial data.
Record an error for a node.
Record a node's result in the state.
Update the user data map.
Types
@type t() :: %Nous.Workflow.State{ data: map(), errors: [{String.t(), term()}], metadata: map(), node_results: %{required(String.t()) => term()}, started_at: DateTime.t(), updated_at: DateTime.t() }