flowable/flowable-engine · error · FlowableIllegalArgumentException

Provided activity id is null

Error message

Provided activity id is null

What it means

Flowable throws FlowableIllegalArgumentException from EventSubscriptionQueryImpl.activityId when activityId() is called with a null argument. The query validates every id parameter because a null would make the filter meaningless. Provide the BPMN activity (boundary event / intermediate catch event) id you are targeting, or drop the filter.

Source

Thrown at modules/flowable-eventsubscription-service/src/main/java/org/flowable/eventsubscription/service/impl/EventSubscriptionQueryImpl.java:201

        return this;
    }
    
    @Override
    public EventSubscriptionQueryImpl withoutProcessDefinitionId() {
        if (inOrStatement) {
            this.currentOrQueryObject.withoutProcessDefinitionId = true;
        } else {
            this.withoutProcessDefinitionId = true;
        }

        return this;
    }

    @Override
    public EventSubscriptionQueryImpl activityId(String activityId) {
        if (activityId == null) {
            throw new FlowableIllegalArgumentException("Provided activity id is null");
        }

        if (inOrStatement) {
            this.currentOrQueryObject.activityId = activityId;
        } else {
            this.activityId = activityId;
        }

        return this;
    }
    
    @Override
    public EventSubscriptionQueryImpl caseInstanceId(String caseInstanceId) {
        if (caseInstanceId == null) {
            throw new FlowableIllegalArgumentException("Provided case instance id is null");
        }

        if (inOrStatement) {

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Check the activity id for null before applying the filter
  2. Confirm the target activity actually exists in the deployed process model and its id attribute is set
  3. Use processDefinitionId + activityId together only when both are known
  4. Omit the filter when the activity id is unknown

Example fix

// before
List<EventSubscription> subs = query.activityId(activityId).list();

// after
List<EventSubscription> subs = (activityId != null)
    ? query.activityId(activityId).list()
    : query.list();
Defensive patterns

Strategy: validation

Validate before calling

if (activityId == null) {
    throw new IllegalStateException("activityId required");
}
query.activityId(activityId);

Type guard

if (id instanceof String && !((String) id).isEmpty()) { /* safe to filter */ }

Try / catch

try {
    query.activityId(actId).list();
} catch (FlowableIllegalArgumentException e) {
    // treat as missing filter input
}

Prevention

When it happens

Trigger: Calling .activityId(null) when building an EventSubscriptionQuery, e.g. the activity id comes from an unset XML attribute, a missing flow element, or a null field in the calling service.

Common situations: Looking for event subscriptions on an activity whose id was never configured in the BPMN model; parsing activity ids from external input that omitted them; refactoring where the constant holding the activity id was removed.

Related errors


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