Ruby ScriptTrigger

Ruby ScriptTrigger

Certified

Trigger a flow when a Ruby script matches a condition

Polls by running a Ruby script and starts the flow when its output matches the condition.

yaml
type: io.kestra.plugin.scripts.ruby.ScriptTrigger

Trigger when the script fails with exit code 1.

yaml
id: ruby_script_trigger
namespace: company.team

triggers:
  - id: script_failure
    type: io.kestra.plugin.scripts.ruby.ScriptTrigger
    interval: PT10S
    exitCondition: "exit 1"
    edge: true
    script: |
      raise "boom"

tasks:
  - id: log
    type: io.kestra.plugin.core.log.Log
    message: "Triggered 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-ruby --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

Condition to match

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 and failure logs.

Inline Ruby script

Multi-line script executed on each poll.

Defaultfalse

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

Defaultruby

Container image for script execution

Image used by the Script task to run the inline Ruby script; defaults to 'ruby'.

Defaulttrue

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

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.

Script exit code

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

Formatdate-time

Poll timestamp

Timestamp when this trigger evaluation occurred.

Script vars

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