How to Create a Sequential Chat Flow with Multiple AI Agents?

Hi there,

Looking to know if anyone has being cappable to use the Chat Trigger Node connected to more than one.

Hello everyone!
I’m trying to build a chat flow in n8n that involves multiple AI Agents (for example, 3 different AI Agent nodes), each of which should only be triggered after the user has completed a task or conversation with the previous agent.

What I’m Trying to Achieve

  • I have a Chat Trigger node that receives user input.
  • I want AI Agent 1 to handle the first step, then wait for the user to confirm or complete something.
  • After that confirmation, AI Agent 2 should start, and only then AI Agent 3 should run.

The Problem

  • Currently, when I connect the AI Agent nodes in sequence, they all fire automatically one after another. It seems like the next agent is being triggered immediately instead of waiting for a user confirmation.
  • This leads to the agents “talking over each other” or receiving responses as if they were the user.

What I’ve Tried

  1. Connecting the nodes in a simple linear sequence (AI Agent 1 → AI Agent 2 → AI Agent 3).
  2. Attempting to insert an IF node to check if the user has typed something like “Ok, next step” to move on, but I might be missing something in my setup.
  3. Looking into storing a “state” variable in Simple Memory, but I’m unsure how to make the flow pause and wait for the user’s next message.

What I Need Help With

  • How do I structure my workflow so that AI Agent 2 only runs after the user explicitly finishes the conversation with AI Agent 1?
  • Is there a recommended pattern for using Wait or IF nodes with Chat Trigger flows so that the next agent only fires upon a specific user response?
  • Any best practices for managing “state” or “step completion” across multiple AI Agents in n8n?
1 Like

I can think of two possible solutions:

1. Master agent with sub-workflows

One agent that decides who to call, depending on the context of the conversation. Other agents will be connected to it as tools, by using sub-workflows.

2. Database to store conversation state

Give the AI Agents the tool to insert/update data in a database and add a field for the status/step/stage of the conversation.

Once the conversations reaches a different stage, the AI can change the field in the database.

In your workflow you would have a simple SWITCH node that checks the stage of each session_id and routes the conversation for the correct agent.

You can also use Google Sheets to test that, if a database is not something you are used to work with.
.

:point_right: If my reply answers your question, please remember to mark it as a solution.

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.