
.NET (C#) ScriptTrigger
CertifiedTrigger a flow when an F# script matches a condition
.NET (C#) ScriptTrigger
Trigger a flow when an F# script matches a condition
Polls by running an inline F# script in a .NET SDK container and emits when the configured exit condition matches.
F# scripts use the .fsx format and are executed with dotnet fsi.
Edge mode and condition evaluation are handled by the shared .NET trigger implementation.
type: io.kestra.plugin.scripts.fsharp.ScriptTriggerExamples
Trigger when the F# script fails with exit code 1.
id: fsharp_script_trigger
namespace: company.team
triggers:
- id: fsharp_script_failure
type: io.kestra.plugin.scripts.fsharp.ScriptTrigger
interval: PT60S
exitCondition: "exit 1"
edge: true
containerImage: mcr.microsoft.com/dotnet/sdk:10.0
script: |
System.Environment.Exit(1)
tasks:
- id: log
type: io.kestra.plugin.core.log.Log
message: "Triggered with exitCode={{ trigger.exitCode }} (condition={{ trigger.condition }})"
Properties
script *string
Inline F# script
Multi-line F# script executed on each poll.
The script uses .fsx format and is executed with dotnet fsi.
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.