kestra-io/kestra · error · IllegalStateException
Cannot execute an invalid flow: {}
Error message
Cannot execute an invalid flow: {} What it means
Error "Cannot execute an invalid flow: {}" thrown in kestra-io/kestra.
Source
Thrown at core/src/main/java/io/kestra/core/runners/ExecutableUtils.java:201
currentFlow.getId()
)
.orElseThrow(() ->
{
String msg = "Unable to find flow '" + subflowNamespace + "'.'" + subflowId + "' with revision '" + subflowRevision.orElse(0) + "'";
runContext.logger().error(msg);
return new IllegalStateException(msg);
});
if (flow.isDisabled()) {
String msg = "Cannot execute a flow which is disabled";
runContext.logger().error(msg);
throw new IllegalStateException(msg);
}
if (flow instanceof FlowWithException fwe) {
String msg = "Cannot execute an invalid flow: " + fwe.getException();
runContext.logger().error(msg);
throw new IllegalStateException(msg);
}
List<Label> newLabels = inheritLabels ? new ArrayList<>(filterLabels(currentExecution.getLabels(), flow)) : new ArrayList<>(systemLabels(currentExecution));
if (labels != null) {
labels.forEach(throwConsumer(label -> newLabels.add(new Label(runContext.render(label.key()), runContext.render(label.value())))));
}
var variables = ImmutableMap.<String, Object> builder().putAll(
Map.of(
"executionId", currentExecution.getId(),
"namespace", currentFlow.getNamespace(),
"flowId", currentFlow.getId(),
"flowRevision", currentFlow.getRevision(),
"taskRunId", currentTaskRun.getId(),
"taskId", currentTaskRun.getTaskId()
)
);
if (currentTaskRun.getValue() != null) {View on GitHub (pinned to 823fada927)
Solutions
- Fix the validation errors reported on the flow (shown in the message or via flow validation), then execute it again.
- Run 'kestra flow validate' or check the UI validation panel to list the flow's violations.
When it happens
Trigger: Thrown at core/src/main/java/io/kestra/core/runners/ExecutableUtils.java:201 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of kestra-io/kestra@823fada927 (2026-08-14).
Data as JSON: /api/errors/6c978faacc676134.
Report an issue: GitHub.