Skip to content

Introduce ScriptTrigger & CommandsTrigger for the Lua plugin #428

Description

@fdelbrayelle

Context

Part of #313. plugin-scripts wants every submodule to expose a ScriptTrigger and a CommandsTrigger, so a flow can be triggered whenever the underlying script/commands execution completes, with an exit condition deciding whether the trigger fires based on the result (e.g. only on failure).

plugin-script-lua is missing both. Existing implementations in plugin-script-go, plugin-script-node, plugin-script-python, plugin-script-ruby, and plugin-script-shell (same package as the task classes, no nested subpackage) can be used as a reference.

What to implement

1. ScriptTrigger

  • Triggers when io.kestra.plugin.scripts.lua.Script execution completes.
  • Emits an event containing: command executed, arguments, env (if available), exit code, stdout/stderr (if capture enabled), and contextual metadata (execution id, namespace, flow id).

2. CommandsTrigger

  • Triggers when io.kestra.plugin.scripts.lua.Commands execution completes.
  • Emits an event containing: commands executed (or the matched one), exit code(s), stdout/stderr if available, and contextual metadata (execution id, namespace, flow id).

Trigger configuration requirements

Each trigger should accept at least:

  • commandPattern (string / regex / glob)
  • argumentsPattern (optional)
  • exitCondition (string expression — can match on exit code, output, or a literal condition)

Example YAML

triggers:
  - id: on_lua_fail
    type: io.kestra.plugin.scripts.lua.ScriptTrigger
    commandPattern: ".*"
    exitCondition: "exitCode != 0"

triggers:
  - id: on_lua_commands
    type: io.kestra.plugin.scripts.lua.CommandsTrigger
    commandPattern: ".*"
    exitCondition: "exitCode == 0"

Activity

  1. added
    kind/cooldown
    area/plugin
    good first issue
    on Sep 15, 2026
  2. locked and limited conversation to collaborators on Sep 15, 2026
  3. removed
    kind/cooldown
    on Sep 15, 2026
  4. added
    kind/cooldown
    on Sep 15, 2026
  5. unlocked this conversation on Sep 15, 2026
  6. removed
    kind/cooldown
    on Sep 15, 2026
  7. Abhishek84313 commented on Sep 19, 2026

    @Abhishek84313
    Contributor

    @fdelbrayelle I would like to work on this feature can you assign me

  8. fdelbrayelle commented on Sep 20, 2026

    @fdelbrayelle
    MemberAuthor

    Thank you 👋 Yes sure, go for it, I'll assign you the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/plugingood first issue

Fields

Stage

Done

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions