Example Workflow for Asynchronous Independent Process Coordination and Callback
This workflow demonstrates how to elegantly handle the collaboration between asynchronous independent processes and the main process. By manually triggering the main process and sending an HTTP request to initiate an independent task, it utilizes `resumeUrl` for callbacks, ensuring that the main process can accurately receive external results and avoid duplicate executions. The workflow simulates calling an external API to fetch programming jokes, showcasing the asynchronous processing capabilities in real business scenarios, making it suitable for complex business operations and multi-channel message handling.

Workflow Name
Example Workflow for Asynchronous Independent Process Coordination and Callback
Key Features and Highlights
This workflow demonstrates how to implement the triggering and coordination of "asynchronous independent processes" within n8n. It can initiate a standalone external process (e.g., triggering another workflow via an HTTP request) and utilize a unique resumeUrl
to enable callback and continuation of the main workflow. The workflow ensures that even if multiple triggers occur, only the first callback request successfully resumes the main workflow, preventing duplicate execution. It also simulates calling an external API (fetching programming jokes) and mimics service processing delays, reflecting asynchronous handling capabilities in real-world business scenarios.
Core Problem Addressed
How to elegantly manage collaboration between asynchronously and independently triggered external processes and the main workflow, handling asynchronous event waiting, callbacks, and data transmission. It guarantees that the main workflow accurately waits for and receives results from externally executed independent processes, avoiding resource conflicts or repeated execution caused by multiple triggers.
Use Cases
- Coordination of multiple independent services or subprocesses in complex business scenarios requiring asynchronous triggering and result feedback
- Triggering external asynchronous tasks via Webhook or HTTP requests and waiting for their completion callbacks within the main workflow
- Ensuring asynchronous events are received only once by the main workflow to prevent risks from repeated executions
- Asynchronous event response scenarios such as chatbot conversations and multi-channel message processing
Main Workflow Steps
- Manually trigger the main workflow, setting the primary execution context and identifiers
- Initiate an independent asynchronous process via HTTP request, passing the
resumeUrl
for subsequent callback - The main workflow enters a waiting state (Wait node), listening for the independent process’s callback Webhook
- The independent process receives the callback request through a Webhook node, carrying business data (e.g., joke content)
- The independent process calls the main workflow’s
resumeUrl
via HTTP request, transmitting the result data - The main workflow receives the result, resumes execution, and merges data from both main and independent processes
- Simulate calling an external API to fetch jokes and introduce artificial service processing delays to enrich the workflow example
Involved Systems or Services
- n8n Core Nodes: Manual Trigger, Set, Wait, HTTP Request, Webhook, Respond to Webhook
- External API: Programming Joke API (https://v2.jokeapi.dev)
- HTTP Communication: Asynchronous triggering and callback between main and independent workflows via HTTP requests and Webhooks
Target Audience and Value
- Automation engineers, developers, and technical operations personnel seeking an ideal example for designing complex asynchronous collaborative workflows
- Business scenarios requiring cross-workflow invocation, asynchronous event waiting, and callback handling
- Users aiming to achieve data transmission and workflow state synchronization across multiple workflows using n8n
- Reference case for learning and mastering asynchronous triggering, Webhook callbacks, and HTTP request applications in n8n
This workflow, with its clear structure and detailed annotations, helps users understand and implement coordination and data flow between asynchronous independent processes, significantly enhancing the flexibility and reliability of workflow automation.