Skip to content

Pipelines

Pipelines allow you to define multi-stage workflows that execute sequentially, with optional approval checkpoints between stages. Each stage can use a different model selected by topic.

  1. Define stages: Each pipeline consists of ordered stages with specific topics and prompts
  2. Execute sequentially: Stages run one after another, with each stage’s output available to the next
  3. Topic routing: Each stage specifies a topic; the best model for that topic is selected automatically
  4. Approval gates: Optional checkpoints pause execution and wait for user approval

Templates are reusable pipeline definitions that can be created, edited, and shared through the web UI.

Use the Pipelines page in the web UI to create templates with:

  • Name: A descriptive name for the pipeline
  • Description: What the pipeline does
  • Stages: Ordered list of stages, each with:
    • Stage name
    • Topic (for model routing)
    • Prompt template
    • Whether an approval gate follows this stage
MethodEndpointDescription
GET/api/pipelines/templatesList all templates
POST/api/pipelines/templatesCreate a new template
PUT/api/pipelines/templates/:idUpdate a template
DELETE/api/pipelines/templates/:idDelete a template

Approval gates are optional checkpoints that pause pipeline execution and wait for user input.

When a pipeline reaches an approval gate:

  1. Execution pauses
  2. A notification is sent to the user
  3. The user reviews the output so far
  4. The user can:
    • Approve — continue to the next stage
    • Skip — skip the next stage and continue
    • Stop — terminate the pipeline

Pipeline stages can be typed as qa_validation, which enables automatic retry with feedback injection. When a QA stage determines that the output from a previous stage does not meet quality standards, the pipeline automatically retries the failed stage with the QA feedback included in the prompt.

  1. A stage is marked with type: "qa_validation" in the template
  2. The QA stage evaluates the previous stage’s output against defined criteria
  3. If validation fails, the pipeline retries the preceding stage with feedback injected
  4. This loop repeats up to 3 times before the pipeline fails or requires manual intervention

In a pipeline template, set the stage type, max retries, and which stage to retry:

{
"name": "Code Quality Check",
"stageType": "qa_validation",
"topic": "review",
"maxRetries": 3,
"retryTargetStage": 2,
"prompt": "Review the code from the previous stage. Check for correctness, edge cases, and test coverage."
}
FieldDescriptionDefault
stageType"standard" or "qa_validation""standard"
maxRetriesMax retry attempts before escalation3
retryTargetStageIndex of the stage to re-run on failurePrevious stage

These fields are configurable per-stage in the pipeline template editor UI (checkbox + dropdowns).

When a pipeline transitions between stages, a structured handoff document is generated and passed to the next stage. This ensures continuity and prevents context loss between agents.

Each handoff document contains:

SectionDescription
DecisionsKey decisions made during the stage and their rationale
ArtifactsFiles created, modified, or referenced (paths, descriptions)
Open QuestionsUnresolved issues or ambiguities for the next stage to address
SummaryA concise summary of what was accomplished

Handoff documents are stored with the pipeline run and visible in the web UI’s pipeline detail view. They provide an audit trail of how each stage contributed to the final result.

MethodEndpointDescription
GET/api/pipelinesList your pipeline runs
GET/api/pipelines/:idGet pipeline detail with stages
POST/api/pipelines/:id/stopStop a running pipeline

Pipeline progress is streamed via WebSocket, allowing the web UI to show live updates as stages execute and complete.

  • Code Review Pipeline: Analyze code, run tests, generate review summary, await approval, then create PR
  • Research Pipeline: Search for information, summarize findings, verify sources, compile report
  • Deployment Pipeline: Run tests, build artifacts, await approval, deploy to staging