Skip to main content

Orchestrate REST API

The Orchestrate REST API provides endpoints for workflow execution and management.

Base URL

/api/eai/v3/orchestrate

Execute Workflow

Execute a workflow with input data.

POST /api/eai/v3/orchestrate/workflows/:workflowId/execute

Request Body

{
"input": {
"projectId": "proj_123",
"analysisType": "comprehensive"
},
"async": true,
"metadata": {
"requestedBy": "user_456"
}
}

Example Request

const response = await fetch('/api/eai/v3/orchestrate/workflows/analyze_project/execute', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
input: {
projectId: 'proj_123',
analysisType: 'comprehensive'
},
async: true
})
});

const execution = await response.json();

Response

{
"id": "exec_789",
"workflowId": "analyze_project",
"state": "running",
"input": {
"projectId": "proj_123",
"analysisType": "comprehensive"
},
"steps": [
{
"stepId": "fetch_project",
"name": "Fetch Project Data",
"state": "completed"
},
{
"stepId": "analyze",
"name": "AI Analysis",
"state": "running"
}
],
"startedAt": "2026-03-11T14:00:00Z"
}

Get Execution Status

GET /api/eai/v3/orchestrate/executions/:executionId

Response

{
"id": "exec_789",
"workflowId": "analyze_project",
"state": "completed",
"output": {
"analysis": "Project is on track...",
"risks": ["Budget overrun", "Timeline delay"],
"recommendations": ["Increase resources", "Review schedule"]
},
"steps": [
{
"stepId": "fetch_project",
"state": "completed",
"duration": 234
},
{
"stepId": "analyze",
"state": "completed",
"duration": 5432
}
],
"startedAt": "2026-03-11T14:00:00Z",
"completedAt": "2026-03-11T14:01:15Z"
}

List Workflows

GET /api/eai/v3/orchestrate/workflows

Response

{
"data": [
{
"id": "analyze_project",
"name": "Project Analysis",
"description": "Comprehensive project analysis with AI",
"version": "1.0.0",
"steps": [
{
"id": "fetch_project",
"name": "Fetch Project Data",
"type": "resource_query"
},
{
"id": "analyze",
"name": "AI Analysis",
"type": "ai_chat"
}
]
}
]
}

List Executions

GET /api/eai/v3/orchestrate/executions

Query Parameters

ParameterTypeDescription
workflowIdstringFilter by workflow
statestringFilter by state
limitnumberMax results
offsetnumberPagination offset

Response

{
"data": [
{
"id": "exec_789",
"workflowId": "analyze_project",
"state": "completed",
"startedAt": "2026-03-11T14:00:00Z",
"completedAt": "2026-03-11T14:01:15Z"
}
]
}

Cancel Execution

POST /api/eai/v3/orchestrate/executions/:executionId/cancel

Response

204 No Content

Next Steps