
.NET (C#) CommandsTrigger
CertifiedTrigger a flow when C# commands match a condition
.NET (C#) CommandsTrigger
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.
type: io.kestra.plugin.scripts.csharp.CommandsTriggerExamples
Trigger when commands fail with an implicit error (exit 1).
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
commands *array
.NET commands to execute
Commands executed on each poll (same semantics as the .NET Commands task).
allowConcurrent boolean
falseSpecifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.
containerImage string
mcr.microsoft.com/dotnet/sdk:10.0Container image for task execution
Container image used to execute the underlying .NET task. Defaults to 'mcr.microsoft.com/dotnet/sdk: 10.0'.
edge booleanstring
trueEdge 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.
exitCondition string
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.
interval string
PT1MdurationCheck interval
Interval between polling evaluations.
stopAfter array
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDList of execution states after which a trigger should be stopped (a.k.a. disabled).
targetOS string
AUTOLINUXWINDOWSAUTOTarget operating system
Operating system used by the underlying .NET task.
when string
trueA 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.