SuperAI Flow Platform

Sections

Theme switcher

List active task tags for a flow execution

List all active tags for task executions within a flow execution.

Overview Retrieve tags associated with task executions in a specific flow execution. Results can be filtered to a single task or return all tasks' tags. Only active tags are returned; soft-deleted tags (status='deleted') are excluded.

What are Task Tags? Task tags provide flexible categorization and workflow state for task executions:

  • Review status: 'reviewed', 'approved', 'rejected'
  • Quality flags: 'quality_checked', 'flagged', 'verified'
  • Custom categories: 'priority_high', 'customer_acme', 'requires_attention' Each tag includes optional metadata for context (reviewer name, notes, etc.)

Filtering Logic Query parameters combine with AND logic:

  • flow_execution_id (required): Return tags for this flow execution
  • task_name (optional): Filter to tags for a specific task Without task_name: Returns all tags across all tasks in the flow execution

Common Query Patterns

  1. All tags in flow execution: GET /task-tags?flow_execution_id={id}

  2. Tags for specific task: GET /task-tags?flow_execution_id={id}&task_name=send_email

  3. Check if task reviewed: GET /task-tags?flow_execution_id={id}&task_name=extract_data Filter results where tag='reviewed'

Response Format Returns array of FlowTaskTagAPI objects with:

  • Tag identification: tag, tag_type, task_name
  • Metadata: tag_metadata (JSON object for custom data)
  • Lifecycle: created_at, updated_at, modified_by
  • Status: Always 'active' (deleted tags excluded)
  • Organization context: organization_id for tenant isolation

Tag Types and Usage Common tag_type values:

  • 'review_status': Workflow state ('reviewed', 'approved', 'rejected')
  • 'quality': Quality assurance ('quality_checked', 'flagged')
  • 'priority': Business priority ('high', 'medium', 'low')
  • 'custom': Domain-specific categories

Performance Considerations

  • Queries scoped by organization_id via RLS (automatic filtering)
  • Indexes on (flow_execution_id, task_name, status) for fast lookups
  • Typical response: 5-50 tags per flow execution
  • Soft-deleted tags excluded at query time (no filtering overhead)

Use Cases

  • Display task status in UI (show 'reviewed' badge)
  • Filter tasks by approval state (find all 'approved' tasks)
  • Audit workflow progression (who reviewed what, when)
  • Custom business logic (trigger actions based on tag presence)

Error Scenarios

  • 400 Bad Request: Invalid UUID format for flow_execution_id
  • 403 Forbidden: User lacks permission to access flow execution's organization
  • 404 Not Found: flow_execution_id doesn't exist Note: Missing task_name is NOT an error; returns empty array

Related Endpoints

  • PATCH /task-tags - Add/remove tags
  • GET /task-executions - List task executions (includes tags via TaskExecutionWithTagsAPI)
  • GET /flow-executions/{id} - View parent flow execution

Header Parameters

Authorizationstring

Query Parameters

flow_execution_idstring Required

Unique identifier of the flow execution to query tags from. Required parameter; returns all active tags for this execution. Combine with task_name to filter to a specific task.

Filtering: Queries automatically scoped to user's organization via RLS. Attempting to access another organization's execution returns 404.

Response: All active tags (status='active') for the execution. Soft-deleted tags (status='deleted') are excluded automatically.

task_namestring

Optional task name to filter tags by specific task. Case-sensitive; must match task name exactly as defined in flow YAML. Omit to return tags for all tasks in the flow execution.

Filtering behavior:

  • Specified: Returns only tags for this task_name
  • Omitted: Returns tags for all tasks in flow execution

Combines with flow_execution_id using AND logic.

Example: task_name='extract_data' returns tags only for that task. Useful for...

Response

200
Object
List of task tags successfully retrieved

Response Attributes

created_atnull
flow_execution_idstring Required

ID of the flow execution containing the tagged task. Establishes execution context and organization scope. Tags are scoped to flow executions; same task in different executions has independent tag sets. Used for filtering tags by execution.

idstring Required

Unique identifier for this tag record. Auto-generated UUID assigned at tag creation. Used for direct tag access and references.

modified_bynull
organization_idstring Required

ID of organization owning this tag. Inherited from parent flow execution for multi-tenant isolation. Used for Row-Level Security (RLS) filtering and authorization. All tags scoped to single organization; cross-org access forbidden. Queries automatically filtered by user's organization_id.

statusnull
tagstring Required

Tag value identifying the categorization or state. Free-form string for flexible workflow customization. Case-sensitive; same tag with different case creates separate records. Combined with tag_type for organized categorization.

Common patterns:

  • Workflow: 'reviewed', 'approved', 'rejected', 'pending'
  • Quality: 'quality_checked', 'flagged', 'verified'
  • Priority: 'high', 'medium', 'low'
  • Custom: Domain-specific values
Min length
1
Max length
200
tag_metadatanull
tag_typestring Required

Category or classification for the tag value. Groups related tags for filtering and organization in UI/queries. Case-sensitive; use consistent values across organization.

Common types:

  • 'review_status': Workflow states
  • 'quality': Quality assurance flags
  • 'priority': Business priority levels
  • 'approval': Approval workflow states
  • 'custom': Domain-specific categories
Min length
1
Max length
100
task_namestring Required

Name of the tagged task as defined in flow definition YAML. Case-sensitive identifier matching flow configuration. Tags are attached to task_name within a flow_execution_id. Multiple tags can be attached to the same task.

Min length
1
Max length
200
updated_atnull
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?

GET

/

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