Workflow behaves differently in Test vs Production

Describe the problem/error/question

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:

  1. How should I proceed?
  2. Is there a known difference in how binary data is handled between test and production modes in n8n?
  3. 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 :slight_smile:

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)

Share the output returned by the last node

Error: File not found

Information on your n8n setup

  • n8n version: n8n cloud
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8n cloud
  • Operating system: n8n cloud (I’m using Windows 11)

Can you share the execution screenshot in the production run?

Maybe there is more clear on what is going on.

Like the message didn’t bring image or which node fail.

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:

  1. The error caused when running Analyze Image in Production - error is “File not found”
  2. 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”)
  3. 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.
  4. Output form a debug node that shows binary metadata from Test mode
  5. Output form a debug node that shows binary metadata from Production mode (mostly the same)





Thanks a lot!

I think here

Input Binary FIeld Name

shoule only be

data without expression

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

The problem is deeper, and I think it needs to be taken into account that n8n behaves differently here between Test and Production modes.

yeah got it.

So when execute run into the node. There is no attachement_x binary. Only left the data right?

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.

I hope that makes sense :slight_smile: