Skip to content

On a schedule

Publish videos from a Drive folder with AI titles and a Telegram ping

Drop a video into a Drive folder and it goes to YouTube with an AI-written title and description, with a Telegram message when it is live.

Runs
On a schedule
Apps
Telegram, YouTube
AI
Yes, uses the built-in AI allowance
Access
youtube.upload; bot token

Send this to your assistant

Create a ClickRuntime automation: every hour, check my 'To publish' Drive folder for new videos. Write a title and description with AI from the file name, upload each to YouTube, and send me the link on Telegram.

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 solo creator edits videos on a laptop and saves the finished files to a Drive folder. Uploading, writing titles and filling in descriptions is the part they keep putting off, so finished videos sit in the folder for days.

Watching the folder and publishing whatever lands in it means finishing the edit is the last thing the creator has to do.

What you get out of it

  • Finished means published

    Saving the file to the folder is the only step after editing.

  • Titles and descriptions drafted for you

    AI writes them from the file name, which you can name with the topic in mind.

  • A ping on your phone

    Telegram confirms each upload with the link, so you know it went through.

  • Each file once

    Files already uploaded are remembered and never published twice.

How it works

What happens, step by step

  1. Every hour, ClickRuntime checks your Drive folder for video files it has not published yet.

  2. AI writes a title and description for each one from its file name.

  3. The video is uploaded to your YouTube channel.

  4. You get a Telegram message with the title and link, and the file is remembered so it is not uploaded again.

Before it runs live

  • Connect Telegram
  • Connect YouTube

What you get

RunsOn a schedule
Publish videos from a Drive folder with AI titles and a Telegram pingtoday, 9:00Succeeded
Telegram · Uploads📺 How to fix a squeaky door hinge in 2 minutes https://youtu.be/Hj6Kl5Mn4Bv

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 Telegram and YouTube 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.
publish_videos_from_a_folder_with_ai_metadata_and_telegram_confirmation.pyexample
import io
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from googleapiclient.http import MediaIoBaseUpload
from clickruntime import on_trigger, report_fetched, credentials, ai, state

def api(name, version):
    return build(name, version, credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)

CHAT_ID = "123456789"

def tg(method, **params):
    r = http.post(f"https://api.telegram.org/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}/{method}", json=params)
    return r.raise_for_status() or r.json()["result"]

FOLDER_ID = "your-drive-folder-id"

@on_trigger
def run(event):
    done = set(state.get("done") or [])
    files = api("drive", "v3").files().list(q=f"'{FOLDER_ID}' in parents and mimeType contains 'video/' and trashed=false", fields="files(id,name)").execute()["files"]
    new = [f for f in files if f["id"] not in done]
    report_fetched(len(new))
    if not new:
        return {"summary": "No new videos"}
    for f in new:
        meta = ai.generate(f"File name: {f['name']}", system="Write a YouTube title (max 90 chars) and a 3-sentence description.",
                           json_schema={"type": "object", "properties": {"title": {"type": "string"}, "description": {"type": "string"}}}, max_output_tokens=250).json
        data = api("drive", "v3").files().get_media(fileId=f["id"]).execute()
        video = api("youtube", "v3").videos().insert(part="snippet,status", body={"snippet": meta, "status": {"privacyStatus": "public"}},
                media_body=MediaIoBaseUpload(io.BytesIO(data), mimetype="video/mp4", resumable=True)).execute()
        tg("sendMessage", chat_id=CHAT_ID, text=f"📺 {meta['title']}\nhttps://youtu.be/{video['id']}")
        done.add(f["id"])
    state.set("done", sorted(done))
    return {"published": len(new)}

FAQ

Common questions

How should I name the files?
Use the topic as the file name, such as "how to fix a squeaky door hinge.mp4". The more descriptive, the better the title.
Can it upload as private?
Yes. Ask for private or unlisted uploads if you want to check each one before it goes public.
What about large files?
Videos are uploaded in parts, so longer files work. Very large files may need a longer run time, which you can set in your ClickRuntime dashboard.
What permissions does it need?
youtube.upload; bot token. 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 each time it checks. Checks that find nothing new and stop right away aren't counted.
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 “Publish videos from a Drive folder with AI titles and a Telegram ping” from your assistant

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