
Core Plugins and tasks Trigger
CertifiedPoll an HTTP endpoint and trigger when a condition matches.
Core Plugins and tasks Trigger
Poll an HTTP endpoint and trigger when a condition matches.
Periodically calls uri (default GET every 60s), evaluates responseCondition against status/body/headers, and launches the flow when true. Supports request customization (method, params, headers, auth via options) and stopAfter states to disable once satisfied.
type: io.kestra.plugin.core.http.TriggerExamples
Send a Slack alert if the price is below a certain threshold. The flow will be triggered every 30 seconds until the condition is met. Then, the stopAfter property will disable the trigger to avoid unnecessary API calls and alerts.
id: http_price_alert
namespace: company.team
tasks:
- id: send_slack_alert
type: io.kestra.plugin.slack.SlackIncomingWebhook
url: "{{ secret('SLACK_WEBHOOK') }}"
payload: |
{
"channel": "#price-alerts",
"text": "The price is now: {{ json(trigger.body).price }}"
}
triggers:
- id: http
type: io.kestra.plugin.core.http.Trigger
uri: https://fakestoreapi.com/products/1
responseCondition: "{{ json(response.body).price <= 110 }}"
interval: PT30S
stopAfter:
- SUCCESS
Trigger a flow if an HTTP endpoint returns a status code equals to 200
id: http_trigger
namespace: company.team
tasks:
- id: log_response
type: io.kestra.plugin.core.log.Log
message: '{{ trigger.body }}'
triggers:
- id: http
type: io.kestra.plugin.core.http.Trigger
uri: https://api.chucknorris.io/jokes/random
responseCondition: "{{ response.statusCode == 200 }}"
stopAfter:
- SUCCESS
Properties
uri *Requiredstring
The fully-qualified URI that points to the HTTP destination
allowConcurrent Non-dynamicboolean
falseSpecifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.
body string
The full body as a string
contentType string
application/jsonThe request content type
encryptBody booleanstring
falseIf true, the HTTP response body will be automatically encrypted and decrypted in the outputs if encryption is configured.
When true, the encryptedBody output will be filled, otherwise the body output will be filled.
formData object
The form data to be send
headers object
The headers to pass to the request
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.
method string
GETThe HTTP method to use
options Non-dynamic
The HTTP request options
io.kestra.core.http.client.configurations.HttpConfiguration
falseIf true, allow a failed response code (response code >= 400)
List of response code allowed for this request
The authentication to use.
io.kestra.core.http.client.configurations.BasicAuthConfiguration
The password for HTTP basic authentication.
The username for HTTP basic authentication.
io.kestra.core.http.client.configurations.BearerAuthConfiguration
The token for bearer token authentication.
io.kestra.core.http.client.configurations.DigestAuthConfiguration
The password for HTTP Digest authentication.
The username for HTTP Digest authentication.
UTF-8The default charset for the request.
java.nio.charset.Charset
trueWhether to enable TCP Keep-Alive extended socket options (TCP_KEEPIDLE, TCP_KEEPINTERVAL, TCP_KEEPCOUNT).
Set to false when running on Windows workers, as these extended socket options are not supported by the Windows JDK and will cause connection failures.
trueWhether redirects should be followed automatically.
REQUEST_HEADERSREQUEST_BODYRESPONSE_HEADERSRESPONSE_BODYThe enabled log.
The proxy configuration.
io.kestra.core.http.client.configurations.ProxyConfiguration
The address of the proxy server.
The password for proxy authentication.
The port of the proxy server.
DIRECTDIRECTHTTPSOCKSThe type of proxy to use.
The username for proxy authentication.
The SSL request options
io.kestra.core.http.client.configurations.SslOptions
Whether to disable checking of the remote SSL certificate.
Only applies if no trust store is configured. Note: This makes the SSL connection insecure and should only be used for testing. If you are using a self-signed certificate, set up a trust store instead.
The timeout configuration.
io.kestra.core.http.client.configurations.TimeoutConfiguration
The time allowed to establish a connection to the server before failing.
PT5MThe time allowed for a read connection to remain idle before closing it.
params object
The query string parameter to use
Adds parameter to URI query. The parameter name and value are expected to be unescaped and may contain non ASCII characters.
The value can be a string or a list of strings.
This method will not override parameters already existing on uri and will add them as array.
responseCondition string
{{ response.statusCode < 400 }}The condition on the HTTP response to trigger a flow, which can be any expression that evaluates to a boolean value.
The condition will be evaluated after calling the HTTP endpoint; it can use the response itself to determine whether to start a flow or not. The following variables are available when evaluating the condition:
response.statusCode: the response HTTP status coderesponse.body: the response body as a stringresponse.headers: the response headers
Boolean coercion allows 0, -0, null and '' to evaluate to false, all other values will evaluate to true.
The condition will be evaluated before any 'generic trigger conditions' that can be configured via the conditions property.
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
body object
The body of the response
Kestra, by default, stores the task output using this property. However, if the encryptBody property is set to true, Kestra will instead encrypt the output and store it using the encryptedBody output property.
code integer
The status code of the response
encryptedBody string
The encrypted body of the response
If the encryptBody property is set to true, Kestra will automatically encrypt the output before storing it, and decrypt it when the output is retrieved in a downstream task.
formData object
The form data to be sent in the request body
When sending a file, you can pass a list of maps (i.e., a list of key-value pairs) with a key 'name' and value of the filename, as well as 'content' key with the file's content as value (e.g., passed from flow inputs or outputs from another task).
headers object
The headers of the response
uri string
uriThe URL of the current request