{"record":{"id":"aa7dc94a161cb839","repo":"conductor-oss/conductor","slug":"subworkflow-name-is-null-and-no-workflowdefinition","errorCode":null,"errorMessage":"SubWorkflow name is null and no workflowDefinition supplied","messagePattern":"SubWorkflow name is null and no workflowDefinition supplied","errorType":"exception","errorClass":"NonTransientException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/com/netflix/conductor/core/execution/tasks/SubWorkflow.java","lineNumber":100,"sourceCode":"            resolvedVersion = version == 0 ? null : version;\n        }\n\n        WorkflowDef workflowDefinition = null;\n        String name;\n        if (input.get(\"subWorkflowDefinition\") != null) {\n            // Convert the runtime Map to a WorkflowDef. This supports both the static\n            // embedded-object form and the dynamic ${expr}-resolved form.\n            workflowDefinition =\n                    objectMapper.convertValue(\n                            input.get(\"subWorkflowDefinition\"), WorkflowDef.class);\n            name = workflowDefinition.getName();\n        } else {\n            name =\n                    input.get(\"subWorkflowName\") != null\n                            ? input.get(\"subWorkflowName\").toString()\n                            : null;\n            if (name == null) {\n                throw new NonTransientException(\n                        \"SubWorkflow name is null and no workflowDefinition supplied\");\n            }\n        }\n\n        Map<String, String> taskToDomain = workflow.getTaskToDomain();\n        if (input.get(\"subWorkflowTaskToDomain\") instanceof Map) {\n            taskToDomain = (Map<String, String>) input.get(\"subWorkflowTaskToDomain\");\n        }\n\n        var wfInput = (Map<String, Object>) input.get(\"workflowInput\");\n        if (wfInput == null || wfInput.isEmpty()) {\n            wfInput = input;\n        }\n\n        // Mark dynamically-generated sub-workflows so they can be identified downstream.\n        if (workflowDefinition != null) {\n            wfInput = new HashMap<>(wfInput);\n            Map<String, Object> systemMetadata =","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/core/src/main/java/com/netflix/conductor/core/execution/tasks/SubWorkflow.java#L82-L118","documentation":"Thrown by the SubWorkflow task's start method when neither 'subWorkflowDefinition' (an inline WorkflowDef object) nor 'subWorkflowName' (a string referencing a registered workflow) is provided in the task input. The SUB_WORKFLOW task requires at least one of these to know which workflow to launch as a child.","triggerScenarios":"Starting a SUB_WORKFLOW task whose inputParameters contain neither 'subWorkflowDefinition' nor 'subWorkflowName'. Also when subWorkflowName is present but resolves to null via a ${...} expression that evaluates to null.","commonSituations":"Misconfigured SUB_WORKFLOW task in the workflow definition — missing the subWorkflowParam entirely. A dynamic ${subWorkflowName} expression that resolves to null at runtime because the referenced value is absent. Copy-paste error where subWorkflowParam was renamed or removed.","solutions":["Add a 'subWorkflowName' field to the SUB_WORKFLOW task's subWorkflowParam pointing to a registered workflow definition name.","Alternatively, provide a complete 'subWorkflowDefinition' inline object with at least a 'name' field.","If using a dynamic ${...} expression for the sub-workflow name, verify the referenced source resolves to a non-null string at runtime.","Check the workflow definition JSON in the Conductor UI to confirm the subWorkflowParam block is present and correctly populated."],"exampleFix":"// before\n{\n  \"name\": \"call_child\",\n  \"taskReferenceName\": \"call_child_ref\",\n  \"type\": \"SUB_WORKFLOW\",\n  \"subWorkflowParam\": {\n    \"name\": null\n  }\n}\n// after\n{\n  \"name\": \"call_child\",\n  \"taskReferenceName\": \"call_child_ref\",\n  \"type\": \"SUB_WORKFLOW\",\n  \"subWorkflowParam\": {\n    \"name\": \"child_workflow\",\n    \"version\": 1\n  }\n}","handlingStrategy":"validation","validationCode":"// Validate SUB_WORKFLOW task config before workflow registration\nfor (WorkflowTask wt : workflowDef.collectTasks()) {\n    if (\"SUB_WORKFLOW\".equals(wt.getType())) {\n        SubWorkflowParams params = wt.getSubWorkflowParam();\n        if (params == null\n                || (params.getName() == null && params.getWorkflowDefinition() == null)) {\n            throw new IllegalArgumentException(\n                \"SUB_WORKFLOW task '\" + wt.getName()\n                        + \"' must have subWorkflowName or subWorkflowDefinition\");\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always populate subWorkflowParam.name with a registered workflow name in every SUB_WORKFLOW task.","Use a workflow-definition linter to catch missing subWorkflowParam before registration.","When using dynamic sub-workflow names, ensure the referenced input key always resolves to a non-null value."],"tags":["sub-workflow","workflow-definition","input-validation","non-transient"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}