# `Choreo.Lab.DSL.Workflow`
[🔗](https://github.com/code-shoily/choreo/blob/v0.14.1/lib/choreo/lab/dsl/workflow.ex#L1)

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"

# `edge_decl`

```elixir
@type edge_decl() :: %{from: Yog.node_id(), to: Yog.node_id(), opts: keyword()}
```

# `node_decl`

```elixir
@type node_decl() :: %{id: Yog.node_id(), builder: atom(), opts: keyword()}
```

# `swimlane_decl`

```elixir
@type swimlane_decl() :: %{id: String.t(), opts: keyword()}
```

# `begin`

# `compensates`

# `compensation`

# `condition`

# `decision`

# `done`

# `edge`

# `edge_type`

# `end_event`

# `error`

# `event`

# `failure`

# `finish`

# `fork`

# `gateway`

# `join`

# `lane`

# `merge`

# `on`

# `retry`

# `rollback`

# `sequence`

# `signal`

# `split`

# `start`

# `step`

# `swimlane`

# `task`

# `taxonomy`

```elixir
@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

# `terminal`

# `then`

# `timeout`

# `timer`

# `type`

# `verbs`

```elixir
@spec verbs() :: map()
```

Compatibility alias for `taxonomy/0`.

# `weight`

# `when_`

# `workflow`
*macro* 

Builds a `%Choreo.Workflow{}` from a compact Lab DSL block.

# `workflow`
*macro* 

---

*Consult [api-reference.md](api-reference.md) for complete listing*
