SuperAI Flow Platform

Sections

Theme switcher

Add task status updates (Internal API)

Add task status updates to a flow execution (Internal API).

This endpoint is used by system workers to report task execution status changes. Multiple task statuses can be added in a single request for batch efficiency. Status updates trigger state transitions and WebSocket notifications.

⚠️ Internal API: This endpoint is designed for internal system communication. Direct customer usage is not recommended. Use GET /task-executions instead.

Context: - Called by system workers during task execution - Updates task status records in bulk for performance - Triggers task output state calculations - Sends WebSocket notifications asynchronously - Worker receives immediate response without blocking on notifications

Behavior: 1. Validates flow execution exists and is accessible 2. Creates status records for each task in batch 3. Updates related task output states in parallel 4. Sends WebSocket notifications in background task 5. Returns immediately to worker for low latency

Performance Optimizations: - Batch inserts for multiple status updates (~50ms for 10 tasks) - WebSocket notifications processed asynchronously - Task output state updates use batch operations - Response returns before notification delivery completes

Use Cases: - System workers reporting task start/completion - Bulk status updates during execution - Real-time execution monitoring via WebSocket

Important Notes: - This endpoint does NOT retrieve task status (use GET /task-executions) - Requires service-level authentication token - Not intended for direct customer API integration - WebSocket notifications may arrive after HTTP response

Business Logic: - Task output states recalculated based on new statuses - Multiple status updates for same task create history - Execution-level status not automatically updated - Status transitions not validated (allows any status value)

Related Internal Endpoints: - POST /flow-executions - Creates parent execution - GET /task-executions - Retrieves task execution details - WebSocket /ws/flows/{flow_id} - Receives status notifications

Header Parameters

Authorizationstring

Path Parameters

flow_execution_idstring Required

UUID of the flow execution receiving task status updates. Must be an active (non-deleted) execution.

Body Parameters

statusesarray Required

Array of task status updates to apply. Minimum: 1 update, Maximum: 100 updates per request. Updates are processed in order provided.

Min items
1
Max items
100

Show child attributes

Response

200
Object
Task status updates successfully recorded

Response Attributes

created_atnull
flow_execution_idstring Required
idstring Required
organization_idstring Required
statusstring Required
task_namestring Required
400
Object
Bad Request - Invalid request body or task names

Response Attributes

errorobject Required

Standard error detail structure.

This model matches the error format returned by the centralized exception handlers in app/api/errors/handlers.py.

Show child attributes

request_idnull
403
Object
Forbidden - Requires service-level authentication token

Response Attributes

errorobject Required

Standard error detail structure.

This model matches the error format returned by the centralized exception handlers in app/api/errors/handlers.py.

Show child attributes

request_idnull
404
Object
Not Found - The requested resource does not exist

Response Attributes

errorobject Required

Standard error detail structure.

This model matches the error format returned by the centralized exception handlers in app/api/errors/handlers.py.

Show child attributes

request_idnull
422
Object
Validation Error

Response Attributes

detailarray

Show child attributes

500
Object
Internal Server Error - An unexpected error occurred

Response Attributes

errorobject Required

Standard error detail structure.

This model matches the error format returned by the centralized exception handlers in app/api/errors/handlers.py.

Show child attributes

request_idnull
Was this section helpful?

What made this section unhelpful for you?

POST

/

Select
1

Response

Was this section helpful?

What made this section unhelpful for you?

View as Markdown

Ask an AI

Open in ChatGPTOpen in ClaudeOpen in Perplexity

Code with AI

Open in Copilot