New to Kestra?
Use blueprints to kickstart your first workflows.
Build an event-driven pipeline that polls an Amazon SQS queue and runs a Kestra flow on every new message, with retries, lineage, and declarative YAML.
id: react-to-sqs-trigger
namespace: company.team
tasks:
- id: print_message
type: io.kestra.plugin.scripts.shell.Commands
taskRunner:
type: io.kestra.plugin.core.runner.Process
commands:
- cat "{{ trigger.uri }}"
triggers:
- id: sqs
type: io.kestra.plugin.aws.sqs.Trigger
accessKeyId: "{{ secret('AWS_ACCESS_KEY_ID') }}"
secretKeyId: "{{ secret('AWS_SECRET_ACCESS_KEY') }}"
region: "{{ secret('AWS_DEFAULT_REGION') }}"
queueUrl: https://sqs.eu-central-1.amazonaws.com/123456789/kestra
maxRecords: 1
Turn Amazon SQS into an event source for your data and automation pipelines. This blueprint polls an existing SQS queue and launches a Kestra flow execution every time a new message arrives, so downstream processing starts the moment work is queued instead of waiting on a fixed schedule. It is a practical pattern for fan-out processing, decoupled microservices, and reacting to events emitted by other AWS services through SQS.
io.kestra.plugin.aws.sqs.Trigger continuously polls the queue at queueUrl using AWS credentials supplied via accessKeyId, secretKeyId, and region.maxRecords is set to 1, so the flow fires once per message and processes them one at a time.{{ trigger.uri }}.print_message task (io.kestra.plugin.scripts.shell.Commands) runs cat "{{ trigger.uri }}" on the io.kestra.plugin.core.runner.Process runner to read and print that message payload.cat task.SQS delivers messages but does not run your pipeline, handle retries on downstream steps, or give you visibility into what happened after a message was consumed. Kestra fills that gap: the event trigger starts a fully observable execution per message, tasks can declare retries and error handling, every run is captured for lineage and replay, and the whole pipeline stays as version-controlled declarative YAML.
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_DEFAULT_REGIONAWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_DEFAULT_REGION as Kestra secrets.queueUrl value with the URL of your own SQS queue.print_message task for tasks that parse, validate, and route the payload.maxRecords to batch multiple messages per execution.retry and error tasks to make downstream processing resilient.