Agent Pipelines
Agent pipelines chain multiple agents into multi-step workflows. Each pipeline defines stages with dependencies, enabling parallel execution and variable passing between agents.
Concepts
- Pipeline: A reusable workflow definition with ordered stages
- Stage: A single step that runs an agent with specific inputs
- Execution: A running instance of a pipeline
- Pipeline template: A pre-built pipeline configuration you can clone
Listing pipelines
curl https://api.orkosi.com/api/agent-pipelines \
-H "Authorization: Bearer TOKEN"
Creating a pipeline
curl -X POST https://api.orkosi.com/api/agent-pipelines \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Feature Development",
"description": "End-to-end feature implementation pipeline",
"stages": [
{
"name": "implement",
"agent": "full-stack-dev",
"order": 1,
"config": { "task": "{{task_id}}" }
},
{
"name": "test",
"agent": "qa-tester",
"order": 2,
"depends_on": ["implement"],
"config": { "target": "{{implement.output_path}}" }
},
{
"name": "deploy",
"agent": "devops",
"order": 3,
"depends_on": ["test"],
"config": { "environment": "staging" }
}
]
}'
Pipeline stages
Stages define the execution graph:
| Field | Type | Description |
|---|---|---|
name | string | Stage identifier |
agent | string | Agent name or template slug to run |
order | integer | Execution order |
depends_on | string[] | Stage names that must complete first |
config | object | Configuration passed to the agent |
Variable substitution
Use {{variable}} syntax to pass data between stages:
{{input.field}}— Reference pipeline input parameters{{stage_name.output_field}}— Reference output from a completed stage{{task_id}}— Built-in pipeline context variables
Parallel execution
Stages with no dependencies (or whose dependencies are all satisfied) run in parallel:
{
"stages": [
{ "name": "lint", "agent": "qa-tester", "order": 1 },
{ "name": "test", "agent": "qa-tester", "order": 1 },
{ "name": "merge", "agent": "devops", "order": 2, "depends_on": ["lint", "test"] }
]
}
In this example, lint and test run concurrently; merge waits for both.
Running a pipeline
curl -X POST https://api.orkosi.com/api/agent-pipelines/1/execute \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{"inputs": {"task_id": 55849}}'
Pipeline templates
Browse pre-built pipeline templates:
curl https://api.orkosi.com/api/agent-pipelines/templates \
-H "Authorization: Bearer TOKEN"
Clone a template into your workspace:
curl -X POST https://api.orkosi.com/api/agent-pipelines/templates/1/clone \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "My CI Pipeline"}'
API reference
| Method | Path | Description |
|---|---|---|
GET | /agent-pipelines | List pipelines |
POST | /agent-pipelines | Create a pipeline |
GET | /agent-pipelines/:id | Get pipeline details |
PATCH | /agent-pipelines/:id | Update a pipeline |
DELETE | /agent-pipelines/:id | Delete a pipeline |
POST | /agent-pipelines/:id/execute | Run a pipeline |
GET | /agent-pipelines/templates | List pipeline templates |
POST | /agent-pipelines/templates/:id/clone | Clone a template |