Skip to content

The moment it happens

Save files to Drive and log them in Notion from Telegram

Files you send to your Telegram bot are saved in your Drive folder and listed in Notion with a link and your note.

Runs
The moment it happens
Apps
Google Drive, Notion
AI
Optional
Access
drive.file; Notion insert content

Send this to your assistant

Create a ClickRuntime automation: when I send a file to my Telegram bot, save it to my Drive folder and create a Notion entry with the file link and my note.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

A property manager receives contracts, photos and invoices on her phone throughout the day. Files end up spread across chats and downloads, and finding last month's inspection photo means scrolling through conversations.

Forwarding each file to a bot puts it in one Drive folder and adds a Notion entry with a note about what it is. The Notion database becomes a searchable index of everything she has filed.

What you get out of it

  • One home for every file

    Files land in the same Drive folder, wherever they came from. Nothing is left in a chat or a downloads folder.

  • A searchable index in Notion

    Each entry has your note and a link. Searching for a tenant or address finds the file in seconds.

  • Filing takes one forward

    Sending a file to the bot is quicker than uploading and naming it by hand. Filing actually happens on the day.

  • Context is kept with the file

    The caption you type is saved with the entry. Months later you still know why the file mattered.

How it works

What happens, step by step

  1. You send a file or photo to your Telegram bot, with an optional note as the caption.

  2. ClickRuntime downloads the file and saves it in your chosen Google Drive folder.

  3. If you turned it on, AI suggests a short title and tags from your note.

  4. A Notion entry is created with the title, your note and a link to the file, and the bot confirms.

Before it runs live

  • Connect Google Drive
  • Connect Notion and share the database you want it to use
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Save files to Drive and log them in Notion from Telegramjust nowSucceeded
Telegram · Filing botFiled: Acme Street flat 2 inspection photos (Drive + Notion)

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Act only on the items that match your own rules, and skip the rest
  • Change what the AI looks for, or how it writes the result
  • Add another app, for example also send it to Slack
  • Combine it with other Google Drive and Notion steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
save_files_and_notes_to_drive_and_notion_together.pyexample
import json
from clickruntime import on_event, credentials, http, ai

FOLDER_ID, DB_ID = "your-drive-folder-id", "your-notion-database-id"

@on_event
def handle(event):
    msg = (event.json or {}).get("message") or {}
    f = msg.get("document") or (msg.get("photo") or [None])[-1]
    if not f:
        return {"skipped": True}
    tg = f"https://api.telegram.org/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}"
    path = http.get(f"{tg}/getFile", params={"file_id": f["file_id"]}).json()["result"]["file_path"]
    data = http.get(f"https://api.telegram.org/file/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}/{path}").content
    note, name = msg.get("caption", ""), f.get("file_name") or path.split("/")[-1]
    up = http.post("https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart&fields=id,webViewLink",
                   headers={"Authorization": f"Bearer {credentials.connection('google', 'work')}"},
                   files={"metadata": ("m", json.dumps({"name": name, "parents": [FOLDER_ID]}), "application/json"), "file": (name, data)}).json()
    try:
        title = ai.generate(f"Short title (max 8 words) for a file named {name} with note: {note}", max_output_tokens=25).text.strip()
    except ai.AIError:
        title = name
    http.post("https://api.notion.com/v1/pages", headers={"Authorization": f"Bearer {credentials.connection('notion', 'work')}", "Notion-Version": "2022-06-28"},
              json={"parent": {"database_id": DB_ID}, "properties": {"Name": {"title": [{"text": {"content": title}}]},
                    "Note": {"rich_text": [{"text": {"content": note}}]}, "File": {"url": up["webViewLink"]}}})
    http.post(f"{tg}/sendMessage", json={"chat_id": msg["chat"]["id"], "text": f"Filed: {title}"})
    return {"filed": up["id"]}

FAQ

Common questions

What file types can I send?
Documents, photos, PDFs and other files Telegram accepts. Large files are limited by what Telegram lets bots download.
Can it name or tag files for me?
Yes. AI can suggest a short title and tags from your note, so entries are tidy even when the caption is brief.
Who can see the files in Drive?
They are saved in your own Drive folder with its existing sharing settings. Nothing is made public.
What permissions does it need?
drive.file; Notion insert content. Nothing else in your accounts is used.
Does it need AI?
No, but you can ask for an AI step (for example a summary). It then uses ClickRuntime's built-in AI allowance.
How many runs does it use?
One run for each event the app sends.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Save files to Drive and log them in Notion from Telegram” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.