Create a new flow
Create a new flow in draft status.
Creates a flow definition that can be executed via the flow executions API. New flows are assigned version 1 and status ‘draft’, allowing iterative development before marking as ‘published’ for production use.
Flow Lifecycle
- Draft: Newly created flows start here. Editable and testable.
- Published: Ready for production. Can be executed by end users.
DSL Validation
The flow definition is validated against the DSL schema during creation.
If validation fails, a 400 error is returned with detailed error messages
in the details array.
Common Validation Errors
- Missing required fields (tasks, edges)
- Invalid task executor names
- Circular dependencies in task graph
- Invalid parameter types for 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
Include topologically sorted list of task names in execution order. Useful for visualizing task dependencies. Adds ~50ms latency for complex flows with 20+ tasks.
Include DSL validation errors if the flow definition is malformed. Essential for debugging invalid flows during development. No performance impact as validation runs regardless.
Include runtime configuration options for each task (e.g., dropdown values, available resources). Requires authentication to external services. May add 100-500ms latency depending on integration APIs.
Include JSON Schema definitions for each task's output structure. Required for building dynamic UIs or validating task connections.
Include JSON Schema definitions for input task executors' input structure. Calls get_input_model() to generate dynamic input schemas for form building.
Body
Request body for creating a new flow.
Flows represent workflow definitions with tasks, dependencies, and execution logic. Upon creation, flows are assigned version 1 and status 'draft'.
Flow definition in DSL format. Must include tasks array, edges array, and version. See Flow DSL documentation for schema details.
Human-readable name for the flow. Displayed in UI and logs.
1 - 255Optional detailed description of the flow's purpose and behavior. Supports markdown.
5000Flow-level configuration settings.
Access control level. Determines who can view and execute this flow. Options: 'private' (creator only), 'organization' (all org members), 'public' (anyone with link).
Response
Flow created successfully
Response model for a flow object.
Represents a complete flow definition with metadata, execution statistics, and optional computed fields. Use query parameters to include additional fields that require extra processing.
Expansion Parameters
Control which computed fields are included using these query parameters:
include_ordered_task_names: Addstask_namesfield with topological sortinclude_validation_errors: Addsvalidation_errorsfield if flow is invalidinclude_dynamic_data: Enriches each task indefinitionwith runtime config optionsinclude_output_schemas: Enriches each task indefinitionwith JSON schema
Performance Considerations
Each expansion parameter adds processing overhead. Only request fields you need:
- Base response: ~50-100ms
+ include_ordered_task_names: +50ms for 20+ tasks+ include_dynamic_data: +100-500ms (calls external APIs)+ include_output_schemas: +10-50ms+ include_validation_errors: No overhead (always validated)
Complete flow definition in DSL format. May be enriched with additional fields when using expansion parameters (include_dynamic_data, include_output_schemas). Enriched fields are added to each task within definition.tasks[].
Human-readable flow name
Whether this is the latest version of the flow
Organization that owns this flow
Flow lifecycle status. Values: 'draft' (editable), 'published' (ready for production use)
Flow version number. Increments on each update.
x >= 1Detailed flow description
Total number of times this flow has been executed across all versions
Flow-level configuration settings
Topologically sorted list of task names in execution order. Only included when include_ordered_task_names=true. Useful for visualizing task dependencies and execution flow.
DSL validation errors if the flow definition is malformed. Only included when include_validation_errors=true. Empty list indicates a valid flow. Each error contains location and message details.