{"record":{"id":"602bdf1e2d29ecf3","repo":"flowable/flowable-engine","slug":"transient-variable-name-is-required-602bdf","errorCode":null,"errorMessage":"Transient variable name is required","messagePattern":"Transient variable name is required","errorType":"http","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/task/TaskResource.java","lineNumber":220,"sourceCode":"        if (actionRequest.getVariables() != null) {\n            for (RestVariable var : actionRequest.getVariables()) {\n                if (var.getName() == null) {\n                    throw new FlowableIllegalArgumentException(\"Variable name is required\");\n                }\n\n                Object actualVariableValue = restResponseFactory.getVariableValue(var);\n                if (var.getVariableScope() != null && RestVariable.RestVariableScope.LOCAL.equals(var.getVariableScope())) {\n                    taskCompletionBuilder.variableLocal(var.getName(), actualVariableValue);\n                } else {\n                    taskCompletionBuilder.variable(var.getName(), actualVariableValue);\n                }\n            }\n        }\n\n        if (actionRequest.getTransientVariables() != null) {\n            for (RestVariable var : actionRequest.getTransientVariables()) {\n                if (var.getName() == null) {\n                    throw new FlowableIllegalArgumentException(\"Transient variable name is required\");\n                }\n\n                Object actualVariableValue = restResponseFactory.getVariableValue(var);\n                if (var.getVariableScope() != null && RestVariable.RestVariableScope.LOCAL.equals(var.getVariableScope())) {\n                    taskCompletionBuilder.transientVariableLocal(var.getName(), actualVariableValue);\n                } else {\n                    taskCompletionBuilder.transientVariable(var.getName(), actualVariableValue);\n                }\n            }\n\n        }\n\n        taskCompletionBuilder\n                .taskId(task.getId())\n                .formDefinitionId(actionRequest.getFormDefinitionId())\n                .outcome(actionRequest.getOutcome())\n                .complete();\n    }","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/task/TaskResource.java#L202-L238","documentation":"FlowableIllegalArgumentException thrown by TaskResource.completeTask when an entry in the request's transientVariables array has no name. Transient variables are passed to the task completion builder and require an identifier. The REST API validates this before touching the engine.","triggerScenarios":"POST /runtime/tasks/{taskId}/action with action=complete and transientVariables containing an element whose name field is null/absent.","commonSituations":"Hand-built JSON payloads where a variable name key is misspelled (e.g. 'variable' instead of 'name'); dynamic payload construction that skips the name for one entry.","solutions":["Set the 'name' property on every object in the transientVariables array","Validate the request payload client-side before calling the task action endpoint","If a variable is not meant to be transient, move it to the 'variables' array instead"],"exampleFix":"// before\n{\"action\":\"complete\",\"transientVariables\":[{\"value\":\"x\"}]}\n// after\n{\"action\":\"complete\",\"transientVariables\":[{\"name\":\"myVar\",\"value\":\"x\"}]}","handlingStrategy":"validation","validationCode":"for (RestVariable v : actionRequest.getTransientVariables()) {\n  if (v.getName() == null || v.getName().isEmpty()) throw new IllegalArgumentException(\"transient variable missing name\");\n}","typeGuard":"if (var != null && var.getName() != null && !var.getName().isEmpty()) { /* safe to send */ }","tryCatchPattern":"try { completeTask(...) } catch (FlowableIllegalArgumentException e) { log.error(\"Payload invalid: {}\", e.getMessage()); }","preventionTips":["Map variables through a builder that enforces name on construction","Unit-test request payloads for required fields","Never hand-write variable JSON without a schema check"],"tags":["rest-api","validation","variables"],"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-18T11:17:12.947Z"}