
Alibaba Cloud Trigger
CertifiedTrigger a flow on MNS queue messages
Alibaba Cloud Trigger
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.
type: io.kestra.plugin.alibaba.mns.TriggerExamples
Process up to 100 queued orders every 30 seconds
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
accessKeyId *string
AccessKey ID
The AccessKey ID used to authenticate against Alibaba Cloud.
accessKeySecret *string
AccessKey secret
The AccessKey secret paired with the AccessKey ID.
queue *string
Queue
The name of the MNS queue.
accountId string
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.
allowConcurrent boolean
falseSpecifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.
autoDelete booleanstring
trueAuto-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.
endpointOverride string
Endpoint override
Custom http or https endpoint URL. When set, it takes precedence over the endpoint derived from region.
interval string
PT1MdurationInterval between polls
maxDuration string
PT20SMax 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.
maxRecords integerstring
1000Max records
Stop a poll after consuming this many messages, at least 1, 1000 by default.
region string
Region
The Alibaba Cloud region ID, for example cn-hangzhou. The service endpoint is derived from it unless endpointOverride is set.
securityToken string
Security token
Optional Security Token Service (STS) token, required when using temporary credentials.
serdeType string
STRINGSTRINGJSONSerde type
STRING keeps message bodies as text, JSON parses them. A body that is not valid JSON is kept as a string and logged.
stopAfter array
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDList of execution states after which a trigger should be stopped (a.k.a. disabled).
when string
trueA 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.
Outputs
count integer
Number of messages consumed
uri string
uriURI of the ION file holding the messages in internal storage, unset when no message was received