Skip to content

Every 15 minutes

Check purchase requests against your budget sheet

New purchase requests in Airtable are checked against the department budget in your sheet and approved, flagged or rejected.

Runs
Every 15 minutes
Apps
Airtable, Google Sheets
AI
Optional
Access
Airtable read+write; Sheets read

Send this to your assistant

Create a ClickRuntime automation: every 15 minutes, check new purchase requests in Airtable against my budget sheet. Approve ones well within budget, reject ones over it, and send me any that need a person to decide in Slack.

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

At a growing company, staff log purchase requests in an Airtable form: a new laptop, a software seat, a conference ticket. Finance keeps the remaining budget per department in a Google Sheet. Every request means opening both, finding the department line, and doing the sum. Small requests wait days for an answer they could have had in minutes.

Comparing each request with the remaining budget as it comes in clears the routine ones straight away and sends only the borderline requests to a person, with the numbers already worked out. AI reads the justification on those borderline requests and suggests a decision.

What you get out of it

  • Routine requests are approved quickly

    Requests well inside the department's remaining budget are set to Approved without waiting for a review.

  • Over-budget requests are caught

    Anything that would take a department over its budget is marked Rejected with the reason written on the record.

  • Borderline ones come to you with context

    You get a Slack message with the amount, the remaining budget and a suggested decision, so you can answer in one look.

  • The budget stays in the sheet finance owns

    Finance keeps editing the same sheet. The automation reads it fresh on each run.

How it works

What happens, step by step

  1. Every 15 minutes, ClickRuntime looks for purchase requests in Airtable with no status yet.

  2. It reads the remaining budget for each department from your budget sheet.

  3. Small requests within budget are approved, and requests over budget are rejected with a reason.

  4. For anything in between, AI reads the justification and suggests a decision.

  5. Those requests are marked as needing approval and posted to you in Slack.

Before it runs live

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

What you get

RunsEvery 15 minutes
Check purchase requests against your budget sheettoday, 9:00Succeeded
Slack · #financeNeeds approval: Design conference ticket (Marketing) 1200 of 3400 left. Suggest approve: the team has no other training booked this quarter.

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 Airtable and Google Sheets 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.
triage_purchase_requests_from_airtable_with_a_sheet_budget.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, ai, notify, report_fetched
BASE_ID = "appXXXXXXXXXXXXXX"
SHEET_ID = "1AbCdEfGhIjKlMnOpQrStUvWxYz"
@on_trigger
def run(event):
    api = f"https://api.airtable.com/v0/{BASE_ID}/Purchase%20requests"
    headers = {"Authorization": f"Bearer {credentials.connection('airtable', 'work')}"}
    records = http.get(api, headers=headers, params={"filterByFormula": "{Status}=''"}).json()["records"]
    report_fetched(len(records))
    if not records:
        return {"checked": 0}
    sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
    rows = sheets.spreadsheets().values().get(spreadsheetId=SHEET_ID, range="Budget!A2:B").execute().get("values", [])
    left = {r[0]: float(r[1]) for r in rows if len(r) == 2}
    for rec in records:
        f = rec["fields"]
        amount, remaining = float(f.get("Amount") or 0), left.get(f.get("Department"), 0.0)
        if amount <= remaining * 0.2:
            status, note = "Approved", "Within budget"
        elif amount > remaining:
            status, note = "Rejected", f"Over budget: {remaining:.0f} left"
        else:
            status = "Needs approval"
            note = ai.generate(f"Request: {f.get('Item')} for {amount:.0f}. Budget left: {remaining:.0f}.\nReason: {f.get('Justification', '')[:1000]}",
                               system="Suggest approve or decline in one sentence.", max_output_tokens=80).text
            notify.slack(f"Needs approval: {f.get('Item')} ({f.get('Department')}) {amount:.0f} of {remaining:.0f} left. {note}", channel="#finance")
        http.patch(api, headers=headers, json={"records": [{"id": rec["id"], "fields": {"Status": status, "Decision note": note}}]}).raise_for_status()
    return {"checked": len(records)}

FAQ

Common questions

What counts as 'well within budget'?
The script uses a simple rule you can set: by default, requests under 20% of what the department has left are approved, and anything over the remaining amount is rejected. Everything in between is flagged.
Does AI make the final decision?
No. Clear cases are decided by the budget rule. For flagged requests AI reads the justification and suggests approve or decline, but the record stays as Needs approval until a person changes it.
Does it subtract approved requests from the budget sheet?
Not by default, because finance usually updates the sheet. If you want the remaining amount reduced automatically, ask your AI assistant to write the new figure back to the sheet.
What permissions does it need?
Airtable read+write; Sheets read. Nothing else in your accounts is used.
Does it need AI?
No, but you can ask for an AI step (for example a summary). It then uses ClickRuntime's built-in 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 “Check purchase requests against your budget sheet” from your assistant

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