How to pass file from child workflow to parent workflow?

Describe the problem/error/question

I am trying to create reusable workflows that can be combined. When creating an AI Agent workflow that as tool uses another workflow that returns a File on the ‘data’ prop, it is not available in the parent workflow and I get an error saying so.

What is the error message (if any)?

There was an error: “The workflow did not return an item with the property ‘data’”

Please share your workflow

Share the output returned by the last node

[
  {
    "headers":
    {
      "date": "Tue, 01 Oct 2024 14:18:20 GMT",
      "server": "uvicorn",
      "content-type": "image/png",
      "content-length": "1592215",
      "last-modified":  "Mon, 30 Sep 2024 21:01:43 GMT",
      "etag": ""41ee575e9a33b30b2dff46ad77afb874""
    },
    "statusCode": 200,
    "statusMessage": "OK"
  }
]

Information on your n8n setup

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

To show that I add the file on the data prop in the child workflow:

If you just do a ‘Read File’ node inside a child workflow it does give you access to the file in a parent workflow correctly. So it must be your HTTP Request that isn’t doing something right. Can you try putting a Code or Set node after that HTTP Request node and seeing if you can access $binary.data?

Hi Jay, it seems to not work that way as I just tested this and created an issue for that here: workflow as tool can't return File data · Issue #11045 · n8n-io/n8n · GitHub

Ah apologies, so this is in the specific instance of using the workflow as a tool that this occurs.