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.
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
You send a file or photo to your Telegram bot, with an optional note as the caption.
ClickRuntime downloads the file and saves it in your chosen Google Drive folder.
If you turned it on, AI suggests a short title and tags from your note.
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
Build your own
Need it to work differently?
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
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?
Can it name or tag files for me?
Who can see the files in Drive?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Create a Drive folder and Notion page for each new client
When your onboarding form is submitted, the client gets a Drive folder copied from your template and a Notion client page linking to it.
See how it worksTurn recordings in Google Drive into summarised notes in Notion
Drop an audio recording in your Drive folder and get a Notion page with its summary and action items.
See how it worksScreen new résumés from Google Drive into Notion
Each new CV dropped into your Drive folder is read, scored against the job, and added as a card on your Notion hiring board.
See how it worksKeep exploring
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.