Skip to content

Factories > Blueprints

Adding human gates to a Blueprint

Require human involvement at stage completion or when a condition holds in a Warp Factories Blueprint.

Open in ChatGPT ↗
Ask ChatGPT about this page
Open in Claude ↗
Ask Claude about this page
Copied!

A gate requires a worker to involve a person when a condition holds or a stage’s work ends. Use it to request approval for an action or change, such as reviewing a plan before implementation or approving a migration discovered during the work.

In factory.yaml, add a named gate under the planning stage’s gates. The question belongs beside the work that produces the plan, not only in a general foreman prompt.

Stage under blueprint.stages
plan:
worker: foreman
inputs: The request and repository context.
prompt: Propose a short plan with scope and checks. Do not edit code.
outputs: The plan and the plan-review answer.
gates:
plan-review:
prompt: Review the plan. Approve it or describe the changes you want.
outputs: Approval of this plan, or requested changes to it.
to:
- stage: plan
when: The plan-review answer requests changes.
- stage: implement
when: The plan-review answer approves the current plan.

Choose a stable gate name, such as plan-review, so the transitions can refer to its answer. prompt states what to ask; outputs describes the answers needed to continue. Without when, the gate opens after the stage’s work is done.

The stage stays open while the question is unanswered. “Changes requested” satisfies the gate but selects the revision transition. An unrelated reply or a question back does not approve the plan. A revised plan is a new review matter and needs its own answer.

For questions that depend on the work, add when. This gate can open during implementation when the worker discovers a migration:

Gate under an implementation stage's gates
migration-review:
when: The proposed change adds or alters a database migration.
prompt: Ask the service owner to review the migration and its rollout plan.
outputs: Approval, requested changes, or a decision not to proceed.

Write a condition the worker can assess from the task and its results. Include the material and context a person needs to answer. If several gates open together, the worker asks them together; every open question must be answered before the stage finishes.

For a leaf stage, the worker doing the work checks its gates and relays questions through the foreman. A gate on a delegated group is checked by the worker that dispatched the group, after the group’s result returns.

After validating and applying the definition, answer gate questions in the original conversation with the foreman. See workflow decisions and repository permissions for the boundary between gates and access controls.