
Deno ScriptTrigger
CertifiedTrigger on Deno script condition
Deno ScriptTrigger
Trigger on Deno script condition
Polls by running an inline Deno script in a container (default image denoland/deno) and emits when exitCondition matches. Edge mode is intended to emit only on transitions but currently does not survive a poll-to-poll worker dispatch (see the edge property). Polls every 60s by default. Accepts 'exit N' or a regex (fallback substring) matched against emitted vars; a failed run has no vars, so only 'exit N' can match a failure.
type: io.kestra.plugin.scripts.deno.ScriptTriggerExamples
Trigger when the script fails with an implicit error (exit 1).
id: script_trigger
namespace: company.team
triggers:
- id: script_failure
type: io.kestra.plugin.scripts.deno.ScriptTrigger
interval: PT60S
exitCondition: "exit 1"
edge: true
containerImage: denoland/deno
script: |
Deno.exit(1);
tasks:
- id: log
type: io.kestra.plugin.core.log.Log
message: "Triggered with exitCode={{ trigger.exitCode }} (condition={{ trigger.condition }})"
Poll an HTTP endpoint, which needs the --allow-net permission.
id: script_trigger_http
namespace: company.team
triggers:
- id: endpoint_down
type: io.kestra.plugin.scripts.deno.ScriptTrigger
interval: PT60S
exitCondition: "exit 1"
permissions:
- --allow-net
script: |
const res = await fetch("https://example.com/health");
Deno.exit(res.ok ? 0 : 1);
tasks:
- id: log
type: io.kestra.plugin.core.log.Log
message: "Endpoint check failed with exitCode={{ trigger.exitCode }}"
Installation
Our standard Docker images already include this plugin. If you use a -slim image or another setup, install it with the following command:
kestractl plugins get io.kestra.plugin:plugin-script-deno --compatible-for $KESTRA_VERSION For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.
For Kestra CLI, replace LATEST with a specific version or version range to pin the plugin version.
Properties
exitCondition *string
Condition to match
Rendered condition evaluated after each execution; the trigger emits only when it matches. 'exit N' compares the exit code, otherwise the string is used as a regex (or substring fallback) against emitted vars (from ::{"outputs": ...}::). On a failed run no vars are available to match against, so only an 'exit N' condition can match a failure.
script *string
Inline Deno script
Multi-line script executed on each poll, with the same semantics as the Deno Script task.
allowConcurrent boolean
falseSpecifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.
containerImage string
denoland/denoContainer image for script execution
Image used by the Script task to run the inline Deno script; defaults to 'denoland/deno'. Provide an image that includes the Deno runtime.
edge booleanstring
trueEdge trigger mode
If true (default), the trigger emits only on a transition from 'not matching' to 'matching' (anti-spam). The previous result is kept in the namespace KV store, keyed by flow and trigger id. If false, the trigger emits on every poll where the condition matches.
interval string
PT1MdurationCheck interval
Interval between polls; default PT60S. The scheduler uses this to schedule the next evaluation.
permissions array
["--allow-env","--allow-read","--allow-write"]Deno permission flags
Flags passed to deno run for the polled script, e.g. --allow-net to let it reach an HTTP endpoint.
Same property and default as the Script task: --allow-env, --allow-read and --allow-write. Deno's sandbox denies network access unless --allow-net is granted, so a polling script that calls fetch needs it here. Set to an empty list to run with no permissions at all.
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
condition string
Rendered condition
Rendered value of the exitCondition property for this poll.
exitCode integer
Script exit code
Exit code returned by the Deno process (may be null if not available).
timestamp string
date-timeTimestamp of the event that fired the trigger
vars object
Script vars
Vars produced by the task (e.g. via ::{"outputs": {...}}:: convention). This is the main structured way to evaluate non-exit conditions on successful runs.