Orchestrations API Reference¶
Complete API reference for the Centrali Orchestration Service.
Base URL¶
Authentication¶
All requests require a Bearer token:
Orchestrations¶
List Orchestrations¶
Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
page | number | 1 | Page number |
pageSize | number | 20 | Items per page (max 100) |
sort | string | createdAt | Sort field |
order | string | desc | Sort order (asc or desc) |
Response:
{
"data": [
{
"id": "orch_abc123",
"slug": "order-processing",
"name": "Order Processing Workflow",
"description": "Process new orders",
"version": 1,
"isActive": true,
"trigger": {
"type": "event-driven",
"eventType": "record.created",
"structureSlug": "orders"
},
"createdAt": "2025-01-15T10:00:00Z",
"updatedAt": "2025-01-15T10:00:00Z",
"createdBy": "user_xyz789",
"updatedBy": "user_xyz789"
}
],
"meta": {
"total": 1,
"page": 1,
"pageSize": 20
}
}
Get Orchestration¶
Response:
{
"id": "orch_abc123",
"slug": "order-processing",
"name": "Order Processing Workflow",
"description": "Process new orders",
"version": 1,
"isActive": true,
"trigger": {
"type": "event-driven",
"eventType": "record.created",
"structureSlug": "orders"
},
"steps": [
{
"id": "validate",
"name": "Validate Order",
"type": "compute",
"functionId": "func_abc123",
"timeoutMs": 30000,
"nextStepId": "process"
},
{
"id": "process",
"name": "Process Order",
"type": "compute",
"functionId": "func_def456"
}
],
"createdAt": "2025-01-15T10:00:00Z",
"updatedAt": "2025-01-15T10:00:00Z",
"createdBy": "user_xyz789",
"updatedBy": "user_xyz789"
}
Create Orchestration¶
Request Body:
{
"slug": "order-processing",
"name": "Order Processing Workflow",
"description": "Process new orders through validation and fulfillment",
"trigger": {
"type": "event-driven",
"eventType": "record.created",
"structureSlug": "orders"
},
"steps": [
{
"id": "validate",
"name": "Validate Order",
"type": "compute",
"functionId": "func_abc123",
"nextStepId": "check-result"
},
{
"id": "check-result",
"name": "Check Validation",
"type": "decision",
"cases": [
{
"conditions": [
{ "path": "steps.validate.output.isValid", "op": "eq", "value": true }
],
"nextStepId": "fulfill"
}
],
"defaultNextStepId": "reject"
},
{
"id": "fulfill",
"name": "Fulfill Order",
"type": "compute",
"functionId": "func_def456"
},
{
"id": "reject",
"name": "Reject Order",
"type": "compute",
"functionId": "func_ghi789"
}
]
}
Response: 201 Created
{
"id": "orch_abc123",
"slug": "order-processing",
"name": "Order Processing Workflow",
"version": 1,
"isActive": true,
...
}
Update Orchestration¶
Request Body:
{
"name": "Updated Order Processing",
"description": "Updated description",
"isActive": true,
"trigger": {
"type": "event-driven",
"eventType": "record.created",
"structureSlug": "orders"
},
"steps": [...]
}
Response: 200 OK
Delete Orchestration¶
Response: 204 No Content
Runs¶
List Runs¶
Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
page | number | 1 | Page number |
pageSize | number | 20 | Items per page |
status | string | - | Filter by status |
Response:
{
"data": [
{
"id": "run_xyz789",
"orchestrationId": "orch_abc123",
"status": "completed",
"triggerType": "event-driven",
"triggerMetadata": {
"eventType": "record.created",
"recordId": "rec_123"
},
"currentStepId": null,
"startedAt": "2025-01-15T10:00:00Z",
"completedAt": "2025-01-15T10:00:15Z",
"hasErrors": false,
"delayStepCount": 0,
"correlationId": "corr_abc123"
}
],
"meta": {
"total": 1,
"page": 1,
"pageSize": 20
}
}
Run Status Values:
| Status | Description |
|---|---|
pending | Run is queued |
running | Run is executing |
waiting | Run is waiting (delay step) |
completed | Run finished successfully |
failed | Run failed with error |
Get Run Details¶
Response:
{
"id": "run_xyz789",
"orchestrationId": "orch_abc123",
"status": "completed",
"triggerType": "event-driven",
"triggerMetadata": {
"eventType": "record.created",
"recordId": "rec_123"
},
"input": {
"event": "record_created",
"workspaceSlug": "my-workspace",
"recordSlug": "orders",
"recordId": "rec_123",
"data": { ... }
},
"context": {},
"stepOutputs": {
"validate": { "isValid": true },
"fulfill": { "orderId": "ord_123" }
},
"currentStepId": null,
"executedSteps": ["validate", "check-result", "fulfill"],
"startedAt": "2025-01-15T10:00:00Z",
"completedAt": "2025-01-15T10:00:15Z",
"hasErrors": false,
"errors": []
}
Trigger Run¶
Manually trigger an orchestration run.
Request Body:
Response: 201 Created
{
"id": "run_xyz789",
"orchestrationId": "orch_abc123",
"status": "pending",
"triggerType": "manual",
"startedAt": "2025-01-15T10:00:00Z"
}
Trigger Types¶
Event-Driven Trigger¶
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | "event-driven" |
eventType | string | Yes | Event type to listen for |
structureSlug | string | No | Filter to specific structure |
Supported Event Types: - record.created - record.updated - record.deleted - record.restored - records.bulk_created
Scheduled Trigger¶
Cron Schedule:
{
"type": "scheduled",
"scheduleType": "cron",
"cronExpression": "0 9 * * *",
"timezone": "America/New_York"
}
Interval Schedule:
One-Time Schedule:
{
"type": "scheduled",
"scheduleType": "once",
"scheduledAt": "2025-02-01T09:00:00Z",
"timezone": "UTC"
}
On-Demand Trigger¶
Requires manual invocation via the trigger endpoint.
HTTP Trigger¶
Step Types¶
Compute Step¶
{
"id": "step-id",
"name": "Step Name",
"type": "compute",
"functionId": "func_abc123",
"timeoutMs": 30000,
"nextStepId": "next-step"
}
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Unique step identifier |
name | string | No | Display name |
type | string | Yes | "compute" |
functionId | string | Yes | Compute function ID |
timeoutMs | number | No | Timeout (default: 300000) |
nextStepId | string | No | Next step (null = end) |
Decision Step¶
{
"id": "check-status",
"name": "Check Status",
"type": "decision",
"cases": [
{
"conditions": [
{ "path": "input.status", "op": "eq", "value": "approved" }
],
"nextStepId": "process"
},
{
"conditions": [
{ "path": "input.status", "op": "eq", "value": "rejected" }
],
"nextStepId": "notify-rejection"
}
],
"defaultNextStepId": "review"
}
Delay Step¶
{
"id": "wait",
"name": "Wait 1 Hour",
"type": "delay",
"delayMs": 3600000,
"nextStepId": "continue"
}
Condition Operators¶
| Operator | Description | Value Type |
|---|---|---|
eq | Equals | any |
neq | Not equals | any |
gt | Greater than | number |
gte | Greater than or equal | number |
lt | Less than | number |
lte | Less than or equal | number |
in | Value in array | array |
notIn | Value not in array | array |
exists | Field exists | none |
notExists | Field does not exist | none |
Example Conditions:
// Equals
{ "path": "input.status", "op": "eq", "value": "active" }
// Greater than
{ "path": "input.amount", "op": "gt", "value": 100 }
// In array
{ "path": "input.type", "op": "in", "value": ["premium", "enterprise"] }
// Exists
{ "path": "input.email", "op": "exists" }
Path Syntax¶
Access data in conditions:
| Path | Description |
|---|---|
input.* | Trigger payload data |
context.* | Shared run context |
steps.<id>.output.* | Step output |
Examples:
input.recordId
input.data.data.status
input.data.before.version
steps.validate.output.isValid
context.retryCount
Error Responses¶
400 Bad Request¶
{
"error": "validation_error",
"message": "Invalid request body",
"details": [
{ "field": "trigger.eventType", "message": "required" }
]
}