Upload from Telegram to Drive through AI

Please tell me how to create the following flow. 1. Upload a PDF or photo from Telegram to AI. 2. AI sends the file to Google Drive if I request it.

so you’ll want a workflow like this:

1. **Telegram Trigger** node to catch incoming files (documents/photos)

2. **OpenAI** or whatever AI node you’re using - pass the file data and in your prompt include something like “if the user asks to save this, respond with ‘SAVE_TO_DRIVE’”

3. **IF** node checking if AI response contains your trigger phrase

4. **Google Drive** node to upload the file if true

the tricky part is telegram sends files as file_id - you’ll need to use the Telegram node’s “Get File” operation first to download it, then pass that binary data through to both AI and Drive.

here’s the basic structure:

```

Telegram Trigger → Get File (Telegram) → AI Analysis → IF node → Google Drive

```

lmk if you need help with the specific node configs

Hello A_S!
I just made this workflow to help you visualise how have to look like

Just a quick note on the key settings:

Telegram Trigger: Ensure Download is set to true.
First filter node: I configured it to check two things at once:
Does a Binary file exist?
Is the Caption exactly equal to “Save”(or your keyword)?
Output Parser: This requests a strict Boolean response (true/false) to confirm if the image fits the criteria of the prompt.
Merge Node: Don’t forget this. It recombines the file data (from the Trigger) with the processed logic. Without this, the Google Drive node won’t receive the file to upload.

If you need some help lmk :smile:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.