{"record":{"id":"0f24acfa7bec1dd5","repo":"kestra-io/kestra","slug":"invalid-inputs-for-subflow-s-s-s","errorCode":null,"errorMessage":"Invalid inputs for subflow '%s'.'%s': %s","messagePattern":"Invalid inputs for subflow '(.+?)'\\.'(.+?)': (.+?)","errorType":"exception","errorClass":"PebbleException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/io/kestra/core/runners/pebble/functions/SubflowFunction.java","lineNumber":179,"sourceCode":"                );\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) {\n                throw new PebbleException(e, \"Failed to run subflow '\" + namespace + \"'.'\" + id + \"': \" + e.getMessage(), lineNumber, self.getName());\n            }\n\n            State.Type state = terminated.getState().getCurrent();\n            if (state != State.Type.SUCCESS && state != State.Type.WARNING) {\n                throw new PebbleException(\n                    null, \"Subflow '\" + namespace + \"'.'\" + id + \"' ended in state \" + state\n                        + \" (execution \" + terminated.getId() + \").\",\n                    lineNumber, self.getName()\n                );\n            }\n","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/kestra-io/kestra/blob/823fada9274c4f9c251ea0a516460a4f7d958032/core/src/main/java/io/kestra/core/runners/pebble/functions/SubflowFunction.java#L161-L197","documentation":"After resolving the target flow, the subflow() function creates a new execution via Execution.newExecution(), passing the caller's inputs to readExecutionInputs(). If the provided inputs do not match the target flow's declared input schema (missing required inputs, wrong types, validation failures), the input-reading phase throws and the function wraps it as a PebbleException with the original error message.","triggerScenarios":"Calling subflow(namespace='ns', id='child', inputs={'param': 123}) when the target flow expects 'param' to be a STRING. Omitting a required input. Passing an input name that does not exist on the target flow. Passing invalid enum or date values.","commonSituations":"The target flow's input schema changed (new required input added, type changed) but the caller's subflow() inputs were not updated. Mismatch between the input names in the caller and the target. Type coercion issues (number vs string).","solutions":["Check the target flow's declared inputs and ensure every required input is provided with the correct type.","Align input names exactly (case-sensitive) between the subflow() call and the target flow's inputs block.","If the target flow changed, update the subflow() inputs map to match the new schema.","Use the Kestra execute form or API to verify the target flow's input requirements."],"exampleFix":"# before — missing required input 'env' and wrong type for 'count'\n{{ subflow(namespace='company.team', id='child', inputs={'count': '5'}) }}\n# target flow child.yaml expects:\n# inputs:\n#   - id: env\n#     type: STRING\n#     required: true\n#   - id: count\n#     type: INT\n\n# after — all required inputs provided with correct types\n{{ subflow(namespace='company.team', id='child', inputs={'env': 'prod', 'count': 5}) }}","handlingStrategy":"validation","validationCode":"# Before calling subflow(), ensure the inputs map matches the target flow's input schema.\n# Check the target flow's inputs block and provide:\n#   - All required inputs with correct types\n#   - Correct field names (case-sensitive)\n# Example verification in flow YAML:\n# {{ subflow(namespace='ns', id='child', inputs={'env': 'prod', 'count': 5}) }}\n# Verify against child.yaml:\n# inputs:\n#   - id: env\n#     type: STRING\n#     required: true\n#   - id: count\n#     type: INT","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the target flow's input schema documented alongside the subflow() call.","Update subflow() inputs whenever the target flow's input schema changes.","Match input names exactly (case-sensitive) and types precisely.","Test the subflow() call in the Kestra execute form before relying on it."],"tags":["pebble","subflow","inputs","validation","schema-mismatch"],"backgroundTag":null,"analyzedSha":"823fada9274c4f9c251ea0a516460a4f7d958032","analyzedAt":"2026-08-14T06:15:17.947Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}