Large File Download for Telegram

Describe the problem/error/question

Downloading files from telegram with fileid fails for files with size of 2GB.

How would I configure n8n to allow such large files to be downloaded?
I already set the environment variables to 8192MB and file system to ensure this is not a limitation in n8n.

Share the output returned by the last node

I guess that’s as Telegram server response:

400 bad request - File is too big

As this was discussed in:

Information on your n8n setup

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

Hi @cmprmsd, I am sorry you are having trouble. Can you confirm where exactly you are seeing the 400 request, and ideally share a screenshot? Is this coming from n8n or is it just an error displayed by n8n but coming from the Telegram infrastructure?

Hi @MutedJam
Sorry for the late response!
It’s the get: file functionality in n8n’s Telegram module.

NodeApiError: Bad request - please check your parameters
    at Object.apiRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Telegram/GenericFunctions.js:107:15)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Telegram/Telegram.node.js:1723:36)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:698:19)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:656:53

The 400 error seems to originate from Telegram.

Thanks for sharing your screenshot @cmprmsd!

This is indeed an error coming from Telegram and I am not aware of a workaround unfortunately. n8n uses the Telegram Bot API, which limits the file size that can be processed programmatically. According to the official Telegram docs it should be 20 MB:

For the moment, bots can download files of up to 20MB in size.

So it appears that Telegram has quietly increased this limit to 2GB, but not lifted it completely unfortunately.