flowable/flowable-engine · error · FlowableIllegalArgumentException

Unsupported event object type: ${event.getEventObject().getC

Error message

Unsupported event object type: ${event.getEventObject().getClass()}

What it means

BaseEventRegistryEventConsumer.eventReceived throws FlowableIllegalArgumentException when the event object is non-null but is not an instance of EventInstance. Only EventInstance payloads are supported by this consumer, so any other object type is rejected with the payload's class name in the message.

Source

Thrown at modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/consumer/BaseEventRegistryEventConsumer.java:65

public abstract class BaseEventRegistryEventConsumer implements EventRegistryEventConsumer {

    protected AbstractEngineConfiguration engineConfiguration;
    protected CommandExecutor commandExecutor;

    public BaseEventRegistryEventConsumer(AbstractEngineConfiguration engineConfiguration) {
        this.engineConfiguration = engineConfiguration;
        this.commandExecutor = engineConfiguration.getCommandExecutor();
    }

    @Override
    public EventRegistryProcessingInfo eventReceived(EventRegistryEvent event) {
        if (event.getEventObject() != null && event.getEventObject() instanceof EventInstance) {
            return eventReceived((EventInstance) event.getEventObject());
        } else {
            if (event.getEventObject() == null) {
                throw new FlowableIllegalArgumentException("No event object was passed to the consumer");
            } else {
                throw new FlowableIllegalArgumentException("Unsupported event object type: " + event.getEventObject().getClass());
            }
        }
    }

    protected abstract EventRegistryProcessingInfo eventReceived(EventInstance eventInstance);

    /**
     * Generates all possible correlation keys for the given correlation parameters.
     * The first element in the list will only have used one parameter. The last element in the list has included all parameters.
     */
    protected Collection<CorrelationKey> generateCorrelationKeys(Collection<EventPayloadInstance> correlationParameterInstances) {

        if (correlationParameterInstances.isEmpty()) {
            return Collections.emptySet();
        }

        int numberOfCorrelationParameters = correlationParameterInstances.size();
        if (numberOfCorrelationParameters == 1) {

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Convert the raw payload to an EventInstance using the event registry's payload conversion (InboundEventPayloadConverter / EventRegistry.buildEventInstance) before creating the event.
  2. If you need other types, use a different consumer that handles that payload type instead of BaseEventRegistryEventConsumer subclasses.
  3. Log event.getEventObject().getClass() at the producer side and fix the adapter to always wrap in EventInstance.

Example fix

// before
new EventRegistryEvent(payloadJson); // String payload
// after
EventInstance instance = eventRegistry.createEventInstance(eventKey, payloadJson);
new EventRegistryEvent(instance);
Defensive patterns

Strategy: type-guard

Validate before calling

Object o = event.getEventObject();
if (!(o instanceof EventInstance)) throw new IllegalArgumentException("Expected EventInstance, got " + (o == null ? "null" : o.getClass()));

Type guard

boolean isEventInstance(EventRegistryEvent e) { return e != null && e.getEventObject() instanceof EventInstance; }

Try / catch

try { consumer.eventReceived(event); } catch (FlowableIllegalArgumentException e) { log.error("Unsupported payload type: {}", e.getMessage()); }

Prevention

When it happens

Trigger: Publishing an EventRegistryEvent whose event object is a raw String, Map, JSON node, or custom DTO instead of an EventInstance, e.g. from a custom channel adapter or test that skipped payload conversion.

Common situations: Migrating from older Flowable versions where raw payloads were accepted, custom adapters passing the deserialized JSON directly, or unit tests feeding mock objects into the consumer.

Understand the failure class

Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.

Related errors


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