Automate complex ComfyUI generation tasks using this asynchronous n8n workflow. Integrate Replicate API for AI generation, status polling, and robust error handling using various n8n node types.
Download this n8n workflow template and start using it instantly.
Executing long-running AI generation jobs can be complex due to the requirement for continuous status polling. This comprehensive n8n workflow template solves this challenge by providing a production-ready automation pipeline for running custom ComfyUI workflows via the Replicate API (fofr/any-comfyui-workflow).
Starting with a manual n8n trigger, the system securely initializes the Replicate prediction, logs the request, and then enters a sophisticated polling loop. This loop intelligently uses the If n8n node and Wait n8n node to check the job status every 5 to 10 seconds, ensuring that resources are not wasted. When the job is complete, the n8n workflow handles success or failure gracefully, providing a structured JSON response. This advanced use of the n8n node structure makes this a powerful addition to any developer's collection of n8n templates.
The process begins with the Manual Trigger n8n trigger. First, the 'Set API Token' n8n node securely defines your Replicate authentication key, ensuring it's available for subsequent HTTP requests. Next, the 'Set Other Parameters' n8n node configures all necessary inputs for the ComfyUI model, such as workflowjson, outputformat, and randomise_seeds.
The 'Create Other Prediction' n8n node, an HTTP Request n8n node, sends the initial POST request to Replicate, starting the AI generation process and receiving a prediction ID. This ID is immediately logged by the 'Log Request' n8n node for tracking.
Following a brief 'Wait 5s' n8n node delay, the 'Check Status' HTTP Request n8n node starts the polling loop, querying Replicate for the job's current state. The 'Is Complete?' If n8n node checks if the status is 'succeeded'. If successful, the 'Success Response' n8n node formats the output URL and metadata. If not, the 'Has Failed?' If n8n node checks for a 'failed' status, resulting in an 'Error Response' n8n node. If the job is still running, the n8n workflow routes the execution to the 'Wait 10s' n8n node, which delays execution before returning to the 'Check Status' n8n node, completing the intelligent retry logic. Finally, the 'Display Result' n8n node presents the final outcome of this automated n8n workflow.
YOURREPLICATEAPITOKEN with your actual Replicate API key.inputfile, outputformat, and most importantly, provide your ComfyUI workflow JSON string in the workflowjson field.apitoken) for secure use throughout the n8n workflow.workflowjson, outputquality) before the API call.api.replicate.com to queue the ComfyUI generation job, setting the Authorization header using the apitoken variable from the previous n8n node.starting, running, succeeded, or failed).Use this powerful n8n workflow template to trigger an Apache Airflow DAG run, poll its status reliably, manage timeouts, and retrieve final XCom results automatically.

Use this comprehensive n8n workflow to automate employee equipment requests, validate staff data via MySQL, and manage manager approvals using the n8n trigger for Gmail (sendAndWait).

Use this advanced n8n workflow template featuring GPT-4o Mini to intelligently route incoming user requests to specialized sub-agents for tasks like reminders, emails, or meetings, leveraging multiple n8n nodes for scalable automation.

Use this comprehensive n8n workflow to automate technical SEO audits. Discover URLs via sitemap, fetch content, analyze pages using OpenAI, and log results to Google Sheets. Leverage pre-built n8n templates for efficiency.

Building AI Agents and Automations | Growth Marketer | Entrepreneur | Book Author & Podcast Host If you need any help with Automations, feel free to reach out via linkedin: https://www.linkedin.com/in/yaronbeen/ And check out my Youtube channel: https://www.youtube.com/@YaronBeen/videos







































