Toggle a trigger: enable or disable it.
yaml
type: "io.kestra.plugin.core.trigger.Toggle"
Examples
Toggle a trigger on flow input.
yaml
id: trigger_toggle
namespace: company.team
inputs:
- id: toggle
type: BOOL
defaults: true
tasks:
- id: if
type: io.kestra.plugin.core.flow.If
condition: "{{inputs.toggle}}"
then:
- id: enable
type: io.kestra.plugin.core.trigger.Toggle
trigger: schedule
enabled: true
else:
- id: disable
type: io.kestra.plugin.core.trigger.Toggle
trigger: schedule
enabled: false
- id: log
type: io.kestra.plugin.core.log.Log
message: Hello World
triggers:
- id: schedule
type: io.kestra.plugin.core.trigger.Schedule
cron: "* * * * *"
Properties
trigger *Requiredstring
The identifier of the trigger to toggle
enabled Non-dynamicboolean
Default
false
Whether to enable or disable the trigger
flowId string
The flow identifier of the trigger to toggle
If not set, the current flow identifier will be used.
namespace string
The namespace of the flow of the trigger to toggle
If not set, the current flow namespace will be used.