Use this robust n8n workflow to automate asynchronous AI generation with Replicate. This n8n workflow includes necessary polling logic, an n8n trigger, and HTTP request n8n node configuration for reliable results.
Download this n8n workflow template and start using it instantly.
Developers needing asynchronous AI processing handled automatically.
Data scientists integrating specialized Replicate models (like aihilums/sehatsanjha) into production tools.
Automation specialists looking for reusable n8n templates for polling long-running tasks.
Users who need a reliable n8n node structure for external API interaction and status checking.
When dealing with computationally intensive AI models, the results are rarely instant. Replicate uses an asynchronous prediction system, meaning the initial request returns an ID, and you must poll that ID until the job is complete. This specialized n8n workflow solves this complexity entirely. It acts as a resilient polling mechanism, ensuring that once the initial prediction is created using the HTTP Request n8n node, the process pauses and continuously checks the status until the 'succeeded' message is received. This removes the manual burden of managing long-running tasks and provides a powerful, self-contained n8n workflow for integrating advanced AI capabilities. This specific n8n workflow template uses the aihilums/sehatsanjha model, demonstrating a practical application of core logic flow control within n8n.
The n8n workflow initiates with a manual n8n trigger.
Set API Key) defines the Replicate API key as a flow variable.Extract Prediction ID) captures the Prediction ID returned by Replicate, along with the polling URL.Check Prediction Status) uses the extracted Prediction URL to query Replicate for the job's current status.Check If Complete) checks if the status is 'succeeded'. If the prediction has not succeeded, the n8n workflow loops back to the Wait n8n node, repeating the polling cycle.Process Result Code n8n node for structured data output.To use this n8n workflow template, follow these steps:
Set API Key n8n node. Replace the placeholder value YOURREPLICATEAPI_KEY with your actual Replicate API key.Create Prediction HTTP Request n8n node. The JSON body defines the model version (currently 8d601ed5dfe3c91d7dacdc17a127497519acfdb4c4eefbec3db17b6d87734a69). Adjust the version and input parameters if you wish to use a different Replicate model or specific inputs.This n8n workflow relies on several core n8n node types to manage the asynchronous API calls:
On clicking 'execute' (Manual Trigger): This serves as the initial n8n trigger, allowing the user to start the n8n workflow on demand.
Set API Key (Set n8n node): Essential for secure configuration. It stores the Replicate API key as an item, which is then dynamically referenced by subsequent HTTP Request n8n node calls.
Create Prediction (HTTP Request n8n node):
Function: Starts the AI generation process by hitting the Replicate /v1/predictions endpoint.
Key Configuration: Uses Generic Credential Type to dynamically set the Authorization header using an expression: ={{ 'Bearer ' + $('Set API Key').item.json.replicateapikey }}.
Extract Prediction ID (Code n8n node):
Function: Parses the initial response body to extract the unique prediction ID and constructs the necessary polling URL (predictionUrl). This data is crucial for the continuous polling loop managed by other n8n nodes.
Wait (Wait n8n node):
Function: Implements a 2-second delay between polling attempts to manage resource usage and adhere to API best practices. This ensures the n8n workflow is efficient.
Check Prediction Status (HTTP Request n8n node):
Function: Polls the specific prediction URL to retrieve the current status of the AI job.
Check If Complete (IF n8n node):
Function: Controls the flow logic. It checks if the $json.status equals succeeded. If true, the n8n workflow proceeds; otherwise, it loops back to the Wait n8n node.
Process Result (Code n8n node):
* Function: Once the job succeeds, this final n8n node structures the output, extracting key metrics, the final output URL, and metadata for easy consumption by downstream systems.
Secure your contact form submissions. This n8n workflow validates input against injection attempts, cleans data, and logs validated submissions directly to MongoDB Atlas using custom JavaScript.

Use this comprehensive n8n workflow template to automate audio data processing with the Aihilums Sehatsanjha AI model on Replicate. Features robust API polling logic and success/failure handling.

Deploy this robust n8n workflow to automatically monitor Gmail, Outlook, Telegram, and WhatsApp for incoming PDF files. Leverage the power of an OpenAI n8n node to summarize documents and return concise reports to the originating channel.

Automate customer feedback processing using n8n, OpenAI for sentiment analysis, generating PDF reports, and sending personalized email summaries via Gmail. Deploy this powerful n8n workflow today.

Use this comprehensive n8n workflow to automate document processing. It integrates Google Drive or a file upload form with OpenAI embeddings and Qdrant, forming a powerful RAG knowledge base queryable via a Gemini-powered chatbot. This n8n template enhances document searchability.

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







































