Initial Discord post Problem Description: I’ve built a workflow that ingests accounting documents (invoices/payments) from gmail/telegram and uses OpenAI’s image analysis capabilities to extract information.
The workflow functions perfectly in test mode but consistently fails in production mode when processing binary data from Telegram messages.
Key Details:
Test Mode: Works flawlessly - I can manually trigger the Telegram node, and the entire workflow processes binary data successfully
Production Mode: Fails at the OpenAI Analyze Image node with “File not found” error when the workflow is triggered by a Telegram message (same message used in Test Mode)
Binary data appears to be missing from previous executions (even successful test runs), making debugging difficult
JSON parameters are identical between test and production modes - only binary data handling differs - and even that appears to be similar when using a code node to debug.
Troubleshooting Attempted:
Added retry logic to the OpenAI Analyze Image node (no improvement)
Compared debug outputs from test vs production modes - they appear mostly identical
Questions:
How should I proceed?
Is there a known difference in how binary data is handled between test and production modes in n8n?
Are there any known issues with Telegram trigger binary data persistence in n8n Cloud?
Notes:
Some nodes have a separate error flow (like OpenAI Analyze Image) to due to problematic inputs that I have no control over - This avoids failing entire workflows.
I prefer using IFs with only one output to Filters as I find them easier to debug
What is the error message (if any)?
“File not found”
Please share your workflow (Only posting the Telegram flow up to the processing due to character limitation)
Gladly. There’s some sensitive data there so I copied what I can from the outputs.
Let me know if you need anything else.
Picture description by order:
The error caused when running Analyze Image in Production - error is “File not found”
This is the Analyze Image stage input and process - The input binary is named “data” which I can view/download, and Input Data Field Name contains the correct value of “data” (I’m using {{ $json.attachmentId }} to support gmail attachments as well that are named differently than “data”)
After pressing Download, the download fails as the file wasn’t available on site. This happens to both past Production and Test workflows, I guess it has something to do with how n8n stores past binaries.
Output form a debug node that shows binary metadata from Test mode
Output form a debug node that shows binary metadata from Production mode (mostly the same)
Unfortunately that’s incorrect.
This field works with dynamic value (as it needs to support more than just “data” as binary name due to email attachements of format "attachment_i).
I also tried your suggestion changing it to a static “data” value and encountered the same issue (picture attached).
Yes - which is the intended behavior.
The workflow supports 2 flows (only one of which is presented here due to character limitations).
Gmail
Collects mails, filters out any mail without attachment and then pushes them into the analysis part which is presented here
Telegram
A telegram bot where I can manually send accounting documents (e.g. gas receipts) which then gets sent to the same analysis part as gmail (presented here).
Issue
The data reference (attachment_x/data) is always filled correctly, both in Test and Production. However, in Test it is successfully read and process, while in production it can’t find the file.