{"record":{"id":"9e44a4d783447217","repo":"kestra-io/kestra","slug":"cannot-run-the-disabled-flow-s-s","errorCode":null,"errorMessage":"Cannot run the disabled flow '%s'.'%s'.","messagePattern":"Cannot run the disabled flow '(.+?)'\\.'(.+?)'\\.","errorType":"exception","errorClass":"PebbleException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/io/kestra/core/runners/pebble/functions/SubflowFunction.java","lineNumber":167,"sourceCode":"            // if the caller flow may reference the target, so may subflow(). Note this is reachable at execute-form\n            // render time, not only at execution time, so anyone able to open the form triggers this resolution.\n            // resolved for runtime so a governance rejection surfaces as a FlowWithException here, rather than\n            // becoming a created-then-failed execution\n            FlowWithSource targetFlow = flowMetaStore.get()\n                .findByIdFromTaskForRuntime(tenantId, namespace, id, revision, tenantId, callerNamespace, callerId)\n                .orElseThrow(\n                    () -> new PebbleException(\n                        null, \"Unable to find flow '\" + namespace + \"'.'\" + id + \"'\"\n                            + revision.map(r -> \" with revision \" + r).orElse(\"\") + \".\",\n                        lineNumber, self.getName()\n                    )\n                );\n\n            if (targetFlow instanceof FlowWithException fwe) {\n                throw new PebbleException(null, \"Cannot run the invalid flow '\" + namespace + \"'.'\" + id + \"': \" + fwe.getException(), lineNumber, self.getName());\n            }\n            if (targetFlow.isDisabled()) {\n                throw new PebbleException(null, \"Cannot run the disabled flow '\" + namespace + \"'.'\" + id + \"'.\", lineNumber, self.getName());\n            }\n\n            Execution execution;\n            try {\n                execution = Execution.newExecution(\n                    targetFlow,\n                    (f, e) -> flowInputOutput.get().readExecutionInputs(f, e, inputs),\n                    labels,\n                    Optional.empty()\n                );\n            } catch (Exception e) {\n                throw new PebbleException(e, \"Invalid inputs for subflow '\" + namespace + \"'.'\" + id + \"': \" + e.getMessage(), lineNumber, self.getName());\n            }\n\n            Execution terminated;\n            try {\n                terminated = executionService.get().runAndWait(execution, targetFlow, timeout);\n            } catch (Exception e) {","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/kestra-io/kestra/blob/823fada9274c4f9c251ea0a516460a4f7d958032/core/src/main/java/io/kestra/core/runners/pebble/functions/SubflowFunction.java#L149-L185","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"# before — target flow has 'disabled: true'\n# target flow child.yaml:\nid: child\ndisabled: true\n# caller uses:\n{{ subflow(namespace='company.team', id='child') }}\n\n# after — re-enable the target flow\n# target flow child.yaml:\nid: child\ndisabled: false","handlingStrategy":"validation","validationCode":"# Before calling subflow() on a target flow, verify it is not disabled:\n# Check via the Kestra UI or API:\n#   GET /api/v1/flows/{namespace}/{id} — check the 'disabled' field.\n# If disabled, either re-enable it or remove the subflow() call.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["pebble","subflow","disabled-flow","flow-state"],"backgroundTag":null,"analyzedSha":"823fada9274c4f9c251ea0a516460a4f7d958032","analyzedAt":"2026-08-14T06:15:17.947Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}