Linking Telegram Photo Reply to Original ClickUp Task ID for Processing (failing logically)

I’m working on a workflow to integrate ClickUp tasks with Telegram and could use some expert advice, as I’ve hit a roadblock despite exploring docs and templates.

System: n8n cloud version

My Goal: The aim is to have a Telegram bot, operating within a specific message thread (topic) in my supergroup, perform the following:

  1. Notify users about new or overdue tasks from ClickUp.
  2. Allow users to mark tasks as “Complete” directly from Telegram.
  3. Allow users to mark tasks as “Complete with Photo,” which involves them sending a photo to be attached to the ClickUp task before it’s marked complete WITHOUT using upload web form

What I’ve Achieved So Far:

  • Successfully fetching tasks from ClickUp.
  • Sending a Telegram message to the correct thread with task details and two inline buttons:
    • “Ready”: This works fine. It triggers a branch that updates the ClickUp task status to “Complete.”
    • “Photo”: This button is intended to initiate the photo attachment process.

:fist:The Challenge: Associating the Photo Reply with the Correct task_id This is where I’m struggling. When the “Photo” button is pressed:

  1. The bot currently sends a follow-up message asking the user to send a photo (e.g., “Please send the photo in reply to this message”).
  2. The user then sends a photo in a new message, replying to the bot’s request.
  3. My workflow receives this new message with the photo. I can extract the photo, and I can upload a photo to ClickUp if I hardcode the task_id in the HTTP request node using ClickUp API.

The core problem is: how do I dynamically know which task_id the incoming photo message corresponds to? The photo message itself (from the user) doesn’t contain the original task_id or the callback_data from the “Photo” button they initially pressed. It seems I fail logically somewhere here due to lack of knowledge in coding and especially in N8n possibilities

If you look into my workflow you will see Airtable tryout that I couldnt make it work, seems I am a real no-coder )

My Questions for the Community:

  • Is the Airtable approach (using the bot’s PhotoRequestMessageID as a key linked to reply_to_message.message_id from the user’s photo) a sound and robust way to manage this state in n8n cloud?

  • Are there any simpler, more “n8n-native” (for cloud, without Airtable) methods to achieve this temporary state linking between the button press and the subsequent photo message from the user?
    *Is it possible to attach AI agent node for regulating and routing task_ids without mess when multiply users click button “Complete with Photo”

  • Does anyone have an example workflow or a different logical approach for this common “bot asks for input, user provides input in a new message” pattern, specifically for associating it back to an original item ID?

I’m trying to ensure this is reliable, especially if multiple users might be interacting with the bot for different tasks around the same time.

Thanks in advance for any guidance or ideas!

Due to char limit my code is pastebinned (FULL VERS)
https://pastebin.com/ZUeN4sBK

N8 Gurus please direct me to any way of making this work
I dont understand how to pass ClickUp task ID to the branch (or AI Agent memory?) where I will be able to upload image to that task. Using callback in telegram and loosing them halfway )
Very newbie question I suppose, but guide me to any example or node doc to read.