{"record":{"id":"6d511eaa4b9f6014","repo":"flowable/flowable-engine","slug":"could-not-find-the-requested-identity-link-6d511e","errorCode":null,"errorMessage":"Could not find the requested identity link.","messagePattern":"Could not find the requested identity link\\.","errorType":"exception","errorClass":"FlowableObjectNotFoundException","httpStatus":404,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceIdentityLinkResource.java","lineNumber":122,"sourceCode":"        }\n        if (type == null) {\n            throw new FlowableIllegalArgumentException(\"Type is required.\");\n        }\n    }\n\n    protected IdentityLink getIdentityLink(String identityId, String family, String type, String processInstanceId) {\n        // Perhaps it would be better to offer getting a single identity link\n        // from the API\n        List<IdentityLink> allLinks = runtimeService.getIdentityLinksForProcessInstance(processInstanceId);\n        for (IdentityLink link : allLinks) {\n            if (RestUrls.SEGMENT_IDENTITYLINKS_FAMILY_USERS.equals(family) && identityId.equals(link.getUserId()) && link.getType().equals(type)) {\n                return link;\n            \n            } else if (RestUrls.SEGMENT_IDENTITYLINKS_FAMILY_GROUPS.equals(family) && identityId.equals(link.getGroupId()) && link.getType().equals(type)) {\n                return link;\n            }\n        }\n        throw new FlowableObjectNotFoundException(\"Could not find the requested identity link.\", IdentityLink.class);\n    }\n}\n","sourceCodeStart":104,"sourceCodeEnd":125,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceIdentityLinkResource.java#L104-L125","documentation":"Flowable REST throws FlowableObjectNotFoundException after scanning the process instance's identity links when no link matches the given identityId, family (users/groups), and type. The request was well-formed but the link does not exist on the process instance.","triggerScenarios":"GET/DELETE /runtime/process-instances/{id}/identitylinks/users/{identityId}/{type} where no IdentityLink on that process instance matches the user/group id and type returned by RuntimeService.getIdentityLinksForProcessInstance.","commonSituations":"Link already deleted (double delete / concurrent request); wrong type string (e.g. 'assignee' vs 'participant'); identityId belongs to a task identity link, not a process instance one; typo in user/group id.","solutions":["List current links via GET /runtime/process-instances/{id}/identitylinks and confirm the exact family/identityId/type triple before deleting.","Handle HTTP 404 from this endpoint as a success case for idempotent deletes.","Verify the link was created on the process instance (not on a task within it)."],"exampleFix":"// before\nrestTemplate.delete(url); // 404 crashes batch job\n// after\ntry { restTemplate.delete(url); } catch (HttpClientErrorException.NotFound e) { /* already removed */ }","handlingStrategy":"try-catch","validationCode":"const links = await get(`/runtime/process-instances/${pid}/identitylinks`); if (!links.some(l => l.user === userId && l.type === type)) return null;","typeGuard":null,"tryCatchPattern":"try { del(url); } catch (e) { if (e.status === 404) return; throw e; }","preventionTips":["List identity links before delete","Treat 404 as success in idempotent deletes","Distinguish task-level vs process-instance-level identity links"],"tags":["rest-api","not-found","identity-link"],"backgroundTag":"resource-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}