
InfluxDB FluxTrigger
CertifiedTrigger flow when Flux query returns rows
InfluxDB FluxTrigger
Trigger flow when Flux query returns rows
Polls a Flux query at a fixed interval (default 60 seconds) and starts a flow when at least one row is returned; fetchType mirrors FluxQuery output handling.
type: io.kestra.plugin.influxdb.FluxTriggerExamples
Wait for an InfluxDB Flux query to return results, and then iterate through rows.
id: influxdb_trigger
namespace: company.team
tasks:
- id: each
type: io.kestra.plugin.core.flow.ForEach
values: "{{ trigger.rows }}"
tasks:
- id: return
type: io.kestra.plugin.core.debug.Return
format: "{{ fromJson(taskrun.value) }}"
triggers:
- id: watch
type: io.kestra.plugin.influxdb.FluxTrigger
interval: "PT5M"
connection:
url: "{{ secret('INFLUXDB_URL') }}"
token: "{{ secret('INFLUXDB_TOKEN') }}"
org: "{{ secret('INFLUXDB_ORG') }}"
query: |
from(bucket: "mybucket")
|> range(start: -1h)
|> filter(fn: (r) => r._measurement == "cpu")
|> filter(fn: (r) => r._field == "usage_system")
|> filter(fn: (r) => r._value > 80.0)
Properties
allowConcurrent Non-dynamicboolean
falseSpecifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.
bucket string
Bucket to query
connection Non-dynamic
Connection to the InfluxDB instance
io.kestra.plugin.influxdb.InfluxDBConnection
InfluxDB token
The authentication token for InfluxDB
InfluxDB server URL
The URL of the InfluxDB server
PT10SConnection timeout.
Connection establishment timeout (ISO-8601 duration, e.g. PT10S). Default is 10 seconds.
PT10SRead timeout.
Maximum time to wait for response bytes (including initial response) (ISO-8601 duration, e.g. PT10S). Default is 10 seconds.
fetchType string
NONESTOREFETCHFETCH_ONENONEHow to fetch the query result
interval Non-dynamicstring
PT1MdurationInterval between polling.
The interval between 2 different polls of schedule, this can avoid to overload the remote system with too many calls. For most of the triggers that depend on external systems, a minimal interval must be at least PT30S. See ISO_8601 Durations for more information of available interval values.
org string
Organization to query
query string
Flux query to execute on each poll
stopAfter Non-dynamicarray
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
row object
First fetched row
Only populated when fetchType=FETCH_ONE
rows array
Fetched rows
Only populated when fetchType=FETCH
size integer
Number of rows returned
total integer
Total rows without pagination
uri string
uriURI of stored data
Only populated when fetchType=STORE