flowable/flowable-engine · error · FlowableIllegalArgumentException

Id cannot be null.

Error message

Id cannot be null.

What it means

GroupCollectionResource.createGroup validates the request body before creating a group. If GroupRequest.id is null, it throws FlowableIllegalArgumentException because a Flowable group requires a caller-supplied id (unlike users in some setups, group creation does not generate one).

Solutions

  1. Include a non-null "id" field in the POST /identity/groups JSON body.
  2. Fix client-side field naming so the id property actually serializes (check for groupId/id mismatch).
  3. Validate the request object on the client before sending.

Example fix

// before
POST /identity/groups {"name":"Sales","type":"security-group"}
// after
POST /identity/groups {"id":"sales","name":"Sales","type":"security-group"}
Defensive patterns

Strategy: validation

Validate before calling

if (groupRequest.getId() == null || groupRequest.getId().isBlank()) {
    throw new IllegalArgumentException("Group id is required before POST /identity/groups");
}

Type guard

boolean hasId(GroupRequest r) { return r != null && r.getId() != null && !r.getId().isEmpty(); }

Prevention

When it happens

Trigger: POST /identity/groups with a JSON body missing the "id" field (or explicitly setting it to null), e.g. {"name":"Sales","type":"security-group"}.

Common situations: Client DTO omits id because another REST API auto-generates ids; JSON field name mismatch (groupId vs id) causing null deserialization; programmatically built request where only name/type were set.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at modules/flowable-rest/src/main/java/org/flowable/rest/service/api/identity/GroupCollectionResource.java:124

        }
        
        if (restApiInterceptor != null) {
            restApiInterceptor.accessGroupInfoWithQuery(query);
        }

        return paginateList(allRequestParams, query, "id", properties, restResponseFactory::createGroupResponseList);
    }

    @ApiOperation(value = "Create a group", tags = { "Groups" }, code = 201)
    @ApiResponses(value = {
            @ApiResponse(code = 201, message = "Indicates the group was created."),
            @ApiResponse(code = 400, message = "Indicates the id of the group was missing.")
    })
    @PostMapping(value = "/identity/groups", produces = "application/json")
    @ResponseStatus(HttpStatus.CREATED)
    public GroupResponse createGroup(@RequestBody GroupRequest groupRequest) {
        if (groupRequest.getId() == null) {
            throw new FlowableIllegalArgumentException("Id cannot be null.");
        }
        
        if (restApiInterceptor != null) {
            restApiInterceptor.createGroup(groupRequest);
        }

        // Check if a user with the given ID already exists so we return a CONFLICT
        if (identityService.createGroupQuery().groupId(groupRequest.getId()).count() > 0) {
            throw new FlowableConflictException("A group with id '" + groupRequest.getId() + "' already exists.");
        }

        Group created = identityService.newGroup(groupRequest.getId());
        created.setId(groupRequest.getId());
        created.setName(groupRequest.getName());
        created.setType(groupRequest.getType());
        identityService.saveGroup(created);

        return restResponseFactory.createGroupResponse(created);

View on GitHub (pinned to d6d39ce1c6)