How to create an Open AI image generator subagent?

I need a solution, where I created an Agent which is using an imageCreator tool, which is another workflow. Now I want to get the image generated by that workflow (binary file) so I can pass it through telegram.

The problem is, when the data is passed through the agent, it is breaking the json and from there I cannot get the binary file.


I have attached the images of the agent and subagent.

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

Hey @Nayan_Chowdhury, thanks so much for reaching out and kudos on your workflow. Looks super cool.

On your question: Currently, there is no way to pass binary data from a tool back to the agent. I guess the best way to still achieve your use case is to use the “Upload File” option of telegram in your tool so that you can pass the URL of the file back to the agent instead and use that later. Would that work?

1 Like

Thank you @Niklas_Hatje . Let me test it out. Will get back to you with the result

Another thing, where to use that tool? In the Ultimate Assistant workflow or in the image generator agent?

If in the image generator, how can I pass the file to ultimate assistant ai agent?

I would use the Telegram upload file method in your image generation workflow and then change the prompts to expect an image URL as a return message from the tool.