Skip to content

Every 10 minutes

Send finished files from Drive to people on WhatsApp

When a file named with a phone number lands in your Drive Outbox folder, it's sent to that person on WhatsApp and moved to Sent.

Runs
Every 10 minutes
Apps
Google Drive, WhatsApp Business
AI
Not needed
Access
Drive read+write; WhatsApp messaging

Send this to your assistant

Create a ClickRuntime automation: every 10 minutes, check my Drive Outbox folder for new files, send each one on WhatsApp to the phone number at the start of its name, then move it to the Sent folder.

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

Labs, print shops, photographers and accountants all produce files that need to reach a specific customer: a result, a proof, a set of photos, a tax return. Emailing each one means finding the address, attaching the file and hoping it isn't too big.

Dropping the finished file into a Drive folder, named with the customer's number, and having it delivered on WhatsApp gets it to their phone in minutes, with the Sent folder as a record of what went out.

What you get out of it

  • Delivered to their phone

    Customers get files on WhatsApp, which they check far more than email.

  • Nothing to attach

    Saving the file in the folder is the only step.

  • A record of what went out

    Sent files are moved to a Sent folder.

  • Works from any device

    Save from your computer, scanner or phone; if it lands in the folder, it's sent.

How it works

What happens, step by step

  1. Every 10 minutes it checks your Drive Outbox folder for new files.

  2. It reads the recipient's phone number from the start of each file name.

  3. The file is uploaded to WhatsApp and sent to that number as a document.

  4. The file is moved to your Sent folder so it isn't sent again.

Before it runs live

  • Connect Google Drive
  • Connect WhatsApp Business

What you get

RunsEvery 10 minutes
Send finished files from Drive to people on WhatsApptoday, 9:00Succeeded
WhatsApp · Customer📄 Northwind-Lab-results-Oct.pdf

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
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Google Drive and WhatsApp Business 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.
deliver_drive_files_to_people_on_whatsapp.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, report_fetched

OUTBOX, SENT = "outbox-folder-id", "sent-folder-id"
PHONE_ID = "your-phone-number-id"
drive = lambda: build("drive", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)

@on_trigger
def run(event):
    files = drive().files().list(q=f"'{OUTBOX}' in parents and trashed=false", fields="files(id,name,mimeType)").execute()["files"]
    files = [f for f in files if f["name"].split(" ")[0].isdigit()]
    report_fetched(len(files))
    if not files:
        return {"summary": "Nothing to send"}
    h = {"Authorization": f"Bearer {credentials.secret('WHATSAPP_TOKEN')}"}
    for f in files:
        data = drive().files().get_media(fileId=f["id"]).execute()
        media_id = http.post(f"https://graph.facebook.com/v20.0/{PHONE_ID}/media", headers=h, data={"messaging_product": "whatsapp"},
                             files={"file": (f["name"], data, f["mimeType"])}).json()["id"]
        http.post(f"https://graph.facebook.com/v20.0/{PHONE_ID}/messages", headers=h, json={"messaging_product": "whatsapp",
                  "to": f["name"].split(" ")[0], "type": "document", "document": {"id": media_id, "filename": f["name"].split(" ", 1)[-1]}}).raise_for_status()
        drive().files().update(fileId=f["id"], addParents=SENT, removeParents=OUTBOX).execute()
    return {"sent": len(files)}

FAQ

Common questions

How does it know who to send to?
The file name starts with the person's phone number, for example 447700900123 results.pdf.
Is there a size limit?
WhatsApp accepts documents up to 100 MB.
Can the customer reply?
Yes. Replies come into your WhatsApp business inbox like any other message.
What permissions does it need?
Drive read+write; WhatsApp messaging. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's 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 “Send finished files from Drive to people on WhatsApp” from your assistant

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