flowable/flowable-engine · error · FlowableEventJsonException

Error reading event json

Error message

Error reading event json

What it means

EventJsonConverter.convertToEventModel parses an event definition JSON string into an EventModel. Any exception during parsing/deserialization is wrapped as FlowableEventJsonException('Error reading event json') with the root cause attached. It signals malformed or unreadable event JSON.

Solutions

  1. Check the wrapped cause (e.getCause()) for the exact deserialization problem.
  2. Validate the event JSON structure (key, name, payload, correlationParameters) against the EventModel schema.
  3. Redeploy with a corrected event definition file; regenerate the JSON from the Flowable designer if possible.

Example fix

// before
EventModel model = converter.convertToEventModel(eventJson); // malformed JSON
// after
try {
    EventModel model = converter.convertToEventModel(eventJson);
} catch (FlowableEventJsonException e) {
    LOG.error("Bad event JSON: " + e.getCause().getMessage());
    throw e;
}
Defensive patterns

Strategy: try-catch

Validate before calling

try {
    JsonNode node = new ObjectMapper().readTree(eventJson);
    if (node == null || !node.has("key") || !node.has("name")) {
        throw new IllegalArgumentException("Event JSON missing key/name");
    }
} catch (JsonProcessingException e) {
    throw new IllegalArgumentException("Event JSON is not valid JSON", e);
}

Type guard

boolean isParsableEventJson(String json) {
    try { new ObjectMapper().readTree(json); return true; } catch (Exception e) { return false; }
}

Try / catch

try {
    EventModel model = converter.convertToEventModel(eventJson);
} catch (FlowableEventJsonException e) {
    LOG.error("Event JSON invalid: {}", e.getCause() != null ? e.getCause().getMessage() : e.getMessage());
    throw new DeploymentException("Cannot deploy event definition", e);
}

Prevention

When it happens

Trigger: Calling convertToEventModel with syntactically invalid JSON, JSON missing required event fields, or structure that fails Jackson deserialization into the event model classes.

Common situations: Deploying a hand-edited or corrupted .event JSON resource, exporting an event from a different Flowable version and deploying to an incompatible engine, or copy-paste errors in payload/correlation definitions.

Understand the failure class

Background: "failed to unmarshal" / json.Unmarshal errors: why parsing a response into a Go struct fails and how to fix it — this error's family across 23 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/42c22d454e990418. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-event-registry-json-converter/src/main/java/org/flowable/eventregistry/json/converter/EventJsonConverter.java:89

                    eventModel.addPayload(payload);
                }
            }

            JsonNode correlationParameters = modelNode.path("correlationParameters");
            if (correlationParameters.isArray()) {
                for (JsonNode correlationPayloadNode : correlationParameters) {
                    String name = correlationPayloadNode.path("name").stringValue(null);
                    String type = correlationPayloadNode.path("type").stringValue(null);
                    EventPayload payload = eventModel.addCorrelation(name, type);
                    
                    processExtensionProperties(correlationPayloadNode, payload);
                }
            }

            return eventModel;
            
        } catch (Exception e) {
            throw new FlowableEventJsonException("Error reading event json", e);
        }
    }

    public String convertToJson(EventModel definition) {
        ObjectMapper objectMapper = objectMapperSupplier.get();
        ObjectNode modelNode = objectMapper.createObjectNode();

        if (definition.getKey() != null) {
            modelNode.put("key", definition.getKey());
        }

        if (definition.getName() != null) {
            modelNode.put("name", definition.getName());
        }
        
        Collection<EventPayload> payload = definition.getPayload();
        if (!payload.isEmpty()) {
            ArrayNode payloadNode = modelNode.putArray("payload");

View on GitHub (pinned to d6d39ce1c6)