Skip to content

Every 15 minutes

Create a task with an explanation when a sheet row is marked failed

When a row in your sheet changes to Failed, a Google Task appears with a likely cause, and you get an email.

Runs
Every 15 minutes
Apps
Google Sheets, Google Tasks
AI
Yes, uses the built-in AI allowance
Access
Sheets read; tasks

Send this to your assistant

Create a ClickRuntime automation: every 15 minutes, look for rows in my Orders sheet with status Failed, create a Google Task for each with a short explanation of the likely cause, and email me.

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

Many teams track orders, payments or imports in a sheet where a status column says whether each one worked. A Failed row is easy to miss among hundreds of rows, and nobody owns fixing it until a customer complains.

Operations staff, small online shops and finance teams use it to turn every failure into a task with a starting point for the fix, so problems are handled the same day.

What you get out of it

  • Failures get an owner

    A task in Google Tasks is harder to overlook than a red cell in a sheet. It stays in your list until it is done.

  • A head start on the fix

    AI reads the row's details and error text and suggests the most likely cause, such as an expired card or a missing address.

  • No scanning the sheet

    You no longer filter the sheet several times a day to look for problems. New failures come to you.

  • Each failure handled once

    Rows that already have a task are remembered, so the same failure does not create a second task.

How it works

What happens, step by step

  1. Every 15 minutes, ClickRuntime reads your sheet and looks for rows whose status is Failed.

  2. Rows that already have a task are skipped.

  3. AI reads the details in each new failed row and writes a short likely cause and a first step.

  4. A Google Task is created for each failure with that explanation, and you get one email listing them.

Before it runs live

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

What you get

RunsEvery 15 minutes
Create a task with an explanation when a sheet row is marked failedtoday, 9:00Succeeded
Google Tasks · My TasksFix failed order 10482 The card was declined for insufficient funds. Email Acme Studio to update their payment method.

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 Google Sheets and Google Tasks 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.
flagged_sheet_rows_become_google_tasks.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, report_fetched, credentials, state, ai, notify

SHEET_ID = "your-spreadsheet-id"

@on_trigger
def run(event):
    creds = Credentials(credentials.connection("google", "work"))
    sheets = build("sheets", "v4", credentials=creds, cache_discovery=False).spreadsheets()
    values = sheets.values().get(spreadsheetId=SHEET_ID, range="Orders!A1:H").execute().get("values", [])
    header, rows = values[0], values[1:]
    handled = set(state.get("handled") or [])
    failed = [dict(zip(header, r)) for r in rows if dict(zip(header, r)).get("Status") == "Failed"]
    new = [r for r in failed if r.get("Order ID") not in handled]
    report_fetched(len(new))
    if not new:
        return {"new": 0}
    tasks = build("tasks", "v1", credentials=creds, cache_discovery=False).tasks()
    lines = []
    for r in new:
        why = ai.generate("This order failed. In two short sentences, give the most likely cause and a first step to fix it.\n"
                          + "\n".join(f"{k}: {v}" for k, v in r.items()), max_output_tokens=120).text.strip()
        tasks.insert(tasklist="@default", body={"title": f"Fix failed order {r.get('Order ID')}", "notes": why}).execute()
        lines.append(f"{r.get('Order ID')}: {why}")
        handled.add(r.get("Order ID"))
    notify.email_me(f"{len(new)} failed orders need attention", "\n\n".join(lines))
    state.set("handled", sorted(handled)[-2000:])
    return {"tasks": len(new)}

FAQ

Common questions

What does the explanation look at?
It looks at the other columns in the row, such as the error message, amount and customer, and suggests a likely cause and a first step. It is a starting point, not a diagnosis, so check it before acting.
Can I use a different status word?
Yes. Tell your AI assistant the column and value to watch, such as Error, Rejected or Needs review.
What if a row is fixed and fails again later?
A row is only handled once by default. If you want a new task each time a row fails again, ask for that and the row will be tracked by its status changes.
What permissions does it need?
Sheets read; tasks. 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 “Create a task with an explanation when a sheet row is marked failed” from your assistant

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