{"record":{"id":"c369657e0baf8963","repo":"conductor-oss/conductor","slug":"unable-to-validate-variables-payload-size-of-workf","errorCode":null,"errorMessage":"Unable to validate variables payload size of workflow: %s","messagePattern":"Unable to validate variables payload size of workflow: (.+?)","errorType":"exception","errorClass":"NonTransientException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/com/netflix/conductor/core/execution/tasks/SetVariable.java","lineNumber":79,"sourceCode":"        try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {\n            this.objectMapper.writeValue(byteArrayOutputStream, variables);\n            byte[] payloadBytes = byteArrayOutputStream.toByteArray();\n            long payloadSize = payloadBytes.length;\n\n            if (payloadSize > maxThreshold * 1024) {\n                String errorMsg =\n                        String.format(\n                                \"The variables payload size: %d of workflow: %s is greater than the permissible limit: %d kilobytes\",\n                                payloadSize, workflowId, maxThreshold);\n                LOGGER.error(errorMsg);\n                task.setReasonForIncompletion(errorMsg);\n                return false;\n            }\n            return true;\n        } catch (IOException e) {\n            LOGGER.error(\n                    \"Unable to validate variables payload size of workflow: {}\", workflowId, e);\n            throw new NonTransientException(\n                    \"Unable to validate variables payload size of workflow: \" + workflowId, e);\n        }\n    }\n\n    @Override\n    public boolean execute(WorkflowModel workflow, TaskModel task, WorkflowExecutor provider) {\n        Map<String, Object> variables = workflow.getVariables();\n        Map<String, Object> input = task.getInputData();\n        String taskId = task.getTaskId();\n        ArrayList<String> newKeys;\n        Map<String, Object> previousValues;\n\n        if (input != null && input.size() > 0) {\n            newKeys = new ArrayList<>();\n            previousValues = new HashMap<>();\n            input.keySet()\n                    .forEach(\n                            key -> {","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/core/src/main/java/com/netflix/conductor/core/execution/tasks/SetVariable.java#L61-L97","documentation":"Thrown by the SetVariable task's validateVariablesSize method when ObjectMapper fails to serialize the workflow variables map to bytes (IOException). This is a NonTransientException, indicating a persistent data-level failure — the variables map contains objects that cannot be JSON-serialized, so retrying would produce the same error.","triggerScenarios":"A SET_VARIABLE task attempts to set a workflow variable whose value is an object Jackson cannot serialize — e.g. a raw non-serializable Java object, a circular reference, or a type without a registered serializer that was injected into the variables map through dynamic input resolution.","commonSituations":"Passing a complex non-serializable object as a workflow variable. A ${...} expression that resolves to a type the ObjectMapper does not know how to handle. A custom Jackson configuration issue or missing Jackson module for a particular data type stored in variables.","solutions":["Inspect the SET_VARIABLE task's input data to identify which variable value triggered the serialization failure (check the server log for the underlying IOException cause).","Ensure all values set as workflow variables are plain JSON-serializable types (Map, List, String, Number, Boolean).","If a complex object must be stored, convert it to a Map or JSON string before assigning it as a variable.","Register a custom Jackson serializer module if a specific domain type needs to be stored as a variable."],"exampleFix":"// before — storing a raw object that can't be serialized\n{\"someVar\": \"${taskRef.output.nonSerializableObject}\"}\n// after — extract only the serializable fields\n{\"someVar\": \"${taskRef.output.serializableField}\"}","handlingStrategy":"validation","validationCode":"// Before setting a variable, verify the value is JSON-serializable\nprivate boolean isSerializable(Object value, ObjectMapper om) {\n    try {\n        om.writeValueAsBytes(value);\n        return true;\n    } catch (Exception e) {\n        return false;\n    }\n}\n\nfor (Map.Entry<String, Object> entry : input.entrySet()) {\n    if (!isSerializable(entry.getValue(), objectMapper)) {\n        LOGGER.warn(\"Skipping non-serializable variable: {}\", entry.getKey());\n        continue;\n    }\n    variables.put(entry.getKey(), entry.getValue());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only store plain JSON types (Map, List, String, Number, Boolean) as workflow variables.","Avoid passing raw domain objects through SET_VARIABLE — extract scalar fields first.","Test variable serialization in integration tests with representative data."],"tags":["set-variable","serialization","non-transient","workflow-variables"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}