Skip to content

Daily

Post image carousels from Drive to Instagram and Facebook

Images in your Drive folder are posted as carousels on Instagram and as photo posts on your Facebook Page, with captions, on your schedule.

Runs
Daily
Apps
Facebook Pages, Google Drive
AI
Yes, uses the built-in AI allowance
Access
drive; instagram_content_publish, pages_manage_posts

Send this to your assistant

Create a ClickRuntime automation: every Monday, Wednesday and Friday at 11, take the next subfolder of images from my Drive 'Carousels' folder, post them as an Instagram carousel and a Facebook post with a written caption, and move the subfolder to 'Posted'.

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

An interior designer documents each project in a set of photos saved to its own Drive folder. Posting them as carousels on Instagram and Facebook means downloading, reordering and uploading each set twice.

Each subfolder in Drive is now one post. Three times a week the next set goes out as an Instagram carousel and a Facebook photo post with a caption, and the folder moves to Posted.

What you get out of it

  • One folder, one post

    Organise photos the way you already do, and each folder becomes a post.

  • Carousels without the fiddling

    Images are uploaded in order to both networks for you.

  • Captions that fit the project

    Captions are written from the folder name and any notes.

  • Steady schedule

    Three posts a week, every week, from your backlog.

How it works

What happens, step by step

  1. On your schedule, ClickRuntime picks the next subfolder in your Drive 'Carousels' folder.

  2. It prepares each image on Instagram and combines them into one carousel, then publishes it.

  3. AI writes a caption, and the same images are posted together on your Facebook Page.

  4. The subfolder moves to 'Posted', so it's never used twice.

Before it runs live

  • Connect Facebook Pages
  • Connect Google Drive

What you get

RunsDaily
Post image carousels from Drive to Instagram and Facebooktoday, 9:00Succeeded
Instagram · @northwindinteriorsA 1930s terrace, opened up for a family of five. Swipe for the before and after ➡️

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

  • Run it at a different time, more or less often, or only on weekdays
  • 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 Facebook Pages and Google Drive 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.
instagram_facebook_image_posts_from_drive.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, ai

PAGE_ID, IG_ID, ROOT, POSTED, G = "1234567890", "17841400000000000", "folder-carousels-id", "folder-posted-id", "https://graph.facebook.com/v21.0"

@on_trigger
def run(event):
    drive = build("drive", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
    folders = drive.files().list(q=f"'{ROOT}' in parents and mimeType='application/vnd.google-apps.folder'",
                                 orderBy="name", pageSize=1).execute()["files"]
    if not folders:
        return {"posted": False}
    folder = folders[0]
    images = drive.files().list(q=f"'{folder['id']}' in parents and mimeType contains 'image/'", orderBy="name",
                                fields="files(id,webContentLink)", pageSize=10).execute()["files"]
    for img in images:
        drive.permissions().create(fileId=img["id"], body={"type": "anyone", "role": "reader"}).execute()
    caption = ai.generate(f"Instagram caption for an interior design project: {folder['name']}", max_output_tokens=150).text.strip()
    t = {"access_token": credentials.connection("facebook", "work")}
    kids = [http.post(f"{G}/{IG_ID}/media", data={**t, "image_url": i["webContentLink"], "is_carousel_item": "true"}).json()["id"] for i in images]
    c = http.post(f"{G}/{IG_ID}/media", data={**t, "media_type": "CAROUSEL", "children": ",".join(kids), "caption": caption}).json()["id"]
    http.post(f"{G}/{IG_ID}/media_publish", data={**t, "creation_id": c})
    fb_ids = [http.post(f"{G}/{PAGE_ID}/photos", data={**t, "url": i["webContentLink"], "published": "false"}).json()["id"] for i in images]
    http.post(f"{G}/{PAGE_ID}/feed", json={**t, "message": caption, "attached_media": [{"media_fbid": i} for i in fb_ids]})
    drive.files().update(fileId=folder["id"], addParents=POSTED, removeParents=ROOT).execute()
    return {"images": len(images)}

FAQ

Common questions

How many images can a carousel have?
Up to ten, in name order. Extra images in a folder are left out.
How do I control the order?
Name files 01, 02, 03 and so on, and they're posted in that order.
Can I add a caption myself?
Yes. Put a text file named caption in the folder and it's used instead of a written one.
What permissions does it need?
drive; instagram_content_publish, pages_manage_posts. 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 runs (daily). Checks that find nothing to do 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 “Post image carousels from Drive to Instagram and Facebook” from your assistant

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