Skip to content

Introduce ScriptTrigger & CommandsTrigger for the PHP plugin #430

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-php 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.php.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.php.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_php_fail
    type: io.kestra.plugin.scripts.php.ScriptTrigger
    commandPattern: ".*"
    exitCondition: "exitCode != 0"

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

Activity

  1. added
    kind/cooldownGreat candidate for the cooldown period
    area/pluginPlugin-related issue or feature request
    good first issueGreat issue for new contributors
    on Sep 15, 2026
  2. locked and limited conversation to collaborators on Sep 15, 2026
  3. unlocked this conversation on Sep 15, 2026
  4. HarshXAI commented on Sep 30, 2026

    @HarshXAI
    Contributor

    I can add the PHP ScriptTrigger and CommandsTrigger.

    I’ll mirror the existing Go/Node/Python/Ruby/Shell trigger pattern in plugin-script-php: fire on Script/Commands completion, emit command/args/env/exit code/stdout-stderr (when captured) plus execution metadata, and wire the exit-condition filter the same way the other language plugins do.

    GFI-sized, following the current trigger layout — happy to open a focused PR.

  5. fdelbrayelle commented on Sep 30, 2026

    @fdelbrayelle
    MemberAuthor

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

  6. HarshXAI commented on Oct 2, 2026

    @HarshXAI
    Contributor

    Opened #457 for PHP ScriptTrigger and CommandsTrigger.

  7. fdelbrayelle commented on Oct 12, 2026

    @fdelbrayelle
    MemberAuthor

    Thanks @HarshXAI 🙏

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

Metadata

Metadata

Assignees

Labels

area/pluginPlugin-related issue or feature requestgood first issueGreat issue for new contributors

Fields

Stage

Done

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions