Getting binary data from image generation node

Describe the problem/error/question

Trying to create an image using a Gemini node and then take the binary data and create the file in github. Used both the github node with file create as well as a custom http request node manually doing the API call.

I can not find the binary data and I am using ‘data’ as well as {{ $(‘Generate an image’).item.binary }}

What is the error message (if any)?

Keep getting an error the data is not binary which makes sense as looking at the request all it is sending is:

{
    "mimeType": "image/png",
    "fileType": "image",
    "fileExtension": "png",
    "fileName": "data",
    "id": "filesystem-v2:workflows/UsK4IRnfhM5gUeNn/executions/187586/binary_data/330a9985-65a6-4fc6-b7cb-1cae41635826",
    "fileSize": "2.25 MB"
}

Please share your workflow

(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.)

Share the output returned by the last node

Information on your n8n setup

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

Hello @Dave_Edwards1, welcome :n8n:

You can try use the Extract From File | n8n Docs node to get the base64 string,

or:

try reference it like this:

{{ $('Generate an image').item.binary.<Your_image_field_name>.data }}

The file extractor worked but not in the github create file node, used a straight HTTP request node to get rid of any abstraction issue. Thank you!

1 Like