n8n icon indicating copy to clipboard operation
n8n copied to clipboard

Sub workflow as a tool for AI agent returns intermediary data instead of the last node data to the AI Agent in the main workflow

Open macin opened this issue 1 week ago • 1 comments

Describe the problem/error/question

I am using the AI Agent node with sub workflow as a tool. The problem is, that this sub workflow returns some data to the AI Agent before it finishes. and returns some intermediary step results instead of last step result

All the steps are described here: https://youtu.be/lSwMtsm6oDU?t=2104&si=fCjONL71G1mQsTvo, the image generation workflow...

I am using the online version of n8n

What is the error message (if any)?

There is no error message, its just that the main workflow does not wait for the sub workflow to finish.

Please share your workflow/screenshots/recording

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Sub workflow

![Image](https://github.com/user-attachments/assets/3c4da471-cb7c-4e5b-971f-8deb64db9c13)


Main workflow

![Image](https://github.com/user-attachments/assets/0dc34326-e27b-4e44-8135-24b0eea540f5)

Share the output returned by the last node

macin avatar Feb 15 '25 02:02 macin