conductor-oss/conductor · error · NonTransientException

Unable to validate variables payload size of workflow: %s

Error message

Unable to validate variables payload size of workflow: %s

What it means

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.

Source

Thrown at core/src/main/java/com/netflix/conductor/core/execution/tasks/SetVariable.java:79

        try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
            this.objectMapper.writeValue(byteArrayOutputStream, variables);
            byte[] payloadBytes = byteArrayOutputStream.toByteArray();
            long payloadSize = payloadBytes.length;

            if (payloadSize > maxThreshold * 1024) {
                String errorMsg =
                        String.format(
                                "The variables payload size: %d of workflow: %s is greater than the permissible limit: %d kilobytes",
                                payloadSize, workflowId, maxThreshold);
                LOGGER.error(errorMsg);
                task.setReasonForIncompletion(errorMsg);
                return false;
            }
            return true;
        } catch (IOException e) {
            LOGGER.error(
                    "Unable to validate variables payload size of workflow: {}", workflowId, e);
            throw new NonTransientException(
                    "Unable to validate variables payload size of workflow: " + workflowId, e);
        }
    }

    @Override
    public boolean execute(WorkflowModel workflow, TaskModel task, WorkflowExecutor provider) {
        Map<String, Object> variables = workflow.getVariables();
        Map<String, Object> input = task.getInputData();
        String taskId = task.getTaskId();
        ArrayList<String> newKeys;
        Map<String, Object> previousValues;

        if (input != null && input.size() > 0) {
            newKeys = new ArrayList<>();
            previousValues = new HashMap<>();
            input.keySet()
                    .forEach(
                            key -> {

View on GitHub (pinned to cf7c3e4a8a)

Solutions

  1. 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).
  2. Ensure all values set as workflow variables are plain JSON-serializable types (Map, List, String, Number, Boolean).
  3. If a complex object must be stored, convert it to a Map or JSON string before assigning it as a variable.
  4. Register a custom Jackson serializer module if a specific domain type needs to be stored as a variable.

Example fix

// before — storing a raw object that can't be serialized
{"someVar": "${taskRef.output.nonSerializableObject}"}
// after — extract only the serializable fields
{"someVar": "${taskRef.output.serializableField}"}
Defensive patterns

Strategy: validation

Validate before calling

// Before setting a variable, verify the value is JSON-serializable
private boolean isSerializable(Object value, ObjectMapper om) {
    try {
        om.writeValueAsBytes(value);
        return true;
    } catch (Exception e) {
        return false;
    }
}

for (Map.Entry<String, Object> entry : input.entrySet()) {
    if (!isSerializable(entry.getValue(), objectMapper)) {
        LOGGER.warn("Skipping non-serializable variable: {}", entry.getKey());
        continue;
    }
    variables.put(entry.getKey(), entry.getValue());
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of conductor-oss/conductor@cf7c3e4a8a (2026-08-14). Data as JSON: /api/errors/c369657e0baf8963. Report an issue: GitHub.