I have a Telegram bot in n8n. User picks a option from menu, gets prompted to send a photo, sends it. Problem: The photo routes to the wrong pipeline instead of the one matching the user’s menu selection or, the telegram trigger wont register the photo at all
I already have a switch node which routes all my options and even more I have another switch which routes based on the status of the option they chose, so is it a wiring issue or am i missing a node, expertise and experience is most welcome.
i have 3 switches, workflow is to long to send here. so essentially the workflow is, user sends /start, my bot sends inline keyboard displaying menu option. User presses one of the main menu options, Switch1 handles it and sends the outfit selection keyboard. They pick an outfit, Switch2 catches it, saves their choice to Supabase and tells them to send a photo. in Switch3, it reads the saved status and when user is prompted to send a photo and they do, it is supposed to send that photo down the right pipeline, it either dosen’t register or goes to a different pipeline, . the pictures are in chronological order in regards to which switch is first.
Telegram has no memory between messages. When the photo arrives, n8n has no idea what the user picked from the menu. Save the menu selection to a DB or static data node with the chat ID as the key, then look it up when the photo trigger fires.
The issue is likely that the Telegram trigger fires a separate execution for every message type — text and photo are handled as different events. When the user sends a photo, the trigger doesn’t carry the context of their previous menu selection.
The fix: store the user’s menu choice (e.g. in a static data node or an external key-value store) keyed by chat_id, then retrieve it when the photo arrives. That way you can route the photo correctly regardless of when it comes in.