kestra-io/kestra · error · PebbleException
Cannot run the disabled flow '%s'.'%s'.
Error message
Cannot run the disabled flow '%s'.'%s'.
What it means
After resolving and validating the target flow, the subflow() function checks targetFlow.isDisabled(). A disabled flow exists and is valid, but has its 'disabled' property set to true, meaning it is intentionally suspended and should not be executed. The function refuses to run it to respect the flow owner's intent.
Source
Thrown at core/src/main/java/io/kestra/core/runners/pebble/functions/SubflowFunction.java:167
// if the caller flow may reference the target, so may subflow(). Note this is reachable at execute-form
// render time, not only at execution time, so anyone able to open the form triggers this resolution.
// resolved for runtime so a governance rejection surfaces as a FlowWithException here, rather than
// becoming a created-then-failed execution
FlowWithSource targetFlow = flowMetaStore.get()
.findByIdFromTaskForRuntime(tenantId, namespace, id, revision, tenantId, callerNamespace, callerId)
.orElseThrow(
() -> new PebbleException(
null, "Unable to find flow '" + namespace + "'.'" + id + "'"
+ revision.map(r -> " with revision " + r).orElse("") + ".",
lineNumber, self.getName()
)
);
if (targetFlow instanceof FlowWithException fwe) {
throw new PebbleException(null, "Cannot run the invalid flow '" + namespace + "'.'" + id + "': " + fwe.getException(), lineNumber, self.getName());
}
if (targetFlow.isDisabled()) {
throw new PebbleException(null, "Cannot run the disabled flow '" + namespace + "'.'" + id + "'.", lineNumber, self.getName());
}
Execution execution;
try {
execution = Execution.newExecution(
targetFlow,
(f, e) -> flowInputOutput.get().readExecutionInputs(f, e, inputs),
labels,
Optional.empty()
);
} catch (Exception e) {
throw new PebbleException(e, "Invalid inputs for subflow '" + namespace + "'.'" + id + "': " + e.getMessage(), lineNumber, self.getName());
}
Execution terminated;
try {
terminated = executionService.get().runAndWait(execution, targetFlow, timeout);
} catch (Exception e) {View on GitHub (pinned to 823fada927)
Solutions
- Re-enable the target flow in the Kestra UI or by setting 'disabled: false' in its YAML.
- If the flow is intentionally disabled, remove or conditionalize the subflow() call that references it.
- Communicate with the team that disabled the flow to coordinate re-enabling or updating callers.
Example fix
# before — target flow has 'disabled: true'
# target flow child.yaml:
id: child
disabled: true
# caller uses:
{{ subflow(namespace='company.team', id='child') }}
# after — re-enable the target flow
# target flow child.yaml:
id: child
disabled: false Defensive patterns
Strategy: validation
Validate before calling
# Before calling subflow() on a target flow, verify it is not disabled:
# Check via the Kestra UI or API:
# GET /api/v1/flows/{namespace}/{id} — check the 'disabled' field.
# If disabled, either re-enable it or remove the subflow() call. Prevention
- Maintain a registry of flows referenced by subflow() calls and check their enabled state.
- Coordinate disabling flows with all teams that reference them.
- When disabling a flow, notify owners of dependent subflow() calls.
- Use CI to verify that no subflow() target is in a disabled state before deployment.
When it happens
Trigger: Calling subflow(namespace='ns', id='paused_flow') where the target flow has 'disabled: true' in its YAML. The flow was disabled by an admin or via the Kestra UI's disable action.
Common situations: A flow was temporarily disabled for maintenance or decommissioning but other flows still reference it via subflow(). An environment-specific flow is disabled in one environment but the calling flow exists in all environments. A flow was disabled to stop a runaway schedule but subflow() callers were not updated.
Related errors
- The 'subflow' function can only be used at flow-input render
- The 'subflow' function expects the arguments 'namespace' and
- The 'subflow' function can only be used in a flow context (e
- The 'subflow' function exceeded the maximum nesting depth of
- Cannot run the invalid flow '%s'.'%s': %s
AI-assisted analysis of kestra-io/kestra@823fada927 (2026-08-14).
Data as JSON: /api/errors/9e44a4d783447217.
Report an issue: GitHub.