Skip to main content

Workflows API

Complete API reference for managing workflows with JavaScript, cURL, and MCP examples.

Overview

Workflows define the processing logic for incoming messages. Each workflow contains:

  • Workflow Data: A tree structure of connected entities (events, prompts, actions)
  • isActive: Whether the workflow processes incoming messages
  • Organization/Environment: Scope for the workflow

Endpoints

OperationMethodEndpoint
ListGET/api/workflows
CreatePOST/api/workflows
Get by IDGET/api/workflows/{id}
UpdatePUT/api/workflows/{id}
DeleteDELETE/api/workflows/{id}
TriggerPOST/api/workflows/{id}/trigger
List VersionsGET/api/workflows/{id}/versions
Get VersionGET/api/workflows/{id}/versions/{versionId}

List Workflows

Retrieve workflows with optional filtering.

cURL

curl -X GET "https://console.rocketwavelabs.io/api/workflows?organizationId=ORG_UUID&environmentId=ENV_UUID&page=1&limit=10" \
-H "Cookie: rocketwave_session=YOUR_SESSION_TOKEN"

JavaScript

// Using fetch directly
const response = await fetch('/api/workflows?organizationId=ORG_UUID&environmentId=ENV_UUID', {
credentials: 'include'
});
const data = await response.json();
console.log(data.data); // Array of workflows
console.log(data.pagination); // { page, limit, total, totalPages }

MCP

const response = await fetch('/api/mcp/tools/call', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({
name: 'workflows_list',
arguments: {
organizationId: 'ORG_UUID',
environmentId: 'ENV_UUID',
page: 1,
limit: 10
}
})
});

Query Parameters

ParameterTypeRequiredDescription
organizationIdUUIDYesFilter by organization
environmentIdUUIDNoFilter by environment
isActivebooleanNoFilter by active status
hasScheduledEventsbooleanNoFilter workflows with scheduled events
pagenumberNoPage number (default: 1)
limitnumberNoItems per page (default: 10)

Response

{
"data": [
{
"id": "60b623c2-c144-46b1-abec-83b684a41555",
"organizationId": "ORG_UUID",
"environmentId": "ENV_UUID",
"name": "Social Media Pipeline",
"description": "Process social media events",
"isActive": true,
"hasScheduledEvents": true,
"workflowData": { ... },
"createdAt": "2026-01-15T10:00:00Z",
"updatedAt": "2026-01-29T14:00:00Z"
}
],
"pagination": { "page": 1, "limit": 10, "total": 5, "totalPages": 1 }
}

Create Workflow

Create a new workflow.

cURL

curl -X POST "https://console.rocketwavelabs.io/api/workflows" \
-H "Content-Type: application/json" \
-H "Cookie: rocketwave_session=YOUR_SESSION_TOKEN" \
-d '{
"organizationId": "ORG_UUID",
"environmentId": "ENV_UUID",
"name": "My Workflow",
"description": "Process incoming events",
"isActive": true,
"workflowData": {
"root": {
"name": "event-node",
"label": "Start Event",
"entityId": "EVENT_ENTITY_UUID",
"entityType": "event",
"children": []
}
}
}'

JavaScript

const response = await fetch('/api/workflows', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({
organizationId: 'ORG_UUID',
environmentId: 'ENV_UUID',
name: 'My Workflow',
description: 'Process incoming events',
isActive: true,
workflowData: {
root: {
name: 'event-node',
label: 'Start Event',
entityId: 'EVENT_ENTITY_UUID',
entityType: 'event',
children: []
}
}
})
});

MCP

const response = await fetch('/api/mcp/tools/call', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({
name: 'workflows_create',
arguments: {
organizationId: 'ORG_UUID',
environmentId: 'ENV_UUID',
name: 'My Workflow',
description: 'Process incoming events',
isActive: true
}
})
});

Request Body

FieldTypeRequiredDescription
organizationIdUUIDYesOrganization ID
environmentIdUUIDYesEnvironment ID
namestringYesWorkflow name
descriptionstringNoWorkflow description
isActivebooleanNoWhether workflow is active (default: false)
workflowDataobjectNoWorkflow tree structure

Get Workflow by ID

Retrieve a single workflow by its ID.

cURL

curl -X GET "https://console.rocketwavelabs.io/api/workflows/WORKFLOW_UUID" \
-H "Cookie: rocketwave_session=YOUR_SESSION_TOKEN"

JavaScript

const response = await fetch('/api/workflows/WORKFLOW_UUID', {
credentials: 'include'
});
const workflow = await response.json();

MCP

const response = await fetch('/api/mcp/tools/call', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({
name: 'workflows_get',
arguments: { id: 'WORKFLOW_UUID' }
})
});

Update Workflow

Update an existing workflow.

cURL

curl -X PUT "https://console.rocketwavelabs.io/api/workflows/WORKFLOW_UUID" \
-H "Content-Type: application/json" \
-H "Cookie: rocketwave_session=YOUR_SESSION_TOKEN" \
-d '{
"name": "Updated Workflow Name",
"isActive": true
}'

JavaScript

const response = await fetch('/api/workflows/WORKFLOW_UUID', {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({
name: 'Updated Workflow Name',
isActive: true
})
});

MCP

const response = await fetch('/api/mcp/tools/call', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({
name: 'workflows_update',
arguments: {
id: 'WORKFLOW_UUID',
name: 'Updated Workflow Name',
isActive: true
}
})
});

Delete Workflow

Permanently delete a workflow.

cURL

curl -X DELETE "https://console.rocketwavelabs.io/api/workflows/WORKFLOW_UUID" \
-H "Cookie: rocketwave_session=YOUR_SESSION_TOKEN"

JavaScript

await fetch('/api/workflows/WORKFLOW_UUID', {
method: 'DELETE',
credentials: 'include'
});

MCP

const response = await fetch('/api/mcp/tools/call', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({
name: 'workflows_delete',
arguments: { id: 'WORKFLOW_UUID' }
})
});

Trigger Workflow (Manual Execution)

Manually trigger a workflow execution. This is useful for testing workflows or triggering them on-demand without waiting for an incoming message or scheduled event.

cURL

curl -X POST "https://console.rocketwavelabs.io/api/workflows/WORKFLOW_UUID/trigger" \
-H "Content-Type: application/json" \
-H "Cookie: rocketwave_session=YOUR_SESSION_TOKEN" \
-d '{}'

JavaScript

const response = await fetch('/api/workflows/WORKFLOW_UUID/trigger', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({})
});

const result = await response.json();
console.log(result.success); // true
console.log(result.message); // "Workflow triggered successfully"

MCP

const response = await fetch('/api/mcp/tools/call', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({
name: 'workflows_trigger',
arguments: { id: 'WORKFLOW_UUID' }
})
});

Response

{
"success": true,
"message": "Workflow triggered successfully"
}
note

The workflow must be active (isActive: true) to be triggered. The trigger creates a synthetic message that flows through the workflow's event tree.


Version History

Workflows maintain a version history. Each update increments the version number.

List Versions

curl -X GET "https://console.rocketwavelabs.io/api/workflows/WORKFLOW_UUID/versions" \
-H "Cookie: rocketwave_session=YOUR_SESSION_TOKEN"

Get Specific Version

curl -X GET "https://console.rocketwavelabs.io/api/workflows/WORKFLOW_UUID/versions/VERSION_UUID" \
-H "Cookie: rocketwave_session=YOUR_SESSION_TOKEN"

MCP

// List versions
const versionsResponse = await fetch('/api/mcp/tools/call', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({
name: 'workflows_versions',
arguments: { id: 'WORKFLOW_UUID' }
})
});

// Get specific version
const versionResponse = await fetch('/api/mcp/tools/call', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({
name: 'workflows_version_get',
arguments: {
id: 'WORKFLOW_UUID',
versionId: 'VERSION_UUID'
}
})
});

Workflow Data Schema

The workflowData field contains the workflow's visual and logical structure.

interface WorkflowData {
root: WorkflowNode; // Entry point node
orphans?: WorkflowNode[]; // Disconnected nodes
presentation?: {
viewport: { x: number; y: number; zoom: number; }
};
}

interface WorkflowNode {
name: string; // Unique node identifier
label: string; // Display name
entityId: string; // Reference to workflow entity
entityType: 'event' | 'prompt' | 'action';
description?: string;
children: WorkflowNode[]; // Connected downstream nodes
tfCondition?: 'Single Path' | 'True/False' | 'Multi';
logicField?: string; // Field for multi-path routing
value?: string; // Value for multi-path matching
presentation?: {
type: string;
position: { x: number; y: number; }
};
}