Workflows & Pipelines
Individual agent calls are useful. Chaining them into automated workflows that branch, loop, and run in parallel — that's where the real leverage is. Open Astra includes a workflow engine with conditionals and parallel execution, plus a simpler pipeline system for sequential agent chaining. Add prompt management, A/B testing, and webhooks and you have a complete automation platform.
Why this matters
- Automate multi-step processes — research, draft, review, publish in one API call with branching and error handling
- Test before you commit — A/B test different agent configurations, run parameter sweeps, and hold tournaments to find the best setup
- Manage prompts as code — version, hot-swap, and roll back prompts without redeploying
- Connect to your stack — webhooks with HMAC signing push events to your CI, Slack, or any HTTP endpoint
Workflows
A workflow consists of named steps that can be agent calls, tool invocations, conditions, or parallel groups.
# Create a workflow
curl -X POST http://localhost:3000/workflows \
-H "Authorization: Bearer ${JWT_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"name": "Content Pipeline",
"description": "Research, draft, review, and publish",
"definition": {
"steps": [
{ "type": "agent", "id": "research", "agentId": "research-agent", "message": "Research {{topic}}", "outputVar": "research_output" },
{ "type": "agent", "id": "draft", "agentId": "writer-agent", "message": "Write article using: {{research_output}}", "outputVar": "draft" },
{ "type": "agent", "id": "review", "agentId": "review-agent", "message": "Review: {{draft}}", "outputVar": "feedback" },
{ "type": "condition", "id": "check", "expr": "feedback.approved", "then": "publish", "else": "revise" },
{ "type": "agent", "id": "publish", "agentId": "ops-agent", "message": "Publish: {{draft}}" },
{ "type": "agent", "id": "revise", "agentId": "writer-agent", "message": "Revise using: {{feedback}}", "outputVar": "draft" }
]
}
}'Step types
| Type | Description | Key fields |
|---|---|---|
agent | Call an agent with a message | agentId, message, outputVar |
tool | Invoke a tool directly | toolName, params, outputVar |
condition | Branch based on an expression | expr, then, else |
parallel | Run multiple steps concurrently | steps[] |
Executing a workflow
# Execute a workflow
curl -X POST http://localhost:3000/workflows/wf_abc123/run \
-H "Authorization: Bearer ${JWT_TOKEN}" \
-H "Content-Type: application/json" \
-d '{ "input": { "topic": "Edge computing for IoT" } }'
# Response
{
"run": {
"id": "run_def456",
"status": "success",
"vars": { "research_output": "...", "draft": "...", "feedback": "..." },
"error": null
}
}Pipelines
Pipelines are simpler than workflows — a linear chain of agent stages. Each stage's output becomes the next stage's input. Max 20 stages, max 100K input characters.
# Run a sequential pipeline (chain agents in order)
curl -X POST http://localhost:3000/pipelines/run \
-H "Authorization: Bearer ${JWT_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"input": "Analyze the security posture of our API gateway",
"stages": [
{ "agentId": "security-agent" },
{ "agentId": "report-agent", "systemPromptSuffix": "Format as executive summary" }
]
}'Pipeline templates
Pipeline templates are predefined in a pipeline-templates.yml file. List available templates with GET /pipeline-templates and execute them with POST /pipeline-templates/execute.
More workflow features
| Feature | Description | Docs |
|---|---|---|
| Prompt Management | Version, hot-swap, and restore prompts with TTL-based overrides | Prompts |
| Experimentation | Playground, batch inference, A/B tests, parameter sweeps, and tournaments | Experimentation |
| Webhooks | HMAC-signed event delivery with test mode and delivery inspector | Webhooks |
Endpoint reference
| Method | Endpoint | Description |
|---|---|---|
POST | /workflows | Create workflow |
GET | /workflows | List workflows (limit 100) |
GET | /workflows/:id | Get workflow |
DELETE | /workflows/:id | Delete workflow |
POST | /workflows/:id/run | Execute workflow |
GET | /workflows/:id/runs | List runs (limit 50) |
POST | /pipelines/run | Run pipeline |
GET | /pipeline-templates | List templates |
POST | /pipeline-templates/execute | Execute template |