Skip to content

The moment it happens

Message a video idea to Telegram and get the finished video back

Send your Telegram bot a video idea and get a short generated video back in the chat, with a copy saved in your Drive Shorts folder.

Runs
The moment it happens
Apps
Google Drive, Telegram
AI
Yes, uses the built-in AI allowance
Access
Telegram bot token; Drive write

Send this to your assistant

Create a ClickRuntime automation: when I message my bot a video idea, write the prompt, generate a short video with my video API, save it to my Drive Shorts folder and send me the file.

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 small business owner gets ideas for short videos at odd moments: on a delivery run, in a queue, late at night. By the time she is back at her desk to open a video tool, the idea is gone or feels like too much work.

Sending the idea to a Telegram bot in a sentence and getting a finished short back turns those moments into content. Every video is also kept in Drive, so the team can find and post it later.

What you get out of it

  • Ideas become videos on the spot

    A one-line message is enough. You do not need to be at a desk or know how to write a detailed video prompt.

  • Everything is saved

    Each video lands in your Drive Shorts folder, so nothing lives only in a chat history.

  • Review on your phone

    The video comes back in Telegram, where you can watch it and decide whether to post it.

  • Only you can use it

    The bot answers your chat only, so your video credits are not spent by strangers.

How it works

What happens, step by step

  1. It starts when you send a video idea to your Telegram bot.

  2. It checks the message came from you, then AI turns your idea into a detailed video prompt.

  3. Your video service generates the clip, and ClickRuntime saves it to your Google Drive Shorts folder.

  4. The finished video is sent back to you in Telegram.

Before it runs live

  • Connect Google Drive
  • Connect Telegram
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Message a video idea to Telegram and get the finished video backjust nowSucceeded
Telegram · Shorts🎬 Northwind Bakery: morning sourdough coming out of the oven (saved to Drive/Shorts)

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 Telegram 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.
telegram_prompt_to_ai_video_saved_in_drive.pyexample
from googleapiclient.http import MediaInMemoryUpload
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_event, credentials, http, ai

MY_CHAT_ID, SHORTS_ID = 123456789, "your-shorts-folder-id"
VIDEO_API = "https://api.your-video-service.com/v1/videos"

@on_event
def handle(event):
    msg = event.event.get("message", {})
    if msg.get("chat", {}).get("id") != MY_CHAT_ID or not msg.get("text"):
        return {"ignored": True}
    bot = f"https://api.telegram.org/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}"
    http.post(f"{bot}/sendMessage", json={"chat_id": MY_CHAT_ID, "text": "Making your video..."})
    prompt = ai.generate(f"Write a detailed prompt for a 15-second vertical video. Idea: {msg['text']}", max_output_tokens=300).text
    job = http.post(VIDEO_API, json={"prompt": prompt}, headers={"Authorization": f"Bearer {credentials.secret('VIDEO_API_KEY')}"},
                    timeout=300).json()
    video = http.get(job["video_url"], timeout=120).content
    drive = build("drive", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
    drive.files().create(body={"name": f"{msg['text'][:50]}.mp4", "parents": [SHORTS_ID]},
                         media_body=MediaInMemoryUpload(video, mimetype="video/mp4")).execute()
    http.post(f"{bot}/sendVideo", data={"chat_id": MY_CHAT_ID, "caption": msg["text"][:200]},
              files={"video": ("short.mp4", video)}, timeout=120)
    return {"sent": True}

FAQ

Common questions

How long are the videos?
Short vertical clips suited to social posts. You can set the length and format your video service supports.
Can I give style instructions?
Yes. Add them to your message, for example bright colours or a calm voiceover, and they are included in the prompt.
What if the video service is slow?
You get a quick message that the video is being made, then the file once it is ready.
What permissions does it need?
Telegram bot token; Drive write. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly 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 “Message a video idea to Telegram and get the finished video back” from your assistant

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