Skip to main content

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:

FieldTypeDescription
namestringStage identifier
agentstringAgent name or template slug to run
orderintegerExecution order
depends_onstring[]Stage names that must complete first
configobjectConfiguration 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

MethodPathDescription
GET/agent-pipelinesList pipelines
POST/agent-pipelinesCreate a pipeline
GET/agent-pipelines/:idGet pipeline details
PATCH/agent-pipelines/:idUpdate a pipeline
DELETE/agent-pipelines/:idDelete a pipeline
POST/agent-pipelines/:id/executeRun a pipeline
GET/agent-pipelines/templatesList pipeline templates
POST/agent-pipelines/templates/:id/cloneClone a template