Skip to content

Pipelines

lacause edited this page Mar 29, 2026 · 1 revision

Pipelines

Pipelines chain multiple chains together, passing outputs between them. Use pipelines when a workflow is too complex for a single chain, or when you want to reuse existing chains.

Format

name: my-pipeline
description: "What this pipeline does"
version: "1.0"

inputs:
  - name: topic
    description: "The topic to research and write about"

chains:
  - id: research
    chain: deep-researcher          # Name of an existing chain
    label: "Research phase"
    inputs:
      topic: "{input.topic}"        # Map pipeline input → chain input
      depth: "deep"                 # Literal value

  - id: write
    chain: content-engine
    label: "Writing phase"
    depends_on: [research]          # Wait for research to complete
    inputs:
      topic: "{input.topic}"
      tone: "professional"
    condition: '{research} != ""'   # Skip if research returned empty

output: write                       # Which chain's output is the pipeline result

Variable References

Syntax Resolves to
{input.topic} Pipeline-level input variable
{research} Output of the chain with id: research
"literal" Literal string value

Dependency Graph

Like chains, pipeline chains support depends_on for ordering:

chains:
  # Phase 1 (parallel)
  - id: market
    chain: market-research
    inputs: { industry: "{input.industry}" }

  - id: competitors
    chain: competitive-intel
    inputs: { company: "{input.company}" }

  # Phase 2 (waits for both)
  - id: strategy
    chain: strategy-builder
    depends_on: [market, competitors]
    inputs:
      market_data: "{market}"
      competitor_data: "{competitors}"

output: strategy

Conditional Execution

- id: optional_step
  chain: advanced-analysis
  depends_on: [basic_analysis]
  condition: '{basic_analysis} contains "needs deeper investigation"'
  inputs:
    data: "{basic_analysis}"

If condition evaluates to false, the chain is skipped.

Executing Pipelines

REST API

curl -X POST http://localhost:4242/pipelines/my-pipeline/execute \
  -H "Content-Type: application/json" \
  -d '{"input": {"topic": "AI agents"}}'

# Response: {"executionId": "..."}

# Check status
curl http://localhost:4242/pipeline-executions/{id}

MCP

Use run_pipeline with name "my-pipeline" and inputs: topic = "AI agents"

Included Demo Pipelines

Pipeline Chains Description
research-to-content deep-researcher → content-engine Research a topic, then write an article
product-intelligence competitive-intel → market-monitor Competitive analysis + real-time market alerts

Best Practices

  1. Keep chains reusable — Design chains with generic inputs so they work in multiple pipelines
  2. Use conditions — Skip expensive chains when upstream results indicate they're not needed
  3. Minimize data passing — Use transforms in chains to reduce output size before passing to the next chain
  4. Name chains clearly — Use id and label to make pipeline execution logs readable

See Also

Clone this wiki locally