Every 15 minutes
Read totals from receipts dropped in S3
New receipts and PDFs in your bucket have their vendor, date and total pulled out and emailed to you.
- Runs
- Every 15 minutes
- Apps
- AWS
- AI
- Not needed
- Access
- s3:ListBucket, s3:GetObject, textract:AnalyzeExpense, textract:DetectDocumentText
Send this to your assistant
Create a ClickRuntime automation: every 15 minutes, look for new files in the receipts/ folder of my S3 bucket, run Textract on each, and email me the vendor, date and total.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A bookkeeping team receives receipts and supplier invoices as photos and PDFs, which staff drop into a shared S3 folder. Someone then opens each file, reads the vendor, the date and the total, and types them into a spreadsheet. With forty documents a week, it is a dull task that invites typos, and a total entered as 1,250 instead of 125.0 can sit unnoticed until reconciliation, when it takes an hour to find.
Every 15 minutes, ClickRuntime checks the bucket for new files, sends each one to Amazon Textract, which reads the text and, for receipts and invoices, pulls out fields such as vendor, date and total. The extracted values for each document arrive in one email you can paste or forward.
It suits small finance and operations teams that deal with paper-based documents but do not want to buy a full document-capture product.
What you get out of it
Typing errors in totals disappear
Amounts are read from the document by Textract rather than copied by a person at the end of a long day. That cuts the risk of transposed digits in your books.
Bookkeeping time goes to review, not data entry
Checking an extracted vendor and total takes seconds, while typing them takes minutes. Over a month, hours move from keying to spotting actual problems. Over a month, those hours add up to a real saving.
Documents are processed within minutes
Receipts dropped into the folder are read the same hour. Expense claims and supplier invoices are recorded promptly, so month-end close does not begin with a backlog. Month-end close then starts without a backlog of unread paper.
Searchable text exists for every file
A scanned PDF is just an image until it is read. Extracted text means you can find a receipt by merchant or amount later without opening documents one by one.
Mistakes are caught while the paper is at hand
If Textract misreads a field or a receipt is unreadable, the email makes it clear soon after upload. Someone can still retake the photo, which is hard to do weeks later.
How it works
What happens, step by step
Every 15 minutes ClickRuntime checks your S3 bucket for new receipts and PDFs.
It skips files it has already read.
Amazon Textract reads each new document and pulls out the vendor, date and total.
The details arrive in your inbox.
Before it runs live
- Connect AWS
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
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other AWS steps into one automation
Under the hood
The code that runs this automation
import boto3
from clickruntime import on_trigger, credentials, notify, state, report_fetched
REGION = "us-east-1"
def aws(service):
return boto3.client(service, region_name=REGION, aws_access_key_id=credentials.secret("AWS_ACCESS_KEY_ID"),
aws_secret_access_key=credentials.secret("AWS_SECRET_ACCESS_KEY"))
BUCKET = "acme-receipts"
@on_trigger
def run(event):
last = state.get("last_modified") or ""
objects = aws("s3").list_objects_v2(Bucket=BUCKET, Prefix="receipts/").get("Contents", [])
new = [o for o in objects if o["LastModified"].isoformat() > last and not o["Key"].endswith("/")]
report_fetched(len(new))
if not new:
return {"new": 0}
textract = aws("textract")
for o in new:
doc = textract.analyze_expense(Document={"S3Object": {"Bucket": BUCKET, "Name": o["Key"]}})["ExpenseDocuments"][0]
fields = {f["Type"]["Text"]: f["ValueDetection"]["Text"] for f in doc["SummaryFields"] if "ValueDetection" in f}
notify.email_me(f"Receipt: {fields.get('VENDOR_NAME', '?')} {fields.get('TOTAL', '')}",
f"File: {o['Key']}\nVendor: {fields.get('VENDOR_NAME')}\nDate: {fields.get('INVOICE_RECEIPT_DATE')}\nTotal: {fields.get('TOTAL')}")
state.set("last_modified", max(o["LastModified"].isoformat() for o in new))
return {"new": len(new)}FAQ
Common questions
What kinds of documents work best?
Where does the extracted data end up?
Does it cost extra to use Textract?
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
Hear about new files in an S3 folder
You get an email listing files newly added under a folder in your bucket.
See how it worksTranscribe new recordings in S3
Audio and video added to your bucket is transcribed, and each transcript reaches you by email when it's done.
See how it worksStore files sent to a link in S3
Files or file URLs posted to your link are saved in your bucket under the date, and you get a download link.
See how it worksKeep exploring
Set up “Read totals from receipts dropped in S3” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.