-
Notifications
You must be signed in to change notification settings - Fork 2
Pipelines
lacause edited this page Mar 29, 2026
·
1 revision
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.
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
| Syntax | Resolves to |
|---|---|
{input.topic} |
Pipeline-level input variable |
{research} |
Output of the chain with id: research
|
"literal" |
Literal string value |
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
- 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.
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}
Use run_pipeline with name "my-pipeline" and inputs: topic = "AI agents"
| 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 |
- Keep chains reusable — Design chains with generic inputs so they work in multiple pipelines
- Use conditions — Skip expensive chains when upstream results indicate they're not needed
- Minimize data passing — Use transforms in chains to reduce output size before passing to the next chain
-
Name chains clearly — Use
idandlabelto make pipeline execution logs readable
- Chain Format — How to define individual chains
- REST API — Pipeline API endpoints
-
MCP Tools —
run_pipeline,pipeline_statustools