New to Kestra?
Use blueprints to kickstart your first workflows.
List objects in an Amazon S3 bucket by prefix and process each file in parallel with Kestra using a dynamic ForEach loop and event triggers.
List objects stored in an Amazon S3 bucket under a given prefix and fan out over every returned file in parallel. This blueprint solves a common S3 data engineering problem: you have a folder of objects (logs, exports, CSVs, partitioned data) and you need to iterate over each one to validate, transform, or route it, without writing brittle glue code. Kestra reads the live S3 listing at runtime and spawns one task run per object, so the loop always matches what is actually in the bucket.
list_objects task (io.kestra.plugin.aws.s3.List) queries the bucket from the bucket input and filters to the prefix powerplant/, returning the matching object metadata.print_objects task (io.kestra.plugin.core.log.Log) logs the full list of objects found, giving you a quick audit of what was discovered.map_over_s3_objects task (io.kestra.plugin.core.flow.ForEach) iterates over outputs.list_objects.objects with concurrencyLimit: 0, running all items in parallel.filename task logs each object's key and size by parsing taskrun.value with the json() function.S3 stores your objects but does not orchestrate work over them. Kestra adds event triggers (for example, run on a schedule or when new objects arrive), automatic retries on transient AWS errors, full execution lineage and logs, and a declarative YAML definition you can version control. The dynamic ForEach fan-out and per-task concurrency control fill the gap that a bucket alone cannot: turning a static object listing into governed, observable, parallel processing.
AWS_ACCESS_KEY_ID: AWS access key with S3 read permissions.AWS_SECRET_ACCESS_KEY: AWS secret access key.AWS_DEFAULT_REGION: AWS region of the bucket (for example, us-east-1).bucket input to your bucket name (default declarative-data-orchestration).prefix on list_objects to match your folder.filename log with a real per-object task: download, transform, copy, or load into a warehouse.concurrencyLimit to cap parallelism against AWS rate limits.