AWS RealtimeTrigger

AWS RealtimeTrigger

Certified

Trigger on SQS messages (realtime)

Long-polls SQS and emits an execution per message as they arrive. Auto-delete controls deletion; use batch Trigger for grouped processing.

yaml
type: io.kestra.plugin.aws.sqs.RealtimeTrigger

Consume a message from an SQS queue in real-time

yaml
id: sqs
namespace: company.team

tasks:
- id: log
  type: io.kestra.plugin.core.log.Log
  message: "{{ trigger.data }}"

triggers:
- id: realtime_trigger
  type: io.kestra.plugin.aws.sqs.RealtimeTrigger
  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/000000000000/test-queue

Use AWS SQS Realtime Trigger to push events into DynamoDB

yaml
id: sqs_realtime_trigger
namespace: company.team

tasks:
  - id: insert_into_dynamoDB
    type: io.kestra.plugin.aws.dynamodb.PutItem
    accessKeyId: "{{ secret('AWS_ACCESS_KEY_ID') }}"
    secretKeyId: "{{ secret('AWS_SECRET_KEY_ID') }}"
    region: eu-central-1
    tableName: orders
    item:
      order_id: "{{ trigger.data | jq('.order_id') | first }}"
      customer_name: "{{ trigger.data | jq('.customer_name') | first }}"
      customer_email: "{{ trigger.data | jq('.customer_email') | first }}"
      product_id: "{{ trigger.data | jq('.product_id') | first }}"
      price: "{{ trigger.data | jq('.price') | first }}"
      quantity: "{{ trigger.data | jq('.quantity') | first }}"
      total: "{{ trigger.data | jq('.total') | first }}"

triggers:
  - id: realtime_trigger
    type: io.kestra.plugin.aws.sqs.RealtimeTrigger
    accessKeyId: "{{ secret('AWS_ACCESS_KEY_ID') }}"
    secretKeyId: "{{ secret('AWS_SECRET_KEY_ID') }}"
    region: eu-central-1
    queueUrl: https://sqs.eu-central-1.amazonaws.com/000000000000/orders
    serdeType: JSON
Properties

The SQS queue URL. The queue must already exist

Access Key Id in order to connect to AWS

If no credentials are defined, we will use the default credentials provider chain to fetch credentials.

Defaultfalse

Specifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.

Defaulttrue

Delete consumed messages automatically

When set to true (default), the message is automatically deleted from SQS after being consumed. Set to false if you want to handle deletion manually.

Default3

The maximum number of attempts used by the SQS client's retry strategy

DefaultPT5S

The amount of time to wait when acquiring a connection from the pool before giving up and timing out

The endpoint with which the SDK should communicate

This property allows you to use a different S3 compatible storage backend.

Default50

Maximum number of allowed concurrent requests

For HTTP/1.1 this is the same as max connections. For HTTP/2 the number of connections that will be used depends on the max streams allowed per connection. If the maximum number of concurrent requests is exceeded they may be queued in the HTTP client (see maxPendingConnectionAcquires) and can cause increased latencies. If the client is overloaded enough such that the pending connection queue fills up, subsequent requests may be rejected or time out (see connectionAcquisitionTimeout).

Default5

The maximum number of messages returned from request made to SQS

Increasing this value can reduce the number of requests made to SQS. Amazon SQS never returns more messages than this value (fewer messages might be returned). Valid values: 1 to 10. Setting this value to 1 would increase your AWS cost and latency because it requires more API requests to SQS. Note that Realtime Triggers always create one execution per message, regardless of the value of this property.

AWS region with which the SDK should communicate

Secret Key Id in order to connect to AWS

If no credentials are defined, we will use the default credentials provider chain to fetch credentials.

DefaultSTRING
Possible Values
STRINGJSON

The serializer/deserializer to use

AWS session token, retrieved from an AWS token service, used for authenticating that this user has received temporary permissions to access a given resource

If no credentials are defined, we will use the default credentials provider chain to fetch credentials.

SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTED

List of execution states after which a trigger should be stopped (a.k.a. disabled).

The AWS STS endpoint with which the SDKClient should communicate

AWS STS Role

The Amazon Resource Name (ARN) of the role to assume. If set the task will use the StsAssumeRoleCredentialsProvider. If no credentials are defined, we will use the default credentials provider chain to fetch credentials.

AWS STS External Id

A unique identifier that might be required when you assume a role in another account. This property is only used when an stsRoleArn is defined.

DefaultPT15M

AWS STS Session duration

The duration of the role session (default: 15 minutes, i.e., PT15M). This property is only used when an stsRoleArn is defined.

AWS STS Session name

This property is only used when an stsRoleArn is defined.

Default30

Visibility timeout for consumed messages

When set, a received message stays hidden from other consumers for this amount of time (in seconds). The default value is 30 seconds.

DefaultPT20S

The duration for which the SQS client waits for a message

Defaulttrue

A condition that determines whether the trigger should run.

A Pebble expression evaluated at trigger time. The trigger fires only when the expression evaluates to a truthy value (true, a non-empty string, a non-zero number). Use this to gate trigger execution on dynamic runtime values such as execution labels, flow variables, or environment conditions.

The message data

Accepts a string (Pebble-templated, e.g. "{{ inputs.payload }}") or a structured value (map, list) that is serialized to JSON before sending. String values are rendered at runtime; non-string values are passed through Jackson.

The message deduplication ID

The message delay in seconds

The message group ID