Analyze flow definition and extract schemas
Analyze a flow definition to extract task output schemas, dynamic data, and validation errors.
Overview This endpoint validates a flow definition and returns metadata needed for flow building, execution planning, and UI generation. It processes all tasks in the flow definition to extract their output schemas (for type validation), dynamic configuration data (for UI dropdowns and conditional fields), and any structural or semantic validation errors.
Use Cases
- Flow Builder UI: Get task output schemas for downstream task input validation
- Dynamic Configuration: Retrieve runtime-dependent options (e.g., available spreadsheets, databases)
- Flow Validation: Check for errors before saving or executing a flow
- Schema Discovery: Understand what data each task will produce
- Custom Integrations: Programmatically validate and analyze flow definitions
How It Works
- Parses and validates the flow definition structure (basic validation)
- For each task in the flow:
- Loads the task executor implementation
- Calls the executor’s
get_output_model()to get the output schema - Calls the executor’s dynamic data methods (if available) to get runtime options
- Collects any errors encountered during schema/data extraction
- If
full_validation=true, performs additional semantic validation (checks task parameter values, validates connections between tasks, etc.) - Returns all schemas, dynamic data, and validation errors in a single response
Dynamic Data Explained Dynamic data represents configuration options that depend on external state or user credentials. For example:
- Google Sheets task: List of spreadsheets accessible with user’s credentials
- Database task: List of available tables/columns
- API task: Available endpoints or data models from connected service
Validation Levels
- Basic (default): Structure validation only (required fields, data types)
- Full (
full_validation=true): Includes semantic validation (valid references, parameter constraints, external resource availability)
Performance Notes
- May make external API calls to fetch dynamic data (e.g., Google Sheets API)
- Response time varies based on number of tasks and external service latency
- Typical response time: 100ms-2s depending on task executors used
Related Endpoints
POST /flows- Create flow (uses this endpoint’s validation internally)PUT /flows/{flow_id}- Update flow (uses this endpoint’s validation internally)GET /task-executors- List available task executors
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:
Query Parameters
Enable comprehensive semantic validation in addition to basic structural validation. When false (default): Only validates flow structure (required fields, data types, task executor existence). When true: Performs additional validation including: - Task parameter value validation (correct types, valid enums, etc.). - Task connection validation (input/output type compatibility). - Circular dependency detection. - External resource validation (e.g., checking if referenced files exist). Full validation may take longer and make external API calls. Use during flow save/publish operations. Use false (default) for faster validation during editing.
Include JSON Schema definitions for input task executors' input structure. Calls get_input_model() to generate dynamic input schemas for form building. Adds ~10-50ms latency for schema generation.
Body
Request model for task data analysis endpoint.
Accepts a flow definition in the SuperAI Flows DSL format for validation and schema extraction. The flow definition should include all tasks, connections, and configurations needed to execute the flow.
Complete flow definition in SuperAI Flows DSL format. Must include: - 'name': Flow name (string, required). - 'tasks': List of task definitions with task_executor_name, parameters, etc. - 'connections': Optional list of task dependencies and data flows. - 'config': Optional flow-level configuration. The definition will be validated and analyzed to extract task output schemas and dynamic configuration data. Validation errors will be returned in the response if the definition is invalid.
Response
Flow definition successfully analyzed
Response model containing task output schemas, dynamic data, and validation results.
This response provides all metadata needed to build UIs for flow configuration, validate task connections, and understand what data each task will produce. Each field serves a specific purpose in the flow building and validation process.
Runtime-dependent configuration options for tasks, keyed by task name. Contains dynamic values that depend on user credentials, external services, or other runtime state. Format: {task_name: {field_name: options}}. Common use cases: - Dropdown options (e.g., available Google Sheets, database tables). - Conditional field visibility based on other parameters. - Resource lists requiring authentication (e.g., Slack channels). - Default values computed from external state. The structure varies by task executor - check task executor documentation for specific formats. Empty dict if no tasks provide dynamic data or if fetching dynamic data failed (check validation_errors).
JSON schemas for input task executors' inputs, keyed by task name. Each schema describes the structure and types of data the task expects as input. Only included when include_input_schema=true is specified. Format: {task_name: json_schema_object}. JSON schemas follow JSON Schema Draft 7 specification and include: - 'type': Root type (usually 'object'). - 'properties': Object properties with types and descriptions. - 'required': List of required property names. - 'title': Human-readable schema name. Use these schemas to generate input forms for flow execution. Empty dict if include_input_schema=false or no input tasks found.
JSON schemas for task outputs, keyed by task name. Each schema describes the structure and types of data the task will produce. Format: {task_name: json_schema_object}. JSON schemas follow JSON Schema Draft 7 specification and include: - 'type': Root type (usually 'object'). - 'properties': Object properties with types and descriptions. - 'required': List of required property names. - 'title': Human-readable schema name. Use these schemas to validate downstream task inputs and generate UI forms. Empty dict if no tasks have output schemas or if all tasks failed to load.
Human-readable validation error messages describing problems with the flow definition. Errors are returned even if the request succeeds (HTTP 200) - check this field to determine if the flow definition is valid. Empty list indicates a valid flow. Error categories: - Structural errors: Missing required fields, invalid task references. - Semantic errors (full_validation=true only): Invalid parameter values, unreachable tasks, circular dependencies. - Task executor errors: Unknown task executor, failed to load executor. - Schema extraction errors: Failed to determine output schema for task. Each error is a descriptive string suitable for display to users. Example: 'Task "process_data" references unknown task "fetch_data" in input mapping'.