Every 30 minutes
Get a payment task for every invoice in your inbox
Each invoice email becomes a Google Task due on its payment date, with the supplier and amount in the title.
- Runs
- Every 30 minutes
- Apps
- Gmail, Google Tasks
- AI
- Yes, uses the built-in AI allowance
- Access
- gmail.modify; tasks
Send this to your assistant
Create a ClickRuntime automation: every 30 minutes, find new invoice emails, create a Google Task to pay each one due on its due date with the supplier and amount, and label the email Tasked.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Supplier invoices arrive by email at random times, each with its own terms. Unless someone copies the due date somewhere, late fees and awkward reminder calls follow, and small businesses feel both.
Owners of small businesses, freelancers and office managers use it to keep every bill on a dated list without a bookkeeping tool or a manual routine.
What you get out of it
Every bill on your calendar
Tasks with due dates appear in Google Calendar on the day payment is due, which is hard to overlook.
Supplier and amount at a glance
The task title shows who to pay and how much, so you can plan the week's payments from the list.
Fewer late fees
Knowing the due date as soon as the invoice arrives means paying on time instead of when the reminder comes.
Handled emails are labelled
A Tasked label shows which invoices are already on your list, and they are never picked up twice.
How it works
What happens, step by step
Every 30 minutes, ClickRuntime looks in Gmail for new emails about invoices that are not labelled Tasked yet.
AI reads each one and picks out the supplier, amount and due date, or skips it if it is not an invoice.
A Google Task is created, such as Pay Northwind 420.00 EUR, due on the payment date.
The email is labelled Tasked so it is not handled again.
Before it runs live
- Connect Google through your own Google app (a one-time, 10-minute setup), so it works with your own Gmail
- 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 Gmail and Google Tasks steps into one automation
Under the hood
The code that runs this automation
from datetime import date, timedelta
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, report_fetched, credentials, ai
LABEL_ID = "Label_123" # your "Tasked" label
SCHEMA = {"type": "object", "properties": {k: {"type": "string"} for k in ["is_invoice", "supplier", "amount", "due_date"]}}
@on_trigger
def run(event):
creds = Credentials(credentials.connection("google", "work"))
gmail = build("gmail", "v1", credentials=creds, cache_discovery=False).users().messages()
new = gmail.list(userId="me", q="invoice -label:Tasked newer_than:7d", maxResults=20).execute().get("messages", [])
report_fetched(len(new))
if not new:
return {"new": 0}
tasks, added = build("tasks", "v1", credentials=creds, cache_discovery=False).tasks(), 0
for m in new:
msg = gmail.get(userId="me", id=m["id"], format="metadata", metadataHeaders=["From", "Subject"]).execute()
info = ai.generate(f"Is this a supplier invoice (yes/no)? Give supplier, amount with currency and due date as "
f"YYYY-MM-DD.\n{msg['snippet']}\n{msg['payload']['headers']}", json_schema=SCHEMA,
max_output_tokens=120).json
if info.get("is_invoice") == "yes":
due = info.get("due_date") or (date.today() + timedelta(days=14)).isoformat()
tasks.insert(tasklist="@default", body={"title": f"Pay {info['supplier']} {info['amount']}", "due": f"{due}T00:00:00.000Z",
"notes": f"https://mail.google.com/mail/u/0/#all/{m['id']}"}).execute()
added += 1
gmail.modify(userId="me", id=m["id"], body={"addLabelIds": [LABEL_ID]}).execute()
return {"checked": len(new), "tasks": added}FAQ
Common questions
How does it recognise an invoice?
What if there is no due date in the email?
Does it read the PDF attachment?
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
Turn emailed meeting notes into tasks and a recap
When meeting notes reach your inbox, each action item becomes a Google Task and attendees get a short recap email.
See how it worksSort new emails, draft replies and create tasks
New emails are labelled, simple questions get a draft reply, and anything you need to do becomes a Google Task.
See how it worksGet your Google Tasks ranked by priority each morning
Each morning an email lists your open Google Tasks in the order to tackle them, with a line on why the top ones matter.
See how it worksKeep exploring
Set up “Get a payment task for every invoice in your inbox” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.