Use this advanced n8n workflow template to implement the high-speed Fan-Out-Fan-In pattern, executing multiple independent AI tasks concurrently. Optimized for speed and state management.
Download this n8n workflow template and start using it instantly.
Automation Architects seeking high-performance n8n solutions.
Users who need to run time-consuming tasks (like multiple API calls or AI generations) simultaneously.
Developers looking to understand advanced n8n workflow control mechanisms like self-referencing workflows and static data state management.
Teams focused on optimizing complex n8n templates where latency is critical.
When building complex automation projects, waiting for a long sequence of independent steps to complete serially can drastically slow down your results. This advanced n8n workflow solves this by utilizing the powerful Fan-Out-Fan-In pattern, allowing all independent tasks to run in parallel.
This specific n8n workflow acts as a Project Manager (the main thread) and Specialist Teams (parallel sub-threads). It uses a key combination of the Execute Workflow n8n node (set to not wait) and the Wait n8n node, managed by a central 'Project Dashboard' (implemented using the Code n8n node and Static Data).
By ensuring that three separate AI content generation tasks run at the same time, this n8n template significantly reduces overall execution time, providing a model for optimizing any speed-critical n8n operation.
This intricate n8n workflow operates in two main segments: The Project Manager (Fan-Out) and the Specialist Teams (Fan-In/State Management).
The Project Brief set n8n node defines an array of independent tasks, each specifying the process name (e.g., writedescription) and necessary input data.Assign Tasks to Teams n8n node (an Execute Workflow node). Crucially, this node calls the same n8n workflow recursively, passing the task data, the main execution ID, and the unique resumeurl of the next node. Since the 'Wait for Sub-Workflow' option is OFF, the main execution does not wait.Wait for All Teams to Finish n8n node, which pauses the execution indefinitely, waiting for an external HTTP POST request to its resumeurl.Receive Work Order n8n trigger.Check Work Order Status node ensures the status is 'pending', and the item is passed to the The Project Dashboard (Code) n8n node. This code node uses n8n's Static Data feature to initialize the project dashboard, marking all tasks as 'pending'.The Dispatcher switch n8n node directs the work order to the correct specialist team (Description Team, Ad Copy Team, or Email Team), where the AI generation happens via the LangChain n8n node.Report Back to Manager n8n node calls the sub-workflow again, but this time with a status of 'completed' and the result data.The Project Dashboard (Code) n8n node. This n8n node updates the task status in the Static Data and checks if all tasks are now complete.Code n8n node outputs a specialized item containing the aggregated results and the original resumeurl. The Is Project Complete? if n8n node directs this item to the Resume Parent Workflow HTTP Request n8n node.Resume Parent Workflow n8n node makes a POST request to the main workflow's Wait n8n node, resuming its execution. The aggregated results are received by the Project Complete! n8n node, marking the successful and parallel completion of the entire n8n workflow.To deploy this powerful n8n workflow template, follow these steps:
LangChain Chat Google Gemini n8n node for AI processing. You must set up a credential named 'IA2S' (or update the credential ID in the LangChain nodes) with your Google Gemini API key.The Project Dashboard (Code) n8n node relies heavily on $getWorkflowStaticData('global') for state persistence across executions.This n8n workflow template utilizes several complex and custom-configured n8n node components:
Start Project (Manual Trigger n8n trigger): The starting point for the main execution.
The Project Brief (Set n8n node): Defines the input payload, which is an array of tasks (e.g., 'writedescription', 'writeadcopy') that need to be run in parallel.
Assign Tasks to Teams (Execute Workflow n8n node): The Fan-Out mechanism. It calls the current n8n workflow ID recursively, passing the task data, but crucially, Wait for Sub-Workflow is disabled. It passes the resumeurl for later callback.
Wait for All Teams to Finish (Wait n8n node): Pauses the main execution. Its unique resumeurl is passed to the sub-workflows, acting as the final callback endpoint.
Receive Work Order (Execute Workflow Trigger n8n trigger): The entry point for all parallel sub-executions initiated by the Assign Tasks to Teams n8n node.
The Dispatcher (Switch n8n node): Based on the incoming process name (e.g., writedescription), this n8n node routes the request to the correct specialist team.
Description/Ad Copy/Email Team (LangChain Agent n8n nodes): These nodes perform the actual AI work, receiving specific instructions and product data from the input payload. They are linked to the The AI Specialist lmChatGoogleGemini n8n node.
The Project Dashboard (Code n8n node): The central state manager. It uses $getWorkflowStaticData('global') to track the status of all parallel tasks. It updates the status from 'pending' to 'completed' and checks if all work is done before initiating the Fan-In.
resume_url, sending the aggregated results and waking up the main n8n workflow.Learn to build a robust n8n workflow for automated AI evaluation. Use the n8n Evaluation node, Google Gemini, and Google Sheets to test and score AI Agent performance automatically. Access powerful n8n templates.

Implement a stateful Pomodoro technique tracker using an n8n workflow. Start, stop, and log 25-minute deep work cycles to Google Sheets via Telegram commands.

Use this powerful n8n workflow to automate your daily financial and operational briefing. Gathers data from Stripe, Shopify, Banking APIs, and Google Calendar, then summarizes it using OpenAI and sends a secure morning brief.

Instantly convert voice notes uploaded to Google Drive into X (Twitter) posts using this powerful n8n workflow template powered by AssemblyAI transcription, saving hours on manual effort.

Use this dynamic n8n workflow to analyze YouTube videos, generate sophisticated transcripts, summaries, and social media clips using Google Gemini AI, optimized with audience metadata. Easily deploy this powerful n8n template.

Innovative builder with a passion for crafting automation solutions that solve real-world challenges. From streamlining workflows to driving efficiency, my work empowers teams and individuals to achieve more with less effort. Experienced in developing scalable tools and strategies that deliver results with n8n, supabase and cline.







































