{"record":{"id":"e9b7e950288e70b9","repo":"flowable/flowable-engine","slug":"no-external-worker-job-found-for-id-externaljobi","errorCode":null,"errorMessage":"No External Worker job found for id: {externalJobId}","messagePattern":"No External Worker job found for id: (.+?)","errorType":"exception","errorClass":"FlowableObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/AbstractExternalWorkerJobCmd.java","lineNumber":87,"sourceCode":"        processEngineConfiguration.getIdentityLinkServiceConfiguration().getIdentityLinkService()\n                .deleteIdentityLinksByScopeIdAndType(externalWorkerJob.getCorrelationId(), ScopeTypes.EXTERNAL_WORKER);\n    }\n\n    protected ExternalWorkerJobEntity resolveJob(CommandContext commandContext) {\n        if (StringUtils.isEmpty(externalJobId)) {\n            throw new FlowableIllegalArgumentException(\"externalJobId must not be empty\");\n        }\n\n        if (StringUtils.isEmpty(workerId)) {\n            throw new FlowableIllegalArgumentException(\"workerId must not be empty\");\n        }\n\n        ExternalWorkerJobEntityManager externalWorkerJobEntityManager = jobServiceConfiguration.getExternalWorkerJobEntityManager();\n\n        ExternalWorkerJobEntity job = externalWorkerJobEntityManager.findById(externalJobId);\n\n        if (job == null) {\n            throw new FlowableObjectNotFoundException(\"No External Worker job found for id: \" + externalJobId, ExternalWorkerJobEntity.class);\n        }\n\n        if (!Objects.equals(workerId, job.getLockOwner())) {\n            throw new FlowableIllegalArgumentException(workerId + \" does not hold a lock on the requested job\");\n        }\n\n        return job;\n    }\n}\n","sourceCodeStart":69,"sourceCodeEnd":97,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/AbstractExternalWorkerJobCmd.java#L69-L97","documentation":"After loading the job by id, resolveJob throws FlowableObjectNotFoundException (with ExternalWorkerJobEntity.class as the entity type) when the job row does not exist. The command cannot proceed because the referenced external worker job is gone or was never created with that id.","triggerScenarios":"Calling complete/fail/release with an externalJobId that no longer exists: job already completed and deleted, expired/failed job removed by job cleaner, id typo, or querying against a different database/tenant.","commonSituations":"Two workers raced and one finished the job first; long retries after the job expired (lock expired and job deleted); stale job id cached on the worker side; cross-environment id reuse.","solutions":["Catch FlowableObjectNotFoundException in the worker and treat the job as already handled (skip/retry acquisition).","Re-acquire fresh jobs instead of retrying stale job ids from a local cache.","Verify the id and that the command runs against the same engine/database/tenant where the job was acquired."],"exampleFix":"// before\njobService.complete(jobId, workerId, variables); // throws if job gone\n// after\ntry {\n    jobService.complete(jobId, workerId, variables);\n} catch (FlowableObjectNotFoundException e) {\n    log.info(\"Job {} already gone, skipping\", jobId);\n}","handlingStrategy":"try-catch","validationCode":"ExternalWorkerJob job = jobService.createExternalWorkerJobQuery().externalJobId(jobId).singleResult(); // check before acting","typeGuard":null,"tryCatchPattern":"try {\n    jobService.complete(jobId, workerId, variables);\n} catch (FlowableObjectNotFoundException e) {\n    // job already completed/expired: skip and re-acquire\n}","preventionTips":["Treat not-found as an expected race in idempotent workers","Re-acquire jobs instead of retrying stale ids","Keep job references short-lived (within the lock duration)"],"tags":["flowable","external-worker","not-found","job-expired"],"backgroundTag":"entity-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"}