Every 15 minutes
Turn invoice PDFs in Drive into Airtable rows
Each invoice or receipt you save to a Drive folder becomes an Airtable record with vendor, number, date, total and line items.
- Runs
- Every 15 minutes
- Apps
- Airtable, Google Drive
- AI
- Yes, uses the built-in AI allowance
- Access
- Drive read; Airtable write
Send this to your assistant
Create a ClickRuntime automation: when a new invoice PDF lands in my Drive 'Invoices' folder, pull out the vendor, invoice number, date, total and line items, and add them to my Airtable 'Invoices' table with the Drive link.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A small agency's office manager saves every supplier invoice and receipt to a shared Drive folder. At month end the bookkeeper needs a list with vendor, date and amount for each one, so the office manager opens every PDF and types the figures into Airtable. It takes most of a day, and a mistyped total is only found when the numbers do not add up.
Reading each PDF as it lands and writing the figures into Airtable means the month-end list is already there. The bookkeeper checks it against the files instead of building it from scratch, and the link on each row opens the original.
What you get out of it
No retyping at month end
Vendor, number, date and total are filled in as each invoice is saved, so the list is ready when the bookkeeper asks.
Line items are kept too
Each record includes the line items as text, which helps when you need to split costs across clients or projects.
The original is one click away
Every row links to the PDF in Drive, so checking a figure means opening the file, not searching for it.
Each file is read once
The newest file time is remembered, so saving more invoices never re-imports the old ones.
How it works
What happens, step by step
Every 15 minutes, ClickRuntime checks your Invoices folder in Drive for new PDFs.
It downloads each new file and reads the text.
AI picks out the vendor, invoice number, date, currency, total and line items.
A record is created in your Airtable Invoices table with those details and a link to the PDF.
The newest file time is remembered, so each invoice is read once.
Before it runs live
- Connect Airtable
- Connect Google Drive
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 Airtable and Google Drive steps into one automation
Under the hood
The code that runs this automation
import io
from pypdf import PdfReader
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, ai, state, report_fetched
BASE_ID, FOLDER_ID = "appXXXXXXXXXXXXXX", "1FolderIdOfInvoices"
SCHEMA = {"type": "object", "properties": {"vendor": {"type": "string"}, "number": {"type": "string"},
"date": {"type": "string"}, "currency": {"type": "string"}, "total": {"type": "number"},
"lines": {"type": "string"}}, "required": ["vendor", "number", "date", "total"]}
@on_trigger
def run(event):
drive = build("drive", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
since = state.get("since") or "2026-01-01T00:00:00Z"
files = drive.files().list(q=f"'{FOLDER_ID}' in parents and mimeType = 'application/pdf' and createdTime > '{since}'",
orderBy="createdTime", fields="files(id,name,createdTime,webViewLink)").execute()["files"]
report_fetched(len(files))
if not files:
return {"new": 0}
headers = {"Authorization": f"Bearer {credentials.connection('airtable', 'work')}"}
for f in files:
pdf = PdfReader(io.BytesIO(drive.files().get_media(fileId=f["id"]).execute()))
text = "\n".join(p.extract_text() or "" for p in pdf.pages)[:8000]
inv = ai.generate(text, json_schema=SCHEMA, max_output_tokens=500,
system="Extract invoice fields. Date as YYYY-MM-DD. Lines as 'description - amount' per line.").json
http.post(f"https://api.airtable.com/v0/{BASE_ID}/Invoices", headers=headers, json={"typecast": True,
"records": [{"fields": {"Vendor": inv["vendor"], "Invoice number": inv["number"], "Date": inv["date"],
"Currency": inv.get("currency", ""), "Total": inv["total"], "Line items": inv.get("lines", ""),
"File": f["webViewLink"]}}]}).raise_for_status()
state.set("since", f["createdTime"])
return {"new": len(files)}FAQ
Common questions
What about scanned paper receipts?
How are currencies handled?
Can it catch the same invoice saved twice?
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
Screen CVs from a Drive folder into Airtable
Each CV dropped into your Drive folder is read, scored against the job, and saved as a candidate record in Airtable.
See how it worksWrite captions for Drive videos and track them in Airtable
Each video or photo you drop into a Drive folder gets a caption and hashtags and appears in your Airtable content table, ready to post.
See how it worksDraft articles from approved Airtable topics into Drive
Topics you approve in Airtable are written up as draft articles, saved as Google Docs in Drive, and linked back on the record.
See how it worksKeep exploring
Set up “Turn invoice PDFs in Drive into Airtable rows” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.