Skip to content

Every 15 minutes

Post a summary of each invoice uploaded to S3 to Slack

Each new invoice in your S3 bucket is read, and Slack gets the vendor, amount and due date within 15 minutes.

Runs
Every 15 minutes
Apps
AWS, Slack
AI
Optional
Access
s3:ListBucket/GetObject, textract:AnalyzeExpense; chat:write

Send this to your assistant

Create a ClickRuntime automation: every 15 minutes, check my invoices bucket for new files, read the vendor, total and due date with Textract, and post a summary to #finance.

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 business collects invoices in an S3 bucket from a scanner, an upload form or another system. Files arrive, but nobody knows what's in them until someone opens each PDF, and due dates get missed.

Reading each new invoice as it lands and posting the key facts to Slack tells finance what's arrived and when it's due, without opening a single file.

What you get out of it

  • Know what's arrived

    Finance sees every new invoice with its vendor and amount the same day it's uploaded.

  • Fewer missed due dates

    The due date is in the message, so payments can be scheduled straight away.

  • No opening PDFs

    Key details are read from the file, including scanned invoices.

  • A running record

    The channel becomes a simple log of invoices received.

How it works

What happens, step by step

  1. Every 15 minutes, ClickRuntime looks for files added to your invoices bucket since the last check.

  2. Amazon Textract reads each invoice and finds the vendor, total and due date.

  3. If AI is available, it adds a short line describing what the invoice is for.

  4. It posts a summary of each invoice to #finance in Slack.

  5. It remembers the newest file it handled, so nothing is posted twice.

Before it runs live

  • Connect AWS
  • Connect Slack, then invite the app to the channel (type /invite @ClickRuntime there)

What you get

RunsEvery 15 minutes
Post a summary of each invoice uploaded to S3 to Slacktoday, 9:00Succeeded
Slack · #finance🧾 Acme Logistics: $412.50, due 2026-11-02 (invoices/acme-5530.pdf) – Two pallet deliveries to the Leeds warehouse.

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 Google Sheets
  • Combine it with other AWS and Slack 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.
summarise_invoices_uploaded_to_s3_in_slack.pyexample
import boto3
from clickruntime import on_trigger, credentials, http, state, notify, ai, report_fetched
REGION, BUCKET = "us-east-1", "northwind-files"

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"))

@on_trigger
def run(event):
    s3, since = aws("s3"), state.get("since") or ""
    objs = [o for o in s3.list_objects_v2(Bucket=BUCKET, Prefix="invoices/").get("Contents", []) if o["LastModified"].isoformat() > since]
    report_fetched(len(objs))
    if not objs:
        return {"summary": "Nothing new"}
    tx = aws("textract")
    for o in objs:
        doc = tx.analyze_expense(Document={"S3Object": {"Bucket": BUCKET, "Name": o["Key"]}})["ExpenseDocuments"][0]
        f = {x["Type"]["Text"]: x.get("ValueDetection", {}).get("Text", "") for x in doc["SummaryFields"]}
        items = ", ".join(i["ValueDetection"]["Text"] for g in doc.get("LineItemGroups", []) for li in g["LineItems"] for i in li["LineItemExpenseFields"] if i["Type"]["Text"] == "ITEM")
        text = f"🧾 {f.get('VENDOR_NAME', '?')}: {f.get('TOTAL', '?')}, due {f.get('DUE_DATE', 'not stated')} ({o['Key']})"
        try:
            text += "\n" + ai.generate(f"In under 15 words, what is this invoice for? {items[:1000]}", max_output_tokens=40).text
        except ai.AIError:
            pass
        notify.slack(text, channel="#finance")
    state.set("since", max(o["LastModified"].isoformat() for o in objs))
    return {"posted": len(objs)}

FAQ

Common questions

Does it work with scanned invoices?
Yes. Amazon Textract reads both digital and scanned invoices and receipts.
What AWS permissions does it need?
Listing and reading the bucket, and Textract's expense analysis, on an IAM user just for this automation.
What does AI add?
If AI is available, it adds a one-line description of what the invoice is for. Without it, the vendor, total and due date are still posted.
What permissions does it need?
s3:ListBucket/GetObject, textract:AnalyzeExpense; chat:write. 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 “Post a summary of each invoice uploaded to S3 to Slack” from your assistant

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