Best Approach to Use Two AI Agents for Generating PRD and Coding Plan in n8n

Hi everyone,

I’m currently working on an AI agent in n8n that generates two Google Docs: a Product Requirements Document (PRD) and a Coding Plan. The output will be sent to Telegram. I’m planning to use two separate AI agents for this task but I’m a bit stuck on how to structure the workflow.

Here’s what I’m trying to achieve:

  1. AI Agent 1: Generates the Coding Plan.
  2. AI Agent 2: Generates the PRD.
  3. Both documents should be created in Google Docs and then sent to a Telegram channel.

I’m confused about the best approach to make these two AI agents work together effectively. Should I:

  • Generate the Coding Plan first and then use it as input for the PRD (sequential execution)?
  • Trigger both AI agents simultaneously to work in parallel?
  • Use a hybrid approach where both agents generate outlines first and then detail them sequentially?

Additionally, I’m not sure how to ensure that each AI agent knows its specific task and how to manage the data flow between them in n8n.

Could anyone provide guidance or examples on how to structure this workflow in n8n? Any advice on nodes to use, error handling, or best practices would be greatly appreciated.

Thank you in advance for your help!

Information on your n8n setup

  • **n8n version: 1.81.4
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @Moses_Irvan,

Try to think like you are explaining the task for 2 new employees.

You have to explain it VERY carefully, making sure they know every step of the task.

Then if the task has to be done by one person and then improved/reviewed by another, you can put them in sequence, like you did.

If the second agent needs to know the output of the first agent, reference it in the prompt of the second agent.

I believe this would be the best solution for this scenario. But here’s another option:

You can create a Sub-workflow and call it with the “Call subworkflow” AI tool.

The main agent would call the second agent and get its output as context.
.

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