Overview
This node executes workflows on a ComfyUI server by sending a JSON workflow definition and waiting for the execution to complete. It is designed to integrate ComfyUI's workflow processing capabilities into n8n automation, allowing users to run complex UI-driven workflows remotely and retrieve their outputs.
Common scenarios include:
- Automating image generation or processing pipelines defined in ComfyUI.
- Integrating ComfyUI workflows into larger automation sequences.
- Running custom workflows that produce prompt results and using those results downstream in n8n.
For example, a user can provide a ComfyUI workflow JSON describing an image generation task, execute it via this node, and then use the resulting images or data in subsequent nodes.
Properties
| Name | Meaning |
|---|---|
| Workflow JSON | The ComfyUI workflow described in JSON format. This defines the tasks and flow to execute. |
| Timeout | Maximum time in minutes to wait for the workflow to complete before timing out. Default is 30 minutes. |
Output
The node outputs a JSON array containing all the promptResult outputs returned by the ComfyUI workflow execution. The structure of each output depends on the specific workflow but generally includes the results generated by the workflow (e.g., images, text, or other data).
If the workflow produces binary data (such as images), it will be included in the outputs accordingly, though this node primarily returns JSON representations of those outputs.
Dependencies
- Requires access to a ComfyUI API endpoint with a valid URL and an optional API key for authentication.
- The node expects credentials providing the API URL and API key.
- Network connectivity to the ComfyUI server is necessary.
- No additional external libraries beyond standard n8n helpers are required.
Troubleshooting
- Timeouts: If the workflow takes longer than the specified timeout, the node will throw an execution timeout error. Increase the timeout property if workflows are expected to take longer.
- API Connection Errors: Failure to connect to the ComfyUI API or invalid credentials will cause errors. Verify the API URL and API key are correct and accessible.
- Missing Prompt ID: If the ComfyUI server does not return a prompt ID after submitting the workflow, the node throws an error indicating failure to queue the prompt.
- Execution Failures: If the workflow completes with an error status, the node reports a workflow execution failure.
- No Outputs Found: If the workflow completes successfully but no outputs are returned, an error is thrown indicating missing outputs.
- JSON Parsing: Ensure the provided workflow JSON is valid and correctly formatted; otherwise, parsing errors may occur.
Links and References
- ComfyUI GitHub Repository – For understanding workflow JSON structure and ComfyUI capabilities.
- n8n Documentation on Creating Custom Nodes – For general guidance on node development and usage.