Alibaba Cloud Trigger

Alibaba Cloud Trigger

Certified

Trigger a flow on MNS queue messages

Polls an MNS queue on an interval and starts one execution per poll that received messages. The messages are stored in an ION file available as trigger.uri, and their number as trigger.count. Messages are deleted once the file is stored, before the scheduler saves the execution, so a failure in between loses them: set autoDelete: false to keep them in the queue until they become visible again. Use RealtimeTrigger for one execution per message.

yaml
type: io.kestra.plugin.alibaba.mns.Trigger

Process up to 100 queued orders every 30 seconds

yaml
id: mns_on_message
namespace: company.team

triggers:
  - id: on_message
    type: io.kestra.plugin.alibaba.mns.Trigger
    accessKeyId: "{{ secret('ALIBABA_ACCESS_KEY_ID') }}"
    accessKeySecret: "{{ secret('ALIBABA_ACCESS_KEY_SECRET') }}"
    region: cn-hangzhou
    accountId: "{{ secret('ALIBABA_ACCOUNT_ID') }}"
    queue: orders
    interval: PT30S
    maxRecords: 100

tasks:
  - id: handle_messages
    type: io.kestra.plugin.core.log.Log
    message: "Received {{ trigger.count }} messages"
Properties

AccessKey ID

The AccessKey ID used to authenticate against Alibaba Cloud.

AccessKey secret

The AccessKey secret paired with the AccessKey ID.

Queue

The name of the MNS queue.

Account ID

The Alibaba Cloud account ID, used to derive the default endpoint https://<accountId>.mns.<region>.aliyuncs.com. Not needed when endpointOverride is set.

Defaultfalse

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

Defaulttrue

Auto-delete

Delete messages from the queue once they are handed to Kestra: Trigger deletes them once the ION file is stored, RealtimeTrigger once Kestra has taken them and requests more messages. When false, they become visible again after the queue's visibility timeout.

Endpoint override

Custom http or https endpoint URL. When set, it takes precedence over the endpoint derived from region.

DefaultPT1M
Formatduration

Interval between polls

DefaultPT20S

Max duration

Stop a poll after this duration elapses, 20 seconds by default. Keep it below the queue's visibility timeout (30 seconds by default), otherwise messages received early in the poll may be delivered again.

Default1000

Max records

Stop a poll after consuming this many messages, at least 1, 1000 by default.

Region

The Alibaba Cloud region ID, for example cn-hangzhou. The service endpoint is derived from it unless endpointOverride is set.

Security token

Optional Security Token Service (STS) token, required when using temporary credentials.

DefaultSTRING
Possible Values
STRINGJSON

Serde type

STRING keeps message bodies as text, JSON parses them. A body that is not valid JSON is kept as a string and logged.

SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTED

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

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.

Number of messages consumed

Formaturi

URI of the ION file holding the messages in internal storage, unset when no message was received