Skip to content

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.

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

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

  1. Every 30 minutes, ClickRuntime looks in Gmail for new emails about invoices that are not labelled Tasked yet.

  2. AI reads each one and picks out the supplier, amount and due date, or skips it if it is not an invoice.

  3. A Google Task is created, such as Pay Northwind 420.00 EUR, due on the payment date.

  4. 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

RunsEvery 30 minutes
Get a payment task for every invoice in your inboxtoday, 9:00Succeeded
Google Tasks · My TasksPay Northwind Supplies 420.00 EUR (due 31 Oct)

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 Gmail 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.
invoice_emails_become_payment_reminders.pyexample
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?
It searches for emails that mention an invoice or have a PDF attachment named like one, then AI reads the message to confirm and find the supplier, amount and due date. Messages that turn out not to be invoices are skipped.
What if there is no due date in the email?
The task is set to your usual terms, for example 14 days after the email arrived. You can change that default.
Does it read the PDF attachment?
It reads the email text, which for most suppliers states the amount and due date. Invoices where those appear only inside the PDF may need the due date added by hand.
What permissions does it need?
gmail.modify; 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 “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.