How do I explicitly pass the output of one AI agent node to the connected AI agent tool?

I have an “AI agent NODE” connected to a model and an “AI agent TOOL”, the node should output only an article title then go to the “AI agent TOOL” that should evaluate the title. The question is I need to give the TOOL the output of the NODE explicitly, what I’d the syntax to achieve this

Workflow:
Note: this is not the full workflow, it’s the part that is related to the question

Information on your n8n setup

  • n8n version:1.115.3
  • Running n8n via (Docker)
  • Operating system: Self-hosted on Azure

I would approach this slightly differently, when you have an exact sequence you need the workflow to execute in you’re better off having two agent nodes in sequence:

@robtf9 Yes, agree, but I thought I could utilize the AI Agent as a tool, and I see it makes perfect sense, hence the Agent Node calls the Agent tool, so why is there not an explicit way to pass the output of the Agent Node to the Agent Tool?

If tools are used they are always called before the agent generates its final output. You could potentially use a fromAI parameter to have it generate the title of the article as a value for the tool, though.

3 Likes

@robtf9 This is a sharp observation and a significant architectural.While using the AI Agent Tool is powerful for dynamic, unknown operations, it introduces unnecessary complexity when the process is strictly sequential. For sequential, non-optional steps, Node Chaining > Agent Tool Use. It swaps speculative LLM reasoning for reliable n8n data orchestration. Excellent call!

@robtf9 Thanks so much for the $fromAI() tip! That was exactly what I needed. Really appreciate you taking the time to explain it.

1 Like

P.S if you enable “Return Intermediate Steps” on the ai agent node, when a tool finish execution you will get additional data back to the agent output. :slight_smile:

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