Experimental Livebook-friendly DSL for sketching workflows.
This Lab DSL compiles to the stable, pipe-first Choreo.Workflow builders and
returns an ordinary %Choreo.Workflow{}. It is useful for business processes,
approvals, Sagas, CI/CD flows, and system-design walkthroughs where the shape of
execution matters more than builder ceremony.
Examples
iex> import Choreo.Lab.DSL.Workflow
...> flow = workflow do
...> backend = swimlane("Backend")
...> start = begin("Request received")
...> validate = task("Validate token", swimlane: backend, timeout_ms: 100)
...> authorized = decision("Authorized?")
...> accepted = finish("Return 200")
...> rejected = finish("Return 403")
...>
...> start ~> validate
...> validate ~> authorized
...> authorized ~> accepted |> condition("yes")
...> failure authorized ~> rejected, "no"
...> end
iex> Enum.sort(Choreo.Workflow.starts(flow))
[:start]
iex> Enum.sort(Choreo.Workflow.ends(flow))
[:accepted, :rejected]Edges can use generic, typed, or pipe-modified forms:
start ~> validate
decision ~> approved |> condition("yes")
edge task ~> retry_step, retry: "temporary failure"
failure task ~> rollback, "validation failed"
compensation rollback ~> done, "cleanup finished"
Summary
Functions
Returns the vocabulary supported by the workflow DSL.
Compatibility alias for taxonomy/0.
Builds a %Choreo.Workflow{} from a compact Lab DSL block.
Types
@type edge_decl() :: %{from: Yog.node_id(), to: Yog.node_id(), opts: keyword()}
@type node_decl() :: %{id: Yog.node_id(), builder: atom(), opts: keyword()}
Functions
@spec taxonomy() :: %{ swimlanes: [atom()], nodes: [atom()], edges: [atom()], modifiers: [atom()], options: [atom()] }
Returns the vocabulary supported by the workflow DSL.
iex> taxonomy = Choreo.Lab.DSL.Workflow.taxonomy()
iex> :task in taxonomy.nodes
true
iex> :swimlane in taxonomy.swimlanes
true
iex> :failure in taxonomy.edges
true
@spec verbs() :: map()
Compatibility alias for taxonomy/0.
Builds a %Choreo.Workflow{} from a compact Lab DSL block.