Skip to content

Every 5 minutes

Hear about new files in an S3 folder

You get an email listing files newly added under a folder in your bucket.

Runs
Every 5 minutes
Apps
AWS
AI
Not needed
Access
s3:ListBucket

Send this to your assistant

Create a ClickRuntime automation: every 5 minutes, check the uploads/ folder in my S3 bucket and email me the names and sizes of any new files.

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

Partners, customers and internal systems drop files into S3 all day: a vendor uploads an invoice batch, a customer sends a data export, a nightly job writes a report. Nobody on the receiving side is watching the bucket, so files sit unprocessed. The finance analyst finds out on Thursday that Monday's invoices arrived, and the customer who uploaded a data export wonders for three days why nothing happened.

Every five minutes, ClickRuntime lists objects under the bucket prefix you chose and compares their last-modified times with the latest it stored. Any object newer than that is reported in an email with its name, size and time, and the stored value moves forward so each file is reported once.

It is a lightweight alternative to setting up S3 event notifications, Lambda functions and SNS topics for a simple alert.

What you get out of it

  • Deliveries are handled the day they arrive

    An email within minutes of an upload lets the receiver start processing immediately. Invoices get paid on time and customer files are acknowledged before anyone asks. Invoices get paid on time and customers hear back before they ask twice.

  • Missed uploads can be spotted by absence

    If you expect a file every morning and no email arrives, you know the sender failed. Silence becomes a signal, which is hard to get from a bucket nobody opens.

  • No AWS plumbing to build

    S3 event notifications need SNS topics, queues or Lambda functions with their own permissions. A polling check needs only read access, so non-engineers can have notifications without a project. Non-engineers can have notifications without waiting for a project.

  • Names and sizes catch obvious errors

    An email that shows a file of zero bytes or an unexpected name reveals a bad upload instantly. You can ask the sender to try again before downstream steps fail.

  • Each prefix can have its own recipient

    Different prefixes for different partners can notify different people. The right team hears about its own files without everyone getting every message. The right team hears about its own deliveries only, with no noise from others.

How it works

What happens, step by step

  1. Every five minutes ClickRuntime looks at the files under the folder you chose in your S3 bucket.

  2. It keeps only files added since its last check, so nothing is reported twice.

  3. You get an email listing each new file and its size.

Before it runs live

  • Connect AWS

What you get

RunsEvery 5 minutes
Hear about new files in an S3 foldertoday, 9:00Succeeded
Email · New uploadsuploads/northwind-logo.png (184 KB) uploads/acme-brief.pdf (1,220 KB)

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.
get_notified_of_new_files_in_a_bucket.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-uploads"

@on_trigger
def run(event):
    last = state.get("last_modified") or ""
    objects = aws("s3").list_objects_v2(Bucket=BUCKET, Prefix="uploads/").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}
    lines = [f"{o['Key']} ({o['Size'] / 1024:,.0f} KB)" for o in new]
    notify.email_me(f"{len(new)} new files in {BUCKET}/uploads", "\n".join(lines))
    state.set("last_modified", max(o["LastModified"].isoformat() for o in new))
    return {"new": len(new)}

FAQ

Common questions

Will it report files that were already there?
No. On the first run it records the newest last-modified time it sees and treats everything before it as old. Only objects modified after that moment are reported, so you do not get a flood of messages about historic files.
What if a file is overwritten with the same name?
Overwriting changes the last-modified time, so the object is reported again as a new version. If you want to track only new names and ignore updates, ask your AI assistant to remember object keys in addition to timestamps.
Can it watch a folder inside a bucket?
Yes. S3 uses prefixes to represent folders, and the check can be limited to one prefix such as uploads/partner-a/. That keeps the email about the files you care about and ignores other traffic in the same bucket.
What permissions does it need?
s3:ListBucket. 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 “Hear about new files in an S3 folder” from your assistant

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