
S2 Trigger
CertifiedStart a Flow when new S2 records arrive
S2 Trigger
Start a Flow when new S2 records arrive
Polls an S2 stream at a fixed interval and starts one Execution with the new records. The last processed sequence position is saved in the namespace KV store to prevent records from being delivered twice. Use the RealtimeTrigger to start one Execution per record as soon as it arrives.
type: io.kestra.plugin.s2.TriggerExamples
Start a flow when new records are appended to an S2 stream.
id: s2_polling_trigger
namespace: company.team
tasks:
- id: log
type: io.kestra.plugin.core.log.Log
message: "Received {{ trigger.size }} new records"
triggers:
- id: poll
type: io.kestra.plugin.s2.Trigger
accessToken: "{{ secret('S2_ACCESS_TOKEN') }}"
basin: my-basin
stream: orders
interval: PT30S
maxRecords: 100
Properties
accessToken *string
S2 access token
Access token used to authenticate with S2
basin *string
S2 basin
S2 basin containing the stream
stream *string
Stream
Name of the S2 stream to poll.
allowConcurrent boolean
falseSpecifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.
basinEndpoint string
https://{basin}.b.s2.dev/v1Basin endpoint
S2 basin API endpoint. The {basin} placeholder is replaced by the basin name. When the endpoint has no placeholder, the basin is sent in the S2-Basin header, which is how a custom endpoint such as s2-lite is addressed.
interval string
PT1MdurationInterval
Duration between polls for new records.
maxRecords integerstring
100Maximum records
Maximum number of records to process in one polling cycle, between 1 and 1000.
seqNum integerstring
Initial sequence number
Initial position: start from the first record whose sequence number is greater than or equal to this value. Only used until the trigger has delivered a record.
stopAfter array
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDList of execution states after which a trigger should be stopped (a.k.a. disabled).
tailOffset integerstring
Initial tail offset
Initial position: start this many records before the tail of the stream. Only used until the trigger has delivered a record.
timestamp integerstring
Initial timestamp
Initial position: start from the first record whose timestamp is greater than or equal to this value. Only used until the trigger has delivered a record.
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
records array
Records
The records returned during this polling cycle.
io.kestra.plugin.s2.Read-Record
Record body
Body of the S2 record.
Record headers
Name value header pairs of the S2 record.
Sequence number
Sequence number assigned by S2.
Timestamp
Timestamp of the record.
size integer
Size
Number of records returned.
tail integer
Tail
Sequence number that will be assigned to the next record on the stream.