New to Kestra?
Use blueprints to kickstart your first workflows.
Trigger on new Amazon S3 objects, route JSON files to AWS Lambda and other files to an SNS topic, then notify Slack. Event-driven file routing in Kestra.
Watch an Amazon S3 bucket and turn every new object into routed work. This event-driven blueprint detects files as they land in S3, inspects each object key, and fans them out by type: JSON payloads go to an AWS Lambda function for processing, while all other files are announced on an SNS topic. A Slack message closes the loop so your team sees the outcome in real time. It solves the common problem of reacting to data drops, uploads, and integration handoffs without standing up bespoke event plumbing or polling scripts.
io.kestra.plugin.aws.s3.Trigger polls the incoming/ prefix in the configured bucket every PT1M and fires once per new object (maxKeys: 1, action: NONE so files stay in place).io.kestra.plugin.core.flow.If task evaluates the object key with a jq expression that checks whether it ends in .json.io.kestra.plugin.aws.lambda.Invoke calls your Lambda (functionArn) with the object key and uri as the payload.io.kestra.plugin.aws.sns.Publish posts a message to your SNS topic (topicArn) announcing the new object.io.kestra.plugin.slack.notifications.SlackIncomingWebhook posts the routing outcome to Slack.S3 event notifications can fire Lambda or SNS directly, but that native wiring stops at the first hop: it cannot branch on content, chain downstream steps, retry a failed Lambda call, or give you a unified execution history. Kestra adds an event Trigger, declarative YAML branching, automatic retries, full run lineage across Lambda and SNS, and one place to observe every object that flowed through. You get the routing logic and the audit trail without bolting EventBridge rules and dead-letter queues together by hand.
AWS_ACCESS_KEY_ID: AWS access key with S3, Lambda, and SNS permissions.AWS_SECRET_ACCESS_KEY: matching AWS secret key.AWS_DEFAULT_REGION: AWS region for the resources.SLACK_WEBHOOK_URL: Slack incoming webhook URL.object_landed trigger at your bucket and prefix.lambda_function_arn and sns_topic_arn as inputs..json file and a non-JSON file into the prefix to see both branches route.If branches (or a Switch) to fan out across additional file types or prefixes.action to MOVE or DELETE to avoid reprocessing handled objects.