Skip to main content

Module dsl

Module dsl 

Source
Expand description

Workflow documents: the portable, serializable description of a workflow.

A document is plain data (JSON or YAML). It is turned into an executable crate::graph::Graph by crate::graph::Graph::build using a crate::node::Registry.

version: "1"
name: hello
env:
  - { name: API_KEY, type: secret }
graph:
  nodes:
    - id: start
      type: start
      variables: [{ variable: name, type: string, required: true }]
    - id: greet
      type: template-transform
      template: "Hello {{ name }}"
      variables: [{ variable: name, value_selector: [start, name] }]
    - id: end
      type: end
      outputs: [{ variable: greeting, value_selector: [greet, output] }]
  edges:
    - { source: start, target: greet }
    - { source: greet, target: end }

For interoperability the loader also accepts the common “node with a data object” layout ({id, parentId, data: {type, title, ...}}), camelCase edge handles (sourceHandle) and documents wrapped in a top-level workflow key.

Structs§

EdgeDoc
A directed edge. handle selects the branch of the source node (default source).
GraphDoc
Nodes and edges.
NodeDoc
One node. Node-specific settings live in config.
NodePolicy
Failure handling, retries and timeouts for one node.
RetryPolicy
Retry policy. Applies to every node kind.
VariableDecl
Declaration of an env or conversation variable.
Workflow
A complete workflow document.

Enums§

DocumentError
Error raised while decoding a workflow document.
ErrorStrategy
What happens when a node fails after exhausting retries.