Skip to content

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.

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

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

  1. Every 15 minutes ClickRuntime checks your S3 bucket for new receipts and PDFs.

  2. It skips files it has already read.

  3. Amazon Textract reads each new document and pulls out the vendor, date and total.

  4. The details arrive in your inbox.

Before it runs live

  • Connect AWS

What you get

RunsEvery 15 minutes
Read totals from receipts dropped in S3today, 9:00Succeeded
Email · ReceiptsReceipt: Acme Office Supply $84.20 Date: 10/17/2026

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
  • 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

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.
ocr_new_documents_in_s3_with_textract.pyexample
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?
Textract's expense analysis is designed for receipts and invoices, and its text detection handles general scanned documents such as letters and forms. Clear, upright images give the best accuracy. Handwriting, heavy creases or very low resolution may produce uncertain values.
Where does the extracted data end up?
It is sent by email, listing the fields found for each file along with the file name. From there you can paste it into a spreadsheet. If you want it to go straight into a Google Sheet or an accounting tool, ask your AI assistant to add that step.
Does it cost extra to use Textract?
Textract is billed by AWS per page processed, so the cost depends on how many documents you scan. ClickRuntime itself does not add to that charge, and it processes each file only once, so a document is not paid for twice.
What permissions does it need?
s3:ListBucket, s3:GetObject, textract:AnalyzeExpense, textract:DetectDocumentText. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's 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 “Read totals from receipts dropped in S3” from your assistant

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