.NET (C#) CommandsTrigger

.NET (C#) CommandsTrigger

Certified

Trigger a flow when C# commands match a condition

Polls by running .NET commands in a script container and emits when the configured exit condition matches.

Edge mode and condition evaluation are handled by the shared .NET trigger implementation.

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

Trigger when commands fail with an implicit error (exit 1).

yaml
id: commands_trigger
namespace: company.team

triggers:
  - id: commands_failure
    type: io.kestra.plugin.scripts.csharp.CommandsTrigger
    interval: PT60S
    exitCondition: "exit 1"
    edge: true
    containerImage: mcr.microsoft.com/dotnet/sdk:10.0
    commands:
      - dotnet run --project missing

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

.NET commands to execute

Commands executed on each poll (same semantics as the .NET Commands task).

Defaultfalse

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

Defaultmcr.microsoft.com/dotnet/sdk:10.0

Container image for task execution

Container image used to execute the underlying .NET task. Defaults to 'mcr.microsoft.com/dotnet/sdk: 10.0'.

Defaulttrue

Edge trigger mode

When true (default), emit only on a transition from not matching to matching. The previous result is stored in the namespace KV store using the flow and trigger identity.

When false, emit on every matching poll.

Condition to match

Condition evaluated after each polling execution.

Supported forms:

  • 'exit N' matches the task exit code.
  • Any other string is treated as a regex, with substring fallback, against values emitted by the task.

A failed task has no output vars, so only an 'exit N' condition can match a failure.

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

DefaultAUTO
Possible Values
LINUXWINDOWSAUTO

Target operating system

Operating system used by the underlying .NET task.

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.