flowable/flowable-engine · error · FlowableIllegalArgumentException

User or group are required.

Error message

User or group are required.

What it means

createIdentityLink requires an identity link body that carries at least a user or a group. If both RestIdentityLink.user and RestIdentityLink.group are null, FlowableIllegalArgumentException("User or group are required.") is thrown. The endpoint cannot create an identity link with no identity attached.

Solutions

  1. Include either "user" or "group" in the request body.
  2. Validate the payload client-side before calling the endpoint.
  3. Ensure field names match the RestIdentityLink schema (user, group, type).
  4. Catch FlowableIllegalArgumentException and return a 400 to the caller with the message.

Example fix

// before
{"type": "participant"}
// after
{"type": "participant", "user": "kermit"}
Defensive patterns

Strategy: validation

Validate before calling

// Java
if (link.getUser() == null && link.getGroup() == null) {
    throw new IllegalArgumentException("identity link requires user or group");
}

Try / catch

try { restTemplate.postForEntity(identityLinksUrl, link, RestIdentityLink.class); }
catch (HttpClientErrorException e) { /* 400: User or group are required */ }

Prevention

When it happens

Trigger: POST /cmmn-runtime/case-instances/{id}/identitylinks with a JSON body lacking both "user" and "group" fields (e.g. only {"type":"participant"}).

Common situations: Malformed request payloads; client serializing only the type field; frontend forms submitted without selecting a user or group; wrong field names in the JSON body.

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/ddebf49c6b17eea7. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/CaseInstanceIdentityLinkCollectionResource.java:76

        return restResponseFactory.createRestIdentityLinks(runtimeService.getIdentityLinksForCaseInstance(caseInstance.getId()));
    }

    @ApiOperation(value = "Add an involved user to a case instance", tags = {"Case Instance Identity Links" }, nickname = "createCaseInstanceIdentityLinks",
            notes = "Note that the groupId in Response Body will always be null, as it’s only possible to involve users with a case instance.",
        code = 201)
    @ApiResponses(value = {
            @ApiResponse(code = 201, message = "Indicates the case instance was found and the link is created."),
            @ApiResponse(code = 400, message = "Indicates the requested body did not contain a userId or a type."),
            @ApiResponse(code = 404, message = "Indicates the requested case instance was not found.")
    })
    @PostMapping(value = "/cmmn-runtime/case-instances/{caseInstanceId}/identitylinks", produces = "application/json")
    @ResponseStatus(HttpStatus.CREATED)
    public RestIdentityLink createIdentityLink(@ApiParam(name = "caseInstanceId") @PathVariable String caseInstanceId, @RequestBody RestIdentityLink identityLink) {

        CaseInstance caseInstance = getCaseInstanceFromRequestWithoutAccessCheck(caseInstanceId);

        if (identityLink.getGroup() == null && identityLink.getUser() == null) {
            throw new FlowableIllegalArgumentException("User or group are required.");
        }
        
        if (StringUtils.isEmpty(identityLink.getGroup()) && StringUtils.isEmpty(identityLink.getUser())) {
            throw new FlowableIllegalArgumentException("Only one value of user or group is supported.");
        }

        if (identityLink.getType() == null) {
            throw new FlowableIllegalArgumentException("The identity link type is required.");
        }

        if (restApiInterceptor != null) {
            restApiInterceptor.createCaseInstanceIdentityLink(caseInstance, identityLink);
        }

        if (StringUtils.isNotEmpty(identityLink.getGroup())) {
            runtimeService.addGroupIdentityLink(caseInstance.getId(), identityLink.getGroup(), identityLink.getType());
            
        } else {

View on GitHub (pinned to d6d39ce1c6)