Create Workflow
Workflows
Create Workflow
Create and execute a new ComfyUI workflow
Create Workflow
Overview
Create and execute a new ComfyUI workflow. This endpoint accepts multipart form data to support file uploads for workflow parameters.Workflows are automatically scheduled on available runners based on tag matching. Ensure you have active runners with matching tags.
Content Type
This endpoint requiresmultipart/form-data content type for file upload support.
Maximum file size: 50MB per request
Request Parameters
A descriptive name for your workflow (1-200 characters).
A JSON file containing the ComfyUI workflow definition. This should be exported from ComfyUI or constructed programmatically.
Comma-separated list of tags for runner selection. The workflow will be scheduled on a runner with matching tags.Example:
production,gpu-a100,image-generationDynamic Parameters
The workflow supports dynamic parameters using placeholders:Text parameter - prefix the field name with
$ followed by the placeholder name from your workflow.Example: $prompt for a text promptFile parameter - prefix the field name with
$ followed by the placeholder name, and include the file.Example: $input_image for an image fileChoice parameter - prefix the field name with
# followed by the placeholder name.Example: #sampler for sampler selectionLearn more about placeholders and dynamic parameters in the Workflows concept page.
Response
Unique identifier (UUID) for the workflow.
The workflow’s name.
Initial status of the workflow (typically
accepted).Possible values: accepted, uploaded, queued, running, completed, cancelled, invalid, failedArray of tags associated with the workflow.
ISO 8601 timestamp when the workflow was created.
ISO 8601 timestamp when the workflow was last updated.
ISO 8601 timestamp when execution started (null initially).
ISO 8601 timestamp when execution completed (null initially).
Example Response
cURL Example
Since the API playground doesn’t support file uploads, use this cURL command to test:YOUR_API_TOKENwith your actual API token/path/to/workflow.jsonwith your ComfyUI workflow JSON file/path/to/image.pngwith any input images (if needed)- Add dynamic parameters as needed with
$prefix for text/files,#prefix for choices
-F flag automatically handles multipart/form-data with proper boundaries.
Workflow Lifecycle
After creation, the workflow goes through these states:- accepted - Workflow created and queued for processing
- uploaded - Files uploaded to storage
- queued - Waiting in runner’s queue
- running - Currently executing on a runner
- completed - Execution finished successfully
- failed - Execution failed with an error
- cancelled - Manually cancelled
- invalid - Invalid workflow definition
Error Responses
Bad request - validation error in the request.Common causes:
- Missing required fields (name, workflow_json)
- Invalid workflow JSON structure
- File size exceeds 50MB limit
- Invalid tags format
- Workflow parameter validation failed
- No runner available with matching tags
Unauthorized - invalid or missing authentication token.
Forbidden - workflow parameter limit exceeded for your tier, or insufficient permissions.
Notes
- Workflows are automatically assigned to runners based on tag matching
- If no tags are specified, the workflow can run on any active runner
- File parameters are stored securely and deleted after workflow completion
- Use the subscribe endpoint to monitor workflow progress in real-time
- You can create multiple workflows simultaneously
- Workflow status updates can be monitored via the subscribe (SSE) endpoint or by polling the get endpoint
- Use cURL, Postman, or application code for testing - the API playground doesn’t support file uploads