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:
- Validates flow execution exists and is accessible
- Creates status records for each task in batch
- Updates related task output states in parallel
- Sends WebSocket notifications in background task
- 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/ - Receives status notifications
Authorizations
API key authentication. Include your API key in the X-API-Key header as: X-API-Key YOUR_API_KEY
Example:
JWT Bearer token authentication. Include your access token in the Authorization header as: Bearer YOUR_ACCESS_TOKEN
Example:
Path Parameters
UUID of the flow execution receiving task status updates. Must be an active (non-deleted) execution.
Body
Batch request to add multiple task status updates.
Allows system workers to report status changes for multiple tasks in a single API call for improved performance.
Array of task status updates to apply. Minimum: 1 update, Maximum: 100 updates per request. Updates are processed in order provided.
1 - 100 elements