Skip to content

Every 10 min in a window, weekdays

Get warned when your commute is running slow

On weekday mornings you get one email if your drive to work is 10 or more minutes slower than normal.

Runs
Every 10 min in a window, weekdays
Apps
Google Maps Platform
AI
Not needed
Access
API key with Routes API enabled

Send this to your assistant

Create a ClickRuntime automation: weekdays between 7:00 and 8:30, check every 10 minutes how long the drive from 14 Elm Road to 200 Market Street takes in current traffic, and email me once if it's 10+ minutes slower than usual.

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 nurse who starts her shift at 7:30 normally needs 25 minutes to drive in, so she leaves at 6:50. On the mornings when an accident closes a lane on the ring road, the trip takes 55 minutes, she finds out only after she is already stuck, and she arrives late. Checking a maps app before every departure works, but it means remembering to do it on weekdays at six in the morning, when she is rushing.

On weekday mornings, within a window you set, ClickRuntime asks the Google Maps Routes API for a traffic-aware route and reads two numbers: the current duration with traffic, and staticDuration, the normal time without traffic. If the delay is large, you get one alert saying how long the drive takes now and how much slower that is.

It is useful for shift workers, school-run parents and anyone with a fixed arrival time.

What you get out of it

  • You hear before you leave the house

    A warning that the drive is 30 minutes slower gives you the choice of leaving earlier, using a train or phoning ahead. Learning it at the first traffic jam leaves no choice at all.

  • Silence on normal days

    You only get a message when the trip is much slower than usual, so on ordinary mornings nothing arrives. That makes the alert easy to trust and hard to tune out.

  • Fewer late arrivals

    Leaving 20 minutes earlier on a bad day avoids the awkward message to a manager, the missed handover or the stress of watching the clock in traffic. The benefit is small each time and adds up over a year.

  • One alert per day

    After warning you once, it stays quiet for that morning, even while the delay changes. You get the information when you need it without a stream of updates while you are getting ready.

  • Based on your actual route

    The comparison uses your own home and work addresses, not city-wide traffic reports. A closure on a road you never use will not wake you, while a slow spot on your exact route will.

How it works

What happens, step by step

  1. Every 10 minutes on weekday mornings, ClickRuntime asks Google Maps how long your drive to work takes in current traffic.

  2. It compares that with how long the drive usually takes.

  3. If today's drive is 10 or more minutes slower, you get an email with today's time and the usual time.

  4. You only get one alert per day, so the rest of the morning's checks stay quiet.

Before it runs live

  • Connect Google Maps Platform

What you get

RunsEvery 10 min in a window, weekdays
Get warned when your commute is running slowtoday, 9:00Succeeded
Email · TrafficTraffic: commute is 41 min today Usually 24 min; 17 min slower right now.

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 Maps Platform 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.
commute_traffic_alert.pyexample
from datetime import date
from clickruntime import on_trigger, credentials, http, state, notify

ORIGIN, DEST = "14 Elm Road", "200 Market Street"

@on_trigger
def run(event):  # every 10 minutes, weekdays 7:00-8:30
    if state.get("alerted_on") == date.today().isoformat():
        return {"skipped": "already alerted today"}
    resp = http.post("https://routes.googleapis.com/directions/v2:computeRoutes",
                     headers={"X-Goog-Api-Key": credentials.secret("GOOGLE_MAPS_API_KEY"),
                              "X-Goog-FieldMask": "routes.duration,routes.staticDuration"},
                     json={"origin": {"address": ORIGIN}, "destination": {"address": DEST},
                           "travelMode": "DRIVE", "routingPreference": "TRAFFIC_AWARE"})
    route = resp.json()["routes"][0]
    now, usual = int(route["duration"].rstrip("s")) // 60, int(route["staticDuration"].rstrip("s")) // 60
    if now - usual >= 10:
        notify.email_me(f"Traffic: commute is {now} min today", f"Usually {usual} min; {now - usual} min slower right now.")
        state.set("alerted_on", date.today().isoformat())
    return {"minutes": now, "usual": usual}

FAQ

Common questions

What counts as much slower than usual?
You choose the rule: for example, an extra 10 minutes, or a trip 30 percent longer than staticDuration. A busy commuter might choose a small margin while someone with a flexible start can afford a bigger one before an alert is useful.
Does it need a Google Maps API key?
Yes. The Routes API requires a Google Cloud project with the API enabled, and the key is stored as a secret. Google has usage-based pricing and a monthly free allowance, so check the current terms for the number of checks you plan.
Can it check the drive home as well?
Yes. Add an afternoon window with the route reversed, for example 16:00 to 18:30, and the same comparison runs. Each window can have its own alert limit and its own notification channel, such as email in the morning and Slack later.
What permissions does it need?
API key with Routes API enabled. 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 (every 10 min in a window, weekdays). 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 “Get warned when your commute is running slow” from your assistant

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