Skip to main content

Workflow Endpoints

Endpoints for managing and executing workflows.

List Workflows​

GET /control/workflows

Response:

{
"success": true,
"data": [
{
"id": "login-flow",
"name": "Login Flow",
"description": "User authentication workflow",
"stepCount": 4
},
{
"id": "checkout-flow",
"name": "Checkout Flow",
"stepCount": 6
}
]
}

Get Workflow​

GET /control/workflow/:id

Response:

{
"success": true,
"data": {
"id": "login-flow",
"name": "Login Flow",
"description": "User authentication workflow",
"steps": [
{
"id": "enter-email",
"type": "action",
"target": "login-email",
"action": "type",
"params": { "text": "{{email}}" }
},
{
"id": "enter-password",
"type": "action",
"target": "login-password",
"action": "type",
"params": { "text": "{{password}}" }
},
{
"id": "submit",
"type": "action",
"target": "login-submit",
"action": "click"
},
{
"id": "wait-dashboard",
"type": "wait",
"target": "dashboard-header",
"waitFor": "visible",
"timeout": 5000
}
],
"variables": {
"email": "",
"password": ""
}
}
}

Run Workflow​

POST /control/workflow/:id/run

Request Body:

{
"params": {
"email": "user@example.com",
"password": "secret123"
},
"startStep": null,
"stopStep": null,
"stepTimeout": 5000,
"workflowTimeout": 30000
}
FieldTypeDescription
paramsobjectVariable values
startStepstringStep ID to start from
stopStepstringStep ID to stop at
stepTimeoutnumberPer-step timeout (ms)
workflowTimeoutnumberTotal timeout (ms)

Response:

{
"success": true,
"data": {
"workflowId": "login-flow",
"runId": "run-abc123",
"status": "completed",
"steps": [
{
"stepId": "enter-email",
"stepType": "action",
"success": true,
"durationMs": 150,
"timestamp": 1234567890
},
{
"stepId": "enter-password",
"stepType": "action",
"success": true,
"durationMs": 120,
"timestamp": 1234567891
},
{
"stepId": "submit",
"stepType": "action",
"success": true,
"durationMs": 50,
"timestamp": 1234567892
},
{
"stepId": "wait-dashboard",
"stepType": "wait",
"success": true,
"durationMs": 800,
"timestamp": 1234567893
}
],
"totalSteps": 4,
"success": true,
"startedAt": 1234567890,
"completedAt": 1234567894,
"durationMs": 1120
}
}

Failed Workflow Response​

{
"success": true,
"data": {
"workflowId": "login-flow",
"runId": "run-abc124",
"status": "failed",
"steps": [
{
"stepId": "enter-email",
"stepType": "action",
"success": true,
"durationMs": 150,
"timestamp": 1234567890
},
{
"stepId": "enter-password",
"stepType": "action",
"success": false,
"error": "Element not found",
"durationMs": 50,
"timestamp": 1234567891
}
],
"totalSteps": 4,
"success": false,
"error": "Element not found",
"startedAt": 1234567890,
"completedAt": 1234567891,
"durationMs": 200
}
}

Get Workflow Status​

GET /control/workflow/:runId/status

Get status of a running or completed workflow.

Response:

{
"success": true,
"data": {
"workflowId": "checkout-flow",
"runId": "run-xyz789",
"status": "running",
"steps": [...],
"currentStep": 3,
"totalSteps": 6,
"startedAt": 1234567890,
"durationMs": 2500
}
}

Status Values​

StatusDescription
pendingNot yet started
runningCurrently executing
completedSuccessfully finished
failedFailed with error
cancelledManually cancelled

Examples​

Run Login Workflow​

curl -X POST http://localhost:9876/ui-bridge/control/workflow/login-flow/run \
-H "Content-Type: application/json" \
-d '{
"params": {
"email": "user@example.com",
"password": "secret123"
}
}'

Run Partial Workflow​

curl -X POST http://localhost:9876/ui-bridge/control/workflow/checkout-flow/run \
-H "Content-Type: application/json" \
-d '{
"params": { "productId": "123" },
"startStep": "add-to-cart",
"stopStep": "review-order"
}'

Check Run Status​

curl http://localhost:9876/ui-bridge/control/workflow/run-abc123/status