Building Conversational Agent to retrieve certain data-Extend

Hi @ria @Jim_Le this question is the extended version of this Question

I’m developing an integrated system that combines document information retrieval with user data collection. The goal is to gather user details naturally during their interaction with the document retrieval process. I’ve successfully created two separate workflows:

  1. A document information retrieval workflow using a Conversational AI agent.
  2. A user data collection workflow using a different AI Agent, which stores information in a database.

While these workflows function well independently, I’m encountering difficulties merging them into a single, cohesive process. The main challenge lies in integrating the Conversational AI agent for document retrieval with the separate AI Agent for user data collection.

I’m seeking advice on how to effectively combine these workflows to create a seamless user experience. Any guidance on structuring this integrated flow would be greatly appreciated. If you need any additional information about my current setup or specific requirements, please let me know.

Information on your n8n setup

  • n8n version: Version 1.75.2
  • Database (default: SQLite): PostGre
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: ubuntu

Hey @Brijesh_Mahawar,

One thing I find extremely useful is creating sub-workflows and treating them like functions.

With this approach, AI agents can call these “functions” using the Call Workflow tool, sending data that can go through multiple processes — allowing you to essentially build an entire backend system on top of this logic.

Think of it like a master function that works as a router, deciding the flow of information dynamically.

If you scale this idea to 2, 3, 4, or even more levels deep, you can create something like this:

  • Router → User asks about heart diseases → Retrieve documents on that topic → Check patient’s data for heart-related exams → Respond with a clarifying question → Add a note to the patient’s file mentioning concern about heart issues → Ask if they want to schedule an appointment → Send all gathered information to the doctor.

This kind of structure makes complex interactions manageable and modular.

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

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