flowable/flowable-engine · error · FlowableObjectNotFoundException

Could not find the requested identity link.

Error message

Could not find the requested identity link.

What it means

Thrown by getIdentityLink when the requested identity link (user or group membership on a case instance) cannot be matched among the case instance's existing identity links. Flowable throws FlowableObjectNotFoundException with IdentityLink.class to signal that the specific identity link resource the URL refers to does not exist. The lookup matches on identityId, link type (user/group family), and permission type, so any mismatch means no link is returned.

Source

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

        }
        if (type == null) {
            throw new FlowableIllegalArgumentException("Type is required.");
        }
    }

    protected IdentityLink getIdentityLink(String identityId, String family, String type, String caseInstanceId) {
        // Perhaps it would be better to offer getting a single identity link
        // from the API
        List<IdentityLink> allLinks = runtimeService.getIdentityLinksForCaseInstance(caseInstanceId);
        for (IdentityLink link : allLinks) {
            if (CmmnRestUrls.SEGMENT_IDENTITYLINKS_FAMILY_USERS.equals(family) && identityId.equals(link.getUserId()) && link.getType().equals(type)) {
                return link;
            
            } else if (CmmnRestUrls.SEGMENT_IDENTITYLINKS_FAMILY_GROUPS.equals(family) && identityId.equals(link.getGroupId()) && link.getType().equals(type)) {
                return link;
            }
        }
        throw new FlowableObjectNotFoundException("Could not find the requested identity link.", IdentityLink.class);
    }
}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. List the case instance's identity links first (GET /cmmn-runtime/case-instances/{id}/identitylinks) and confirm the exact family, identityId and type, then retry with the corrected URL.
  2. Fix the family segment in the URL: use SEGMENT_IDENTITYLINKS_FAMILY_USERS for user links and SEGMENT_IDENTITYLINKS_FAMILY_GROUPS for group links.
  3. Verify the identityId in the URL exactly matches the userId or groupId on the link (case-sensitive).
  4. If the link should exist, re-add it via POST to the case instance identitylinks collection endpoint before querying it.

Example fix

// before: wrong family/type mismatch
GET /cmmn-runtime/case-instances/case1/identitylinks/groups/kermit/assignee
// after: match the actual link (user link, correct type)
GET /cmmn-runtime/case-instances/case1/identitylinks/users/kermit/candidate
Defensive patterns

Strategy: try-catch

Validate before calling

// Fetch and verify the identity link exists before requesting it
const links = await fetch(`/cmmn-runtime/case-instances/${caseId}/identitylinks`).then(r => r.json());
const exists = links.some(l =>
  (family === 'users' ? l.userId : l.groupId) === identityId && l.type === type);
if (!exists) throw new Error(`Identity link ${family}/${identityId}/${type} not on case ${caseId}`);

Try / catch

try {
  const link = await getIdentityLink(caseId, family, identityId, type);
} catch (e) {
  if (e.status === 404) { /* link absent: refresh list or re-create it */ }
  else throw e;
}

Prevention

When it happens

Trigger: GET to a case instance identity link URL (CmmnRestUrls URL containing /identitylinks/) where the family segment says 'users' but the link is a group link (or vice versa), the identityId in the URL doesn't match any link's userId/groupId, or the 'type' query/segment (e.g. assignee, candidate, owner) doesn't equal the stored link type.

Common situations: Requesting an identity link after it was deleted; typos in the userId/groupId in the URL; using the wrong family segment (users vs groups); wrong link type (e.g. asking for 'assignee' when the link was added as 'candidate'); case sensitivity differences in identity IDs between the identity store and the URL.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — 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/5ce56ef37f1d2c43. Report an issue: GitHub.