Auto-save Telegram files to Google Drive by sender

Every 15 minutes, tuck away every file people send you on Telegram into a tidy Google Drive folder named after who sent it.

Deterministic Code
Telegram Secretary BotGoogle DrivePersonal ProductivityOperationsData SyncDocument Processing
PromptCreate

Build me a deterministic code workflow that archives every file someone sends me on Telegram into a Google Drive folder organized by sender. This is a fixed pipeline, not an agent making decisions.

Trigger: cron, every 15 minutes.

Steps, in order:

1. Call telegram-secretary Receive Updates to pull the newest updates. Persist the highest update_id so the next run advances the offset and does not reprocess anything.

2. Keep only business_message updates whose message contains an attachment: document, photo, video, audio, or voice. Skip stickers, plain text, and edits.

3. For each attachment on each qualifying message, call telegram-secretary Get File Download Link with the file_id to resolve a downloadable URL. For photos, use the largest size variant.

4. Ensure a root Telegram Inbox folder exists at the top of my Drive. Then, for each sender, ensure a subfolder exists under Telegram Inbox named after the sender's display name (first_name plus last_name, falling back to username, falling back to their user id). Use google-drive Create Folder when a folder is missing. Cache folder ids within the run so we do not create duplicates.

5. Download the file from the resolved URL and upload it into the sender's folder. Use google-drive Upload File (Multipart) for files under 5MB and google-drive Upload File (Resumable) for anything 5MB or larger. Preserve the original filename when Telegram gives us one; fall back to a sensible default per media type (photo.jpg, video.mp4, voice.ogg, audio.mp3). Append an ISO timestamp before the extension so repeated filenames never collide.

6. After a successful upload, call telegram-secretary Send Message as User to reply in the same chat with the text got it, saved. Use the business_connection_id from the incoming update so the reply is sent as the account owner, not as the bot.

Notes for the implementation: every action above maps to a documented operation, so the whole thing is a fixed pipeline of known nodes with structured inputs. If a message has multiple attachments (media group), upload each one and only send a single got it, saved reply per message. If any single attachment upload fails, log it and continue with the rest so one bad file does not block the batch.

Additional information

What does this prompt do?
  • Watches your personal Telegram for new messages with attachments (documents, photos, videos, audio notes, voice memos).
  • Saves each file into Google Drive under a top-level Telegram Inbox folder, in a subfolder named after the sender.
  • Preserves the original filename and stamps it with a timestamp so nothing ever overwrites an older copy.
  • Replies in the same chat with a quick got it, saved so the sender knows the file made it through.
What do I need to use this?
  • A Telegram account with the Secretary Bot connected (see our Telegram Secretary setup guide).
  • A Google account you use with Google Drive, connected with permission to create folders and upload files.
  • A little bit of free Drive space to hold whatever people send you.
How can I customize it?
  • Change how often it runs. Every 15 minutes is a good default, but you can move it up to hourly or down to every few minutes.
  • Point it at a different root folder in Drive, or nest it inside a shared drive your team already uses.
  • Skip certain attachment types, for example ignore voice notes if you only care about documents and photos.
  • Turn off the auto-reply, or change the wording of the confirmation message.

Frequently asked questions

Does this work on my personal Telegram, or only a bot channel?
Personal. The Telegram Secretary Bot connects to your own Telegram account with your permission, so this captures files people send directly to you, not just messages posted to a bot-owned channel.
What kinds of files does it save?
Anything sent as a document, photo, video, audio track, or voice note. Stickers and plain text messages are ignored.
What happens if the same person sends me two files with the same name?
Both are kept. Each upload has a timestamp appended to the filename, so a second file never overwrites the first.
Where do the folders end up in my Drive?
Under a single top-level folder called Telegram Inbox, with one subfolder per sender using their display name. You can move or rename that root folder any time.
Will senders know their file was archived?
They see a short got it, saved reply in the same chat. You can change the wording or turn that reply off entirely.

Related templates

Quarterly review decks in Google Slides for every top household

On the last business day of each quarter, generate a personalized Google Slides review deck for every top-tier Addepar household and drop links in your advisor Slack channel.

Addepar
Google Slides
Google Drive
+1
Agentic Task
Archive signed Adobe Sign contracts to Google Drive and log them in Sheets

The moment an agreement is signed, the final PDF lands in a dated Drive folder and a tracking row is added to your contracts spreadsheet.

Adobe Acrobat Sign
Google Drive
Google Sheets
Deterministic Code
Instant meeting notes to Notion and Slack with Groq Whisper Turbo

Every 15 minutes, new recordings in your Google Drive Meetings folder are transcribed by Groq Whisper Turbo, structured into a Notion note, and recapped in Slack.

Groq
Google Drive
Notion
+1
Agentic Task
Auto-generate personalized Canva designs from Airtable rows

Every new Airtable row spins up a personalized Canva design from your brand template, lands in Google Drive, and writes the shareable link back into the row.

Canva
Airtable
Google Drive
Deterministic Code
Batch-generate a Recraft icon set from a Google Sheet

Fill an entire icon set on autopilot. Every hour, a spreadsheet drives Recraft to generate on-brand SVG icons and drop share links back in each row.

Recraft
Google Sheets
Google Drive
Deterministic Code
Auto-generate on-brand FLUX images for your Airtable content calendar

When a row flips to Ready for image, an agent designs a FLUX.2 prompt using your brand references, hosts the image on Drive, updates the row, and posts a Slack preview.

Airtable
Black Forest Labs
Google Drive
+1
Agentic Task

Stop hunting for that file someone sent you on Telegram.

Connect Telegram and Google Drive once, and Geni quietly files every attachment into the right folder, every 15 minutes.