Hi everyone,
I’m facing a challenge with a Telegram trigger in n8n, and I could really use some help finding a simple solution.
Here’s my use case:
- I have a Telegram trigger that activates whenever I receive a message.
- If the message contains a media group (photos/videos sent as a single message), I need to capture and save the file IDs of all media files in that group.
- After this, the workflow calls a second workflow, which includes a Telegram Send Media Group node. This node sends a message with the media files (photos/videos) attached to a predefined Telegram group.
My Struggles
I’m very bad at coding, and while I’ve tried using JavaScript arrays in a Function node to manage the file IDs, I’ve failed miserably. Despite reading documentation and experimenting, I just can’t seem to understand how arrays work.
I’ve successfully managed the flow for single media files by using the Set node in the first workflow to pass the file ID to the second workflow. However, I can’t figure out how to handle media groups where multiple files need to be passed together as an array.
Key Requirements
- The media group size and type are unknown (it could include 2+ files, a mix of photos and videos).
- The user sends all media as one message (a single media group).
- I need to pass all file IDs to the second workflow without storing them in an external database (if possible).
- I’d prefer a simple and straightforward solution—even if it requires using multiple nodes instead of writing complex code in a single node.
Challenges
- Identifying and handling media groups within the trigger.
- Storing and passing an array of file IDs between workflows.
- Ensuring all file IDs are properly grouped and sent together in the second workflow.
Does anyone have any recommendations for an approach that avoids coding but still gets the job done?
Thanks so much in advance for your help.
Information on your n8n setup
- n8n version: 1.68.0
- Database (default: SQLite): SQLite
- n8n EXECUTIONS_PROCESS setting (default: own, main): own, main
- Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
- Operating system: Linux