Skip to main content

Workflow Composition

Workflows can call other workflows. This lets you build modular, reusable pipelines.

Calling a sub-workflow as a step

The sub-workflow’s state is grafted into the parent under the step’s namespace. Run-level metrics (cost, duration, tokens) are cumulated into the parent’s run.

Calling a sub-workflow as a gate (validator)

A workflow with type: validate (output = bool) is usable as a gate:
The validator executes its own GET → RUN → GATE cycle. Its comments are accessible via {gate.review.comments}.

Calling a sub-workflow in GET

A workflow whose output feeds the prompt:
The workflow in get: executes before the RUN of the current step. Its output enters the state and the prompt can reference it.

Inputs

Workflows don’t declare an inputs: block. Required keywords are deduced by Gump by scanning variables. If a required keyword can’t be resolved, --dry-run raises an error. Resolution order: explicit values from caller → parent step state → parent workflow state → error. A called workflow is autonomous — it can be run standalone: gump run validators/arch-review --set diff=... --set agent=....

State grafting

When a sub-workflow completes, its entire state is grafted under the calling step’s namespace. No explicit return — the entire state is the interface. The parent accesses sub-workflow outputs via:

Workflow resolution

Cascade: project .gump/workflows/ → user ~/.gump/workflows/ → built-in go:embed.