The output of my ai agent's tool does not get received by the ai agent

Describe the problem/error/question

I am making a PA as a first project and as I’ve built it I came across a slight problem. Everything works inside the flow + calling a tool (another agent) for adding new events in my calendar / looking at the calendar. So now my calendar agent gives me a response (as a tool towards the ai agent in the PA) but that response is not taken in consideration, don’t know if it’s even received at all. please see attached pictures

What is the error message (if any)?

Please share your workflow


Share the output returned by the last node

Does anyone know the reason why? It seems to link to the correct agent, inside the agent everything works perfectly, the agent gives back the correct information, but the final AI agent seems to only get the response it gets from OpenAI at first, and doesn’t look at the information gathered from the calendar agent…

Information on your n8n setup

  • n8n version: newest
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8n cloud
  • Operating system: MacOS
1 Like

Hi @David_bleijenberg Welcome to the community!
While there are better ways for doing that, for now consider giving description to the Main AI agent for the sub workflow tool and your sub workflow tool should look like this:

And with this make sure that your sub workflow is published and ready to receive the parameter you are sending, and also i would prefer just use the google calendar as a agent tool if that is considerable:

Let me know what works for you.

your calendar sub-workflow is returning the right data (you can see it in the tool output panel) but the parent agent is ignoring it, which almost always means the sub-workflow’s final node needs to output a single field called response as a string. if it’s named anything else like output or text the agent tool won’t pass it back to the LLM properly, so double check what the last node in your Calendar Agent workflow is actually outputting.

Hey, this is a known bug with the Agent v3 node — sub-agent tool outputs basically get lost or streamed directly instead of being returned to the parent agent properly. The easiest fix is to swap the AI Agent Tool for a “Call n8n Workflow” tool instead, that way your calendar agent runs as a separate workflow execution and the response actually makes it back to the main agent correctly.

This is a known bug with the Agent v3 node, sub-agents are streaming their output directly instead of returning it to the parent agent. Try switching your Calendar Agent tool to a “Call n8n Workflow” tool instead, put the calendar agent logic in a separate workflow and call it that way. That bypasses the broken agent-as-tool pipeline and the parent will actually get the response back.

Thank you both for the reply @achamm @Anshul_Namdev . As you can see in this screenshot, I already have it as a call n8n workflow and the ‘output’ is already changed to response.

The response from the call n8n workflow also comes into the ‘main’ workflow, I also added a screenshot of the response when I ask: what’s in my agenda for tomorrow?. As you can see the agent replied, but then the ‘main & personal assistant’ agent didn’t receive it or just ignored it. I don’t really understand what you mean with the Agent v3 node since I didn’t add that in for as far as I know.. I’m totally new to this space, do I have that as my agent currently?

1 Like

@David_bleijenberg i see the problem, in the flow where you have directly connected the Calendar tools to the main AI agent and it seems to skip those and generate an output itself, first and the only problem USE A BETTER SYSTEM PROMPT define clearly how to actually use tools when to use what query to expect and how to react and procedures to follow, this is the only problem in your flow, now the second problem which i am not sure of but consider using GPT-4o as your AI model in OpenAI node that should work.

@Anshul_Namdev Thanks for the quick response. I just tried to run it with the following prompt:

You are a coordinating Personal Assistant that can use external tools (Email Agent and Calendar Agent).

IMPORTANT:
Whenever you call a tool, the tool’s response is the source of truth and MUST be incorporated into your final answer.

WORKFLOW RULES

  1. Decide whether a tool is required.

    • For calendar-related requests (checking events, creating events, updating or deleting events), you MUST use the Calendar Agent.
    • For email-related requests, use the Email Agent.
  2. After calling a tool:

    • WAIT for the tool response.
    • Read the FULL tool output carefully.
    • Treat the tool output as authoritative data.
    • Do NOT generate a final answer before receiving the tool output.
  3. Response handling:

    • Your final answer MUST be derived from the tool output.
    • Never guess or fabricate calendar or email data.
    • If the tool output is empty or unclear, explicitly state that no data was returned and ask a clarification question.

TOOL OUTPUT HANDLING

  • Treat any returned JSON or text as the “Tool Result”.
  • Extract relevant fields such as date, time, title, location, participants, and status.
  • Convert the Tool Result into clear natural language for the user.
  • Preserve dates, times, and important metadata exactly as returned.

OUTPUT RULES

  • Your response MUST clearly reflect the tool output.
  • If events exist → list or summarize them.
  • If no events exist → state that the calendar is empty and ask whether to create one.
  • Do NOT ignore tool responses under any circumstances.

Context:
Today’s date is {{ $now }}.
The user communicates via Telegram.

Any recommendations or other ways to build this PA? I just followed every step from this video: https://www.youtube.com/watch?v=iv0D-dHfK6w&t=533s

But now it seems that the output from n8n workflows does not come back to the main agent.. I use get-4o in the ai model.

@David_bleijenberg This is very strange now, your system prompt is really fine, and even your AI Agent model is powerful, have you tried messing with the AI prompt? like currently you only pass the telegram message, have you tried passing down some static guidelines like

{{ json.message }}

Use Calendar tool and try seeing what exists in the upcoming events and then curate me a reply…..

Like this way we are really telling the AI agent every time to do this, also i would say everything is really nice and fine, but in your google calendar node where you have let AI decide the input give it a really good description and also edit the default tool description of that tool, and consider giving a little mode specific information about tool usage.

@Anshul_Namdev

@Anshul_Namdev it seems like my personal assistant does not wait / use for the response, as you can see in the attached screenshot, the personal assistant ai does now receive the ‘response’ and the information inside that node, it just decides to not do anything with it? Any idea’s?

@David_bleijenberg Little confused on which approach you want to choose for tool use like Calendar node directly as a tool or a sub workflow attached, although for your question this does not happen and AI agent always wait for the sub workflow to execute until said, and also your system prompt also says everything correctly that how to handle it, consider adding how to handle and make the final output/reply for the user query, also i guess in your last screenshot it seems to be working and it is calling the AI tool perfectly, maybe try adding more information of your final output and how you want it using which information from which tool, also what i have suggested earlier is also a good take:

I use it as a sub workflow, see the attached screenshot to see how it works. Normally is also hits the google tools. Should I change the prompt inside the calendar agent to give more information? I’m also not sure what you mean with passing down static guidelines. @Anshul_Namdev

@David_bleijenberg Yes you can give proper description where the AI has to decide and enter its input in the calendar fields. Static guidelines means that adding context to your AI prompt , which means give the telegram message but also give a message with clear instructions below the message so that AI knows what todo as a command.

@Anshul_Namdev ok, I tried telling the ai to exactly open the calendar agent, check for my calendar tomorrow, get the response from the calendar agent and send me that response. Still get the same message… Is there another way to make this?

1 Like

@David_bleijenberg So let me be real, instead of using 1 agent to do everything try using 1 agent which would only fetch calendar data, like you will pass your natural language question and that agent’s job is to only fetch data from google calendar and then there will be 2nd agent who will be responding and curating a reply, this is something you can use if all of those are not working.

Also you can use another approach of a n8n form where you can give a specific data that google drive accepts as an input and you will fill the form and after the from there will be a google calendar node that would fetch data from that specific filed and then it will pass down to AI so there is no room left for errors.

@Anshul_Namdev okay, so with the 1st option, you mean adding a second tool ‘call n8n workflow’, when i ask the agent for my calendar the next days, it will ask 1 agent to check the availability and then go on to the next tool to generate a response?

Do you maybe have a workflow for yourself that i can view as an example? I’m totally new to all this. Thanks again!

1 Like

@David_bleijenberg What i mean with the approach is that there will not be an AI agent but a simple get event google calendar node which would accept parameters you would be sending from your google form as it requires and then it would return the events and those will be passed down to the AI agent with your message so that it already will have all the information it needs it will just curate a message for you.
I can create something which you should be using: (2 of those approach structure wise)

So this is the basic structure you would need , just map your variables and this would work!