Ingest S3 documents into a Notion knowledge base
Every hour, pull freshly uploaded PDFs and Word docs from an S3 inbox, summarize them, and file each one as a structured Notion page.
Every hour, scan a designated Amazon S3 inbox bucket for newly arrived PDFs and Word documents, extract their contents, and file a structured summary as a new Notion page. Trigger on cron: run once an hour.
Let the user configure four things at setup: the S3 bucket name, the S3 key prefix that scopes the inbox (a folder path inside the bucket, empty string means the whole bucket), the destination Notion database ID where summaries land, and a maximum file size in megabytes so oversized uploads are skipped.
Also configure the Notion tracking database ID: a separate small database that records which files have already been processed. Each row is one processed file keyed by its S3 object key. This is how the workflow avoids re-summarizing anything.
On each run: call Amazon S3 List Objects (V2) with the configured bucket and prefix. Paginate through the continuation token until every candidate is enumerated. Filter the returned keys to those ending in .pdf, .docx, or .doc (case insensitive) and drop the rest.
For each candidate key: query the Notion tracking database, filtering by the file key property, to check whether it has already been processed. If a matching row exists, skip the file. Otherwise proceed.
Call Amazon S3 Head Object on the key to confirm size and content type without downloading. If the size exceeds the configured maximum, log a skip and move on. If the content type does not match a PDF or Word document, log a skip and move on.
Call Amazon S3 Get Object (Download) to pull the file bytes. Parse the document to plain text (PDF or Word). From the extracted text, identify the following: a title (fall back to the filename if none is clear), the author or client the document is about, the three to seven most important topics, any explicit dates mentioned (deadlines, meeting dates, effective dates), and any action items or next steps written in the document.
Then call Notion Create a Page in the destination database with these fields: Title (the extracted title), Source File (the S3 key), Uploaded At (the LastModified timestamp from List Objects), Topics (the extracted topics as a multi-select or comma-separated list depending on the property type), and Summary (a two to four paragraph write-up covering what the document is, who it involves, the important dates, and the action items). Include the raw extracted key points as bulleted blocks in the page body so the full detail is preserved.
Finally, create a row in the Notion tracking database recording the file key, the processed timestamp, and a link to the newly created summary page so the next run knows to skip it.
If any step fails for a specific file (parse error, oversized, wrong type, download failure), log the failure and continue with the next file. Do not abort the run because one document was bad.
Additional information
What does this prompt do?
- Watches an S3 bucket (or a specific folder inside it) every hour for newly uploaded PDFs and Word documents.
- Skips anything already handled by checking a Notion tracking database so nothing gets summarized twice.
- Reads each new document and pulls out the title, author or client, key topics, important dates, and action items.
- Files every document as a new page in your destination Notion database with fields for Title, Source File, Uploaded At, Topics, and Summary.
What do I need to use this?
- An AWS account with the bucket you use as a document inbox and a set of credentials that can read from it
- A Notion workspace with a destination database for the summaries and a small tracking database, both shared with your Notion connection
- The bucket name, the folder path you want watched, and the two Notion database IDs handy when you set it up
How can I customize it?
- Point it at a specific folder inside the bucket instead of the whole thing so it only watches one team's uploads.
- Raise or lower the file size cap so oversized documents are skipped instead of parsed.
- Rename or add fields on the Notion page (Owner, Client, Priority) to match how your team already tracks documents.
Frequently asked questions
What file types does it handle?
Will it re-summarize a file if I upload a new version with the same name?
Can I point it at a folder inside a bucket instead of the whole bucket?
What happens if someone uploads a very large document?
Do I need to build the Notion database first?
Related templates
Turn your S3 uploads into a searchable Notion library.
Every PDF or Word doc you drop into the inbox becomes a structured Notion page your team can search, filter, and share.