Debugging an AI Agent Tool that's called from AI Agent

My problem

I have a workflow with an AI agent that I am setting up to be the primary workflow - it’s triggered by Slack messages and the AI agent will determine which tool to dispatch the request to.

One of those tools utilizes another AI agent, which is where my problem lies… Ultimately, I’m trying to figure out how I can see what data is being sent to the tool call so that I can configure an “Edit Fields” node that sits in between the When Executed by Another Workflow node and the AI agent node.

Please share your workflow

Share the output returned by the last node

The final output from the primary workflow is “workflow completed”, but that’s just filler text - the sub-workflow is failing, and I can’t debug it because I don’t know what inputs are being sent.

Information on your n8n setup

  • n8n version: 1.78.1
  • Database (default: SQLite): probably default - it’s locally hosted docker
  • n8n EXECUTIONS_PROCESS setting (default: own, main): ?
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker
  • Operating system: Docker on Debian

Still working on this, but not finding an answer…

When you are editing the second workflow, you should be able to go to the Executions tab and see a list of executions. From the choose one of them and you can inspect the data at each node.

Does that help?

Ah - that does help - thanks! But now I’m confused because the secondary workflow isn’t being sent a question or a prompt… it’s getting a snipped of the original prompt from the main workflow.

I would suggest checking the execution logs to see what the AI is doing.

In the first workflow, go to the Executions tab.

Select the Execution run that you want to inspect.

Double click the AI Agent.

Then click the Logs tab.

You should see something similar to this:

You can check the steps the AI has taken and what tool it is deciding to use and what info to pass through to the workflow.

It may help to add more details to the workflows, such as a System Message for the AI Agent, more details about the tools it has to use, more context as to what its role is etc.

See how you go from here.