New to Kestra?
Use blueprints to kickstart your first workflows.
Trigger a Kestra workflow on new S3 file detection, then process the file with Python in Docker and archive it for an event-driven data pipeline.
Turn an Amazon S3 bucket into an event source for your data pipelines. This blueprint watches an S3 prefix and, the moment a new object arrives, runs a Python script against it inside a containerized environment, then archives the processed file. It removes the need for cron-based polling jobs, manual downloads, or glue code to wire S3 events to your processing logic, giving you an event-driven file ingestion pipeline that scales from a single CSV to a steady stream of inbound data.
io.kestra.plugin.aws.s3.Trigger trigger polls the bucket defined in vars.bucket (in vars.region) every second (interval: PT1S), looking only at files (filter: FILES) under the prefix: inbound/.maxKeys: 1).action: MOVE) to the archive/ key in the same bucket, so each file is processed exactly once and the inbound prefix stays clean.process_data task of type io.kestra.plugin.scripts.python.Commands runs on a Docker taskRunner, reads the triggered object into an inputFile named input.csv via {{ read(trigger.objects[0].uri) }}, installs pandas, and executes python process_data.py from your namespace files.data.csv as an outputFile, captured in Kestra internal storage for downstream tasks or inspection.namespaceFiles (your process_data.py).S3 has no native scheduler that can run and observe arbitrary Python with retries, logging, and lineage. Kestra closes that gap: the event trigger reacts to file arrival, executions are fully traced, tasks can retry on failure, and the entire pipeline is declarative YAML you can version and review. You get observability over every file, every run, and every output, instead of opaque, fire-and-forget functions.
inbound/ and archive/ prefixes.process_data.py script uploaded as a namespace file.AWS_ACCESS_KEY_ID: the AWS access key id used by the S3 trigger.AWS_SECRET_KEY_ID: the AWS secret key used by the S3 trigger.AWS_ACCESS_KEY_ID and AWS_SECRET_KEY_ID secrets in your Kestra instance.vars.bucket and vars.region to match your S3 bucket.process_data.py namespace file that reads input.csv and writes data.csv.inbound/ prefix to trigger an execution.prefix or filter to watch different folders or object types.data.csv into a warehouse such as Snowflake or BigQuery.maxKeys and a loop.