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.
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
Every 15 minutes, ClickRuntime reads your sheet and looks for rows whose status is Failed.
Rows that already have a task are skipped.
AI reads the details in each new failed row and writes a short likely cause and a first step.
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
Build your own
Need it to work differently?
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
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?
Can I use a different status word?
What if a row is fixed and fails again later?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Log new emails in a sheet and turn action items into tasks
Every new email is sorted and logged in your sheet, and the ones that need you become Google Tasks.
See how it worksTrack a web page for new items and get a task to review each
New items on a page you follow are summarised into your sheet, and each one gets a Google Task so you review it.
See how it worksTurn the top items in your task sheet into today's Google Tasks
Each morning the most important open items from your sheet are added to Google Tasks, and the rows are marked as added.
See how it worksKeep exploring
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.