Node CommandsTrigger

Node CommandsTrigger

Certified

Trigger a flow when Node.js commands match a condition

Polls and triggers a flow by running Node.js commands within a script container.

yaml
type: io.kestra.plugin.scripts.node.CommandsTrigger

Trigger when Node command fails.

yaml
id: node_commands_trigger
namespace: company.team

triggers:
  - id: on_fail
    type: io.kestra.plugin.scripts.node.CommandsTrigger
    interval: PT5S
    exitCondition: "exit 1"
    commands:
      - node -e "throw new Error('boom')"

tasks:
  - id: log
    type: io.kestra.plugin.core.log.Log
    message: "Triggered with exitCode={{ trigger.exitCode }}"
Properties
SubTypestring

Node commands to execute

Commands executed on each poll.

Condition to match

Condition evaluated after execution.

Supported forms:

  • 'exit N'
  • regex / substring matched against vars + logs
Defaultfalse

Specifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.

Defaultnode

Docker image used to execute the commands

Container image used by the underlying Commands task to run Node.js commands. Defaults to 'node'.

Defaulttrue

Edge trigger mode

If true, the trigger emits only on a transition from 'not matching' to 'matching' (anti-spam). If false, the trigger emits on every poll where the condition matches.

DefaultPT1M
Formatduration

Check interval

Interval between polling evaluations.

SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTED

List of execution states after which a trigger should be stopped (a.k.a. disabled).

Defaulttrue

A 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.

Rendered condition

Rendered value of the exitCondition property for this poll.

Commands exit code

Exit code returned by the process (may be null if not available).

Formatdate-time

Timestamp of the event that fired the trigger

Commands vars

Vars produced by the task (e.g. via ::{"outputs": {...}}:: convention).