Skip to content

Hourly

Log late Shopify orders to a sheet

Every hour, paid orders that have missed your dispatch time are added to a sheet, and you get a Slack alert for each new one.

Runs
Hourly
Apps
Google Sheets, Shopify
AI
Not needed
Access
Shopify read_orders; Sheets write

Send this to your assistant

Create a ClickRuntime automation: every hour, find paid Shopify orders unfulfilled for more than 48 hours, add any new ones to my Late orders sheet, and post them to #fulfilment.

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 clothing brand promises dispatch within two working days. When a supplier is slow or a packer is off sick, some orders slip, and the team only learns about it from customer emails a week later.

A running list of every order that missed the promise, updated each hour, lets the team chase them while there is still time to apologise or upgrade shipping. Over months, the sheet also shows how often promises are missed and why.

What you get out of it

  • Late orders are caught early

    Each order that passes your dispatch time is listed within an hour. The team can act before the customer notices.

  • A history of missed promises

    The sheet builds a record of every late order with its date. Patterns such as a particular product or weekday show up over time.

  • Each order is logged once

    Orders already on the sheet are not added again. The list stays clean and easy to work through.

  • Room to track the follow-up

    Add columns for reason, action taken or customer contacted. The sheet becomes the team's checklist for late orders.

How it works

What happens, step by step

  1. Every hour, ClickRuntime looks for paid Shopify orders that have not been shipped.

  2. It keeps the ones older than your dispatch time, such as 48 hours.

  3. It skips any order it has already logged.

  4. New late orders are added to your Late orders sheet with the order number, customer, date and hours waiting.

  5. A message in your #fulfilment Slack channel lists the new ones.

Before it runs live

  • Connect your Google Sheets account and pick the spreadsheets it may use
  • Connect Shopify

What you get

RunsHourly
Log late Shopify orders to a sheettoday, 9:00Succeeded
Slack · #fulfilment2 orders past 48h without shipping: #5120, #5124

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
  • 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 Sheets and Shopify 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.
log_late_or_unfulfilled_shopify_orders_to_a_sheet.pyexample
from datetime import datetime, timedelta, timezone
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, notify, state, report_fetched

STORE = "your-store.myshopify.com"

def gql(query, variables=None):
    resp = http.post(f"https://{STORE}/admin/api/2025-07/graphql.json", json={"query": query, "variables": variables or {}},
                     headers={"X-Shopify-Access-Token": credentials.connection("shopify", "store")})
    return resp.raise_for_status() or resp.json()["data"]

SHEET_ID, SLA_HOURS = "your-spreadsheet-id", 48

@on_trigger
def run(event):
    now = datetime.now(timezone.utc)
    cutoff = (now - timedelta(hours=SLA_HOURS)).strftime("%Y-%m-%dT%H:%M:%SZ")
    orders = gql(f'{{ orders(first: 100, query: "financial_status:paid fulfillment_status:unfulfilled created_at:<{cutoff}") '
                 '{ nodes { name createdAt customer { displayName } } } }')["orders"]["nodes"]
    logged = set(state.get("logged") or [])
    new = [o for o in orders if o["name"] not in logged]
    report_fetched(len(new))
    if not new:
        return {"new": 0}
    rows = [[o["name"], (o["customer"] or {}).get("displayName", ""), o["createdAt"][:16].replace("T", " "),
             round((now - datetime.fromisoformat(o["createdAt"].replace("Z", "+00:00"))).total_seconds() / 3600)] for o in new]
    sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
    sheets.spreadsheets().values().append(spreadsheetId=SHEET_ID, range="Late orders!A:D", valueInputOption="USER_ENTERED", body={"values": rows}).execute()
    notify.slack(f"{len(new)} orders past {SLA_HOURS}h without shipping: " + ", ".join(r[0] for r in rows), channel="#fulfilment")
    state.set("logged", sorted(logged | {o["name"] for o in new})[-1000:])
    return {"new": len(new)}

FAQ

Common questions

Does it count weekends?
By default the dispatch time counts every hour. You can ask for working hours only, so an order placed on Friday evening is not late on Sunday.
What happens when a late order ships?
It stays on the sheet as a record. You can add a column that is filled in when the order ships, if you want to see how late each one was.
Can it email me instead of posting in Slack?
Yes. Ask for an email alert and new late orders are sent to your inbox instead of, or as well as, Slack.
What permissions does it need?
Shopify read_orders; Sheets write. 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 runs (hourly). 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 “Log late Shopify orders to a sheet” from your assistant

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