{"record":{"id":"1942c6d9e2702ca6","repo":"flowable/flowable-engine","slug":"could-not-find-a-job-with-id-jobid-1942c6","errorCode":null,"errorMessage":"Could not find a job with id '${jobId}'.","messagePattern":"Could not find a job with id '(.+?)'\\.","errorType":"http","errorClass":"FlowableObjectNotFoundException","httpStatus":404,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/JobResource.java","lineNumber":140,"sourceCode":"\n    @ApiOperation(value = \"Delete a job\", tags = { \"Jobs\" }, code = 204)\n    @ApiResponses(value = {\n            @ApiResponse(code = 204, message = \"Indicates the job was found and has been deleted. Response-body is intentionally empty.\"),\n            @ApiResponse(code = 404, message = \"Indicates the requested job was not found.\")\n    })\n    @DeleteMapping(\"/management/jobs/{jobId}\")\n    @ResponseStatus(HttpStatus.NO_CONTENT)\n    public void deleteJob(@ApiParam(name = \"jobId\") @PathVariable String jobId) {\n        Job job = getJobById(jobId);\n        if (restApiInterceptor != null) {\n            restApiInterceptor.deleteJob(job);\n        }\n        \n        try {\n            managementService.deleteJob(jobId);\n        } catch (FlowableObjectNotFoundException aonfe) {\n            // Re-throw to have consistent error-messaging across REST-api\n            throw new FlowableObjectNotFoundException(\"Could not find a job with id '\" + jobId + \"'.\", Job.class);\n        }\n    }\n\n    @ApiOperation(value = \"Delete a timer job\", tags = { \"Jobs\" }, code = 204)\n    @ApiResponses(value = {\n            @ApiResponse(code = 204, message = \"Indicates the job was found and has been deleted. Response-body is intentionally empty.\"),\n            @ApiResponse(code = 404, message = \"Indicates the requested job was not found.\")\n    })\n    @DeleteMapping(\"/management/timer-jobs/{jobId}\")\n    @ResponseStatus(HttpStatus.NO_CONTENT)\n    public void deleteTimerJob(@ApiParam(name = \"jobId\") @PathVariable String jobId) {\n        Job job = getTimerJobById(jobId);\n        if (restApiInterceptor != null) {\n            restApiInterceptor.deleteJob(job);\n        }\n        \n        try {\n            managementService.deleteTimerJob(jobId);","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/JobResource.java#L122-L158","documentation":"The REST endpoint DELETE /management/jobs/{jobId} catches FlowableObjectNotFoundException from managementService.deleteJob and re-throws it with a consistent message: no job with the given id exists in the runtime job table (ACT_RU_JOB). Flowable throws this because a delete can only target an existing job entity.","triggerScenarios":"DELETE /management/jobs/{jobId} with a jobId that does not exist, was already deleted, or exists only in another table (timer/suspended/deadletter/history jobs are separate tables — a timer job id passed here also fails).","commonSituations":"Using an id from the wrong job table (e.g. timer job id against the plain jobs endpoint); retrying a delete after the job already executed and was removed; stale ids after engine restart or cleanup.","solutions":["Confirm the job id by querying GET /management/jobs/{jobId} before deleting","If the job is a timer, suspended, deadletter, or history job, use the matching endpoint (/management/timer-jobs/..., /management/suspended-jobs/..., etc.)","Catch FlowableObjectNotFoundException / handle 404 and treat deletion as idempotent no-op"],"exampleFix":"// before\nrestTemplate.delete(\"/management/jobs/\" + someTimerJobId); // 404\n// after\nrestTemplate.delete(\"/management/timer-jobs/\" + someTimerJobId);","handlingStrategy":"validation","validationCode":"Job job = managementService.createJobQuery().jobId(jobId).singleResult();\nif (job == null) { /* skip or use correct endpoint */ }","typeGuard":null,"tryCatchPattern":"try {\n    managementService.deleteJob(jobId);\n} catch (FlowableObjectNotFoundException e) {\n    // already deleted or wrong table\n}","preventionTips":["Resolve job type first (job vs timer vs suspended vs deadletter) and use the matching endpoint","Treat deletes as idempotent; tolerate 404","Refresh job ids from a live query, not cached snapshots"],"tags":["rest-api","flowable","job-management","delete"],"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"}