After I move an email through an AI Agent (separating sales leads, client questions, invoices etc), I’m told the PDF from the email will not pass through. When it flows through the switch node to where I need to extract the PDF, I see the binary file, can download it, but when I extract PDF node it says the file is not available or called attachment_0. I see the binary file in the input of the extract PDF node, its called attachement_0, however the node does not recognize it. If tried a merge node, code node, filter, all the same result. Any thoughts?
What is the error message (if any)?
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
Code in JavaScript1
2 items
attachment_0
File Name:
invoice_17088034.pdf
File Extension:
pdf
Mime Type:
application/pdf
File Size:
80.7 kB
Parameters
Settings
Operation
Extract From PDF
Input Binary Field
attachment_0
The name of the input binary field containing the file to be extracted
Options
No properties
Add option
I wish this node would…
Output
1 item
This operation expects the node’s input data to contain a binary file ‘attachment_0’, but none was found [item 0]
Make sure that the previous node outputs a binary file
Asked
Error details
Other info
okay, to understand the error and how to fix it: the problem is that the node has two input items, but no binary data is found in one of them, probably the first item:
Your new logic created two duplicate attachments called attachment_0 and I still cannot pull either of them through the workflow, I get the same error code. Basically, this workflow runs my email. I’m trying to have this particular path be my ‘Invoice’ path. The email comes through get labeled ‘Invoice’ in Gmail, the pdf is extracted, an AI Agent labels it how my invoices are setup in Quickbooks and gets saved in my Google Drive folder, the message is slacked to me saying I have a new invoice received/to pay and them removes the item from my Gmail Inbox. Maybe my whole setup is incorrect? Would you set it up differently? Hope this clarifies what I’m trying to accomplish.
In the input panel of your Extract from File node (top left), it says “2 items”. The error message says none was found [item 0].
Most likely, your previous nodes (probably the Merge or Code node) produced two items:
Item 0: Contains only JSON/Text (no binary).
Item 1: Contains the actual attachment_0.
Since the node tries to process every item, it hits Item 0, fails to find the binary, and errors out immediately.
Try this:
• Add an “If” Node just before the Extract node.
• Set the condition to check if the binary field exists: {{ $binary.attachment_0 }} → Is Not Empty.
• Connect the True output to the Extract node.
• Alternative: In your Code/Merge node, ensure you are merging the binary into the single item rather than appending it as a second item.
Let me know if filtering out the empty item fixes it.
The idea I’m trying to explain is to output only one single item, so that this is the only one used in the next node,
It’s okay, if it works for you that’s fine,
Once we fix the issue you can improve it later, especially the Code nodes,
Most of the time, it’s not necessary to use them, You can often use other nodes instead, like the Set node, even when working with binary data..