
Alibaba Cloud Trigger
CertifiedTrigger on MaxCompute query results
Alibaba Cloud Trigger
Trigger on MaxCompute query results
Periodically executes a MaxCompute SQL query and triggers a flow execution when rows are returned. Supports persisting watermarks in the namespace KV store to prevent duplicate processing.
type: io.kestra.plugin.alibaba.maxcompute.TriggerExamples
Poll for new records in MaxCompute
id: maxcompute_listen
namespace: company.team
tasks:
- id: log_rows
type: io.kestra.plugin.core.log.Log
message: "Found {{ trigger.size }} new rows"
triggers:
- id: watch_orders
type: io.kestra.plugin.alibaba.maxcompute.Trigger
accessKeyId: "{{ secret('ALIBABA_ACCESS_KEY_ID') }}"
accessKeySecret: "{{ secret('ALIBABA_ACCESS_KEY_SECRET') }}"
region: cn-shanghai
project: analytics
sql: "SELECT * FROM orders WHERE id > '{{ trigger.watermark }}' ORDER BY id ASC LIMIT 50"
watermarkField: id
initialWatermark: "0"
interval: PT5M
fetchType: FETCH
Properties
accessKeyId *string
The AccessKey ID
accessKeySecret *string
The AccessKey Secret
project *string
Project
MaxCompute project name.
sql *string
SQL query
Query executed on each poll. May reference {{ trigger.watermark }}, escaped for a single-quoted SQL literal. Use an appropriate initialWatermark and filter strictly greater than the watermark.
watermarkField *string
Watermark column
Required monotonically increasing column. Numeric values compare numerically; ISO instants compare chronologically; other strings compare lexicographically. Order ascending and avoid splitting equal watermark values across batches.
allowConcurrent boolean
falseSpecifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.
endpointOverride string
Endpoint override
fetchType string
FETCHSTOREFETCHFETCH_ONENONEResult handling mode
FETCH or STORE; defaults to FETCH.
initialWatermark string
Initial watermark
Value exposed before the first poll; defaults to empty string. For numeric IDs, set a lower bound such as 0.
interval string
PT1MdurationPolling interval
Interval between query runs; defaults to 60 seconds.
region string
Region
Region used to derive the endpoint when endpointOverride is absent.
securityToken string
Security Token
stopAfter array
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDList of execution states after which a trigger should be stopped (a.k.a. disabled).
tunnelEndpoint string
Tunnel endpoint override
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
instanceId string
The MaxCompute instance ID
row object
Map containing the first row
Only populated if fetchType is FETCH_ONE
rows array
List containing fetched rows
Only populated if fetchType is FETCH
size integer
The total number of rows returned
uri string
uriThe URI of the stored result in internal storage
Only populated if fetchType is STORE