SuperAI Flow Platform

Sections

Theme switcher

Create task output

Create a task output record for a completed task and notify connected clients.

Task outputs represent the processed, summarized results of task executions. Unlike task executions which track the full execution lifecycle (input, output, error, status), task outputs focus on the final output data formatted for display, downstream consumption, and workflow decisions.

What Are Task Outputs

Task outputs serve multiple purposes:

  • Structured Results: Store task results in a queryable format via the summary field
  • Full Output Data: Provide complete output for downstream task consumption
  • Metadata Tracking: Associate tags for categorization and filtering
  • Real-time Updates: Enable WebSocket notifications for UI progress tracking
  • Workflow Logic: Support decision-making based on task outcomes

Relationship to Task Executions

  • Task Execution: Full execution record (input, output, error, retries, timing)
  • Task Output: Summarized result optimized for querying and display
  • One task execution typically produces one task output upon completion
  • Task outputs are created by system workers after task completion

Notification Behavior

This endpoint triggers two types of WebSocket notifications asynchronously:

  1. Flow-level notification: Updates all clients subscribed to the flow's WebSocket
  2. Enhanced notification: Broadcasts to summary-watching clients for real-time updates

Notifications are processed in the background to ensure fast response times (< 100ms).

Common Use Cases

  • Workers reporting task completion with structured output
  • Storing task results for display in execution history UI
  • Providing data for downstream task inputs in workflows
  • Triggering real-time progress updates
  • Enabling workflow decisions based on task outcomes

Related Endpoints

  • GET /task-outputs - List all task outputs
  • GET /task-outputs/{id} - Get single task output
  • GET /flow-executions/{id} - View parent flow execution
  • GET /task-executions - View full task execution details

Header Parameters

Authorizationstring

Body Parameters

created_atstring
flow_execution_idstring Required
idstring
modified_bystring
organization_idstring Required
outputnull
statusstring

Valid status values for flow execution lifecycle.

Status Transitions: queued → running → in_progress → completed → failed

Any status → deleted (soft delete)
completed/failed → stale (data outdated)

Status Definitions: - queued: Execution created but workflow not yet started - running: Workflow started, initial tasks executing - in_progress: Workflow actively processing tasks - completed: Al...

Default value
queued
Enum values:
queuedrunningin_progresscompletedfaileddeletedstale
summarystring Required
tagsnull
task_namestring Required
updated_atstring

Response

201
Object
Task output successfully created

Response Attributes

created_atnull
flow_execution_idstring Required

ID of the parent flow execution containing this task. Establishes the execution hierarchy and organization scope.

flow_versionnull
Minimum
1
idstring Required

Unique identifier for this task output. Auto-generated UUID assigned at creation time. Used for direct resource access via GET /task-outputs/{id}.

modified_bystring

Identifier of the actor who last modified this task output. Tracks who made the last change for auditing purposes. Defaults to 'system' for worker-initiated changes.

Values:

  • 'system': System-automated changes (workers, background jobs)
  • User ID: UUID string of the user who made the change (e.g., '123e4567-e89b-12d3-a456-426614174000')
  • Integration type: For service accounts/integrations (e.g., 'integration', 'service-account')
Default value
system
organization_idstring Required

ID of the organization owning this task output. Inherited from parent flow execution. Used for Row-Level Security (RLS) and multi-tenant isolation.

outputnull
statusstring Required

Execution status when output was created. Valid values: 'queued', 'running', 'completed', 'failed', 'deleted', 'stale'. Typically 'completed' for successful task outputs.

Status meanings:

  • queued: Task scheduled but not started
  • running: Task actively executing
  • completed: Task finished successfully
  • failed: Task encountered error (may have partial output)
  • deleted: Soft-deleted, excluded from queries (preserves audit trail)
  • stale: Output data is outdated (needs refresh)
summarystring Required

Structured summary of task output for UI display and querying. Typically a dictionary with standardized keys for rendering.

Common patterns:

  • Document processing: {'pages': 10, 'word_count': 5000}
  • API calls: {'status_code': 200, 'response_time_ms': 450}
  • Data validation: {'valid_rows': 950, 'invalid_rows': 50}
tagsnull
task_namestring Required

Name of the task that produced this output. Case-sensitive identifier matching flow definition YAML. Used to associate output with specific workflow task.

Min length
1
Max length
200
updated_atnull
400
Object
Bad Request - Invalid input parameters or request format

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
Flow execution not found for the provided flow_execution_id
422
Object
Unprocessable Entity - Request validation failed

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
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