flowable/flowable-engine · warning · FlowableIllegalArgumentException

The identity link type is required.

Error message

The identity link type is required.

What it means

REST request validation in TaskIdentityLinkCollectionResource.createIdentityLink: neither user nor group can be linked without a type (e.g. assignee, candidate), and the request body omitted the type field.

Solutions

  1. Add a 'type' field (commonly 'candidate') to the request body
  2. Check the Flowable REST docs for supported identity link types
  3. Ensure your client wrapper always serializes the type field

Example fix

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

Strategy: validation

Validate before calling

if (!payload.type) {
  throw new Error('identity link type is required, e.g. candidate');
}

Try / catch

try { ... } catch (e) { if (e.status === 400 && /identity link type is required/.test(e.body.message)) showFormError('Type is required'); else throw e; }

Prevention

When it happens

Trigger: POST /runtime/tasks/{taskId}/identitylinks with {"user":"kermit"} but no 'type' field.

Common situations: Omitting type assuming a default (there is none); custom UIs that only collect user/group; version drift where a wrapper library dropped the type field.

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

Appendix: source

Thrown at modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/task/TaskIdentityLinkCollectionResource.java:79

            @ApiResponse(code = 201, message = "Indicates the task was found and the identity link was created."),
            @ApiResponse(code = 404, message = "Indicates the requested task was not found or the task does not have the requested identityLink. The status contains additional information about this error.")
    })
    @PostMapping(value = "/runtime/tasks/{taskId}/identitylinks", produces = "application/json")
    @ResponseStatus(HttpStatus.CREATED)
    public RestIdentityLink createIdentityLink(@ApiParam(name = "taskId") @PathVariable("taskId") String taskId, @RequestBody RestIdentityLink identityLink) {

        Task task = getTaskFromRequestWithoutAccessCheck(taskId);

        if (identityLink.getGroup() == null && identityLink.getUser() == null) {
            throw new FlowableIllegalArgumentException("A group or a user is required to create an identity link.");
        }

        if (identityLink.getGroup() != null && identityLink.getUser() != null) {
            throw new FlowableIllegalArgumentException("Only one of user or group can be used to create an identity link.");
        }

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

        if (restApiInterceptor != null) {
            restApiInterceptor.createTaskIdentityLink(task, identityLink);
        }

        if (identityLink.getGroup() != null) {
            taskService.addGroupIdentityLink(task.getId(), identityLink.getGroup(), identityLink.getType());
        } else {
            taskService.addUserIdentityLink(task.getId(), identityLink.getUser(), identityLink.getType());
        }

        return restResponseFactory.createRestIdentityLink(identityLink.getType(), identityLink.getUser(), identityLink.getGroup(), task.getId(), null, null);
    }
}

View on GitHub (pinned to d6d39ce1c6)