{"record":{"id":"059803abdb522c3d","repo":"flowable/flowable-engine","slug":"variable-name-is-required-059803","errorCode":null,"errorMessage":"Variable name is required.","messagePattern":"Variable name is required\\.","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceCollectionResource.java","lineNumber":354,"sourceCode":"        if (paramsSet > 1) {\n            throw new FlowableIllegalArgumentException(\"Only one of processDefinitionId, processDefinitionKey or message should be set.\");\n        }\n\n        if (request.isTenantSet()) {\n            // Tenant-id can only be used with either key or message\n            if (request.getProcessDefinitionId() != null) {\n                throw new FlowableIllegalArgumentException(\"TenantId can only be used with either processDefinitionKey or message.\");\n            }\n        }\n        \n        Map<String, Object> startVariables = null;\n        Map<String, Object> transientVariables = null;\n        Map<String, Object> startFormVariables = null;\n        if (request.getStartFormVariables() != null && !request.getStartFormVariables().isEmpty()) {\n            startFormVariables = new HashMap<>();\n            for (RestVariable variable : request.getStartFormVariables()) {\n                if (variable.getName() == null) {\n                    throw new FlowableIllegalArgumentException(\"Variable name is required.\");\n                }\n                startFormVariables.put(variable.getName(), restResponseFactory.getVariableValue(variable));\n            }\n        }\n\n        if (request.getVariables() != null && !request.getVariables().isEmpty()) {\n            startVariables = new HashMap<>();\n            for (RestVariable variable : request.getVariables()) {\n                if (variable.getName() == null) {\n                    throw new FlowableIllegalArgumentException(\"Variable name is required.\");\n                }\n                startVariables.put(variable.getName(), restResponseFactory.getVariableValue(variable));\n            }\n        }\n\n        if (request.getTransientVariables() != null && !request.getTransientVariables().isEmpty()) {\n            transientVariables = new HashMap<>();\n            for (RestVariable variable : request.getTransientVariables()) {","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceCollectionResource.java#L336-L372","documentation":"FlowableIllegalArgumentException thrown by createProcessInstance when a RestVariable in the startFormVariables array has a null name. Start form variables are keyed by their name, so an anonymous entry cannot be applied to the form and the whole start request is rejected before the process instance is created. Each start form variable must carry a non-null name.","triggerScenarios":"POST /runtime/process-instances with startFormVariables containing an entry like {\"type\":\"string\",\"value\":\"x\"} (no name), typically when the array is built programmatically.","commonSituations":"Mapping form data where the key lives outside the object (e.g. [{value:...}] instead of a name/value map), serializers dropping null/empty name fields, UI code appending blank form rows that get submitted.","solutions":["Ensure every entry in startFormVariables has a non-null, non-empty 'name' field","Filter out blank/unnamed entries client-side before submitting","Build the array from a name->value map so names are always present","Validate the payload shape before the REST call"],"exampleFix":"// before\n\"startFormVariables\":[{\"type\":\"string\",\"value\":\"Acme\"}]\n// after\n\"startFormVariables\":[{\"name\":\"customer\",\"type\":\"string\",\"value\":\"Acme\"}]","handlingStrategy":"validation","validationCode":"for (const v of req.startFormVariables ?? []) {\n  if (v.name == null || v.name === '') throw new Error('Every startFormVariables entry needs a non-empty name');\n}","typeGuard":"function allFormVarsNamed(vars) {\n  return (vars ?? []).every(v => typeof v?.name === 'string' && v.name.length > 0);\n}","tryCatchPattern":"try { await startProcessInstance(req); } catch (e) { if (e.status === 400 && /Variable name is required/.test(e.message)) { req.startFormVariables = req.startFormVariables.filter(v => v.name); } throw e; }","preventionTips":["Build startFormVariables from a name->value map instead of arrays of loose objects","Filter out blank form rows before submission","Validate each entry has name, type, and value before the call"],"tags":["rest","validation","missing-field","flowable"],"backgroundTag":"missing-required-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}