Disabled flag
The disabled
flag is a boolean property that lets you skip a flow, task, or trigger.
This is useful for debugging or testing parts of a flow without removing existing logic. Instead of deleting parts of your YAML, you can add the disabled
property.
Disabled flow
When a flow is disabled, it will not be executed β even if a trigger is set. If you have an active trigger on a disabled flow, it will be ignored. You donβt need to disable the trigger separately β it is ignored automatically. Setting a flow to disabled
effectively prevents any future executions of the flow until it is re-enabled.
Add the following flow, then attempt to run it and observe the scheduled executions:
id: disabled_flownamespace: company.teamdisabled: true
tasks: - id: hello type: io.kestra.plugin.core.log.Log message: Kestra team wishes you a great day! π
triggers: - id: fail_every_minute type: io.kestra.plugin.core.trigger.Schedule cron: "*/1 * * * *"
You will see that you cannot run the flow and that the trigger is ignored β no executions are created.
When executing a disabled flow from a subflow:
id: parent_runs_disabled_flownamespace: company.teamtasks: - id: disabled_subflow type: io.kestra.plugin.core.flow.Subflow flowId: disabled_flow namespace: company.team
When you execute the parent flow, it immediately fails with the error message: Cannot execute a flow which is disabled
.
Similarly, try running a disabled flow via an API call:
curl -X POST http://localhost:8080/api/v1/main/executions/trigger/example/parent_runs_disabled_flow
The API call itself is successful:
{"id":"5ScXvrnOkjfKIXqYylRYME","namespace":"example","flowId":"parent_runs_disabled_flow","flowRevision":1,"state":{"current":"CREATED","histories":[{"state":"CREATED","date":"2024-01-19T20:38:48.474047013Z"}],"duration":"PT0.011094958S","startDate":"2024-01-19T20:38:48.474047013Z"},"originalId":"5ScXvrnOkjfKIXqYylRYME"}%
That execution is immediately marked as failed with the error message: Cannot execute a flow which is disabled
.
Disabled trigger
When using a Schedule trigger, it is often useful to disable it temporarily. For example, you may want to disable a trigger while you are debugging a flow. You can do this by setting the disabled
flag to true
on the trigger:
id: myflownamespace: company.team
tasks: - id: hello type: io.kestra.plugin.core.log.Log message: hello from a scheduled flow
triggers: - id: daily type: io.kestra.plugin.core.trigger.Schedule cron: "0 9 * * *" disabled: true
You will see that no scheduled executions are created for this flow. Once you are done debugging, you can re-enable the trigger by setting the disabled
flag to false
or simply by removing the disabled
flag:
id: myflownamespace: company.team
tasks: - id: hello type: io.kestra.plugin.core.log.Log message: hello from a scheduled flow
triggers: - id: daily type: io.kestra.plugin.core.trigger.Schedule cron: "0 9 * * *"
Disabled task
Instead of disabling the entire flow or a trigger, you can also disable a single task. This is useful when you want to temporarily disable a single task without deleting it e.g., when troubleshooting a failure. You can do this by setting the disabled
flag to true
on the task:
id: myflownamespace: company.team
tasks: - id: enabled type: io.kestra.plugin.core.log.Log message: this task will run
- id: disabled type: io.kestra.plugin.core.debug.Return format: this task will be skipped disabled: true
You can see in the UI that disabled tasks are greyed out: