{"record":{"id":"b0caa9cdb9e07569","repo":"flowable/flowable-engine","slug":"no-process-instance-found-for-id-processinsta-b0caa9","errorCode":null,"errorMessage":"No process instance found for id = '${processInstanceId}'.","messagePattern":"No process instance found for id = '(.+?)'\\.","errorType":"exception","errorClass":"FlowableObjectNotFoundException","httpStatus":404,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/SetProcessInstanceDueDateCmd.java","lineNumber":55,"sourceCode":"\n    private final String processInstanceId;\n    private final Date dueDate;\n\n    public SetProcessInstanceDueDateCmd(String processInstanceId, Date dueDate) {\n        if (processInstanceId == null || processInstanceId.isEmpty()) {\n            throw new FlowableIllegalArgumentException(\"The process instance id is mandatory, but '\" + processInstanceId + \"' has been provided.\");\n        }\n\n        this.processInstanceId = processInstanceId;\n        this.dueDate = dueDate;\n    }\n\n    @Override\n    public Void execute(CommandContext commandContext) {\n        ExecutionEntityManager executionManager = CommandContextUtil.getExecutionEntityManager(commandContext);\n        ExecutionEntity processInstance = executionManager.findById(processInstanceId);\n        if (processInstance == null) {\n            throw new FlowableObjectNotFoundException(\"No process instance found for id = '\" + processInstanceId + \"'.\", ProcessInstance.class);\n\n        } else if (!processInstance.isProcessInstanceType()) {\n            throw new FlowableIllegalArgumentException(\"A process instance id is required, but the provided id \" + \"'\" + processInstanceId + \"' \" + \"points to a child execution of process instance \" + \"'\"\n                    + processInstance.getProcessInstanceId() + \"'. \" + \"Please invoke the \" + getClass().getSimpleName() + \" with a root execution id.\");\n        }\n\n        executionManager.updateProcessInstanceDueDate(processInstance, dueDate);\n\n        return null;\n    }\n}\n","sourceCodeStart":37,"sourceCodeEnd":67,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/SetProcessInstanceDueDateCmd.java#L37-L67","documentation":"Thrown by SetProcessInstanceDueDateCmd.execute when no execution exists for the supplied id, as a FlowableObjectNotFoundException with ProcessInstance.class. The target process instance is not present in the runtime tables.","triggerScenarios":"RuntimeService.setProcessInstanceDueDate(id, date) where findById(id) returns null: instance completed, id mistyped, wrong database/tenant, or race with process end.","commonSituations":"Setting due dates from scheduled jobs that fire after the instance already ended, stale cached ids, environment/database misconfiguration.","solutions":["Pre-check existence with RuntimeService.createProcessInstanceQuery().processInstanceId(id).","Catch FlowableObjectNotFoundException and skip/no-op for instances that ended in the meantime.","Verify you are pointed at the correct datasource where the instance lives."],"exampleFix":"// before\nruntimeService.setProcessInstanceDueDate(id, dueDate);\n// after\nif (runtimeService.createProcessInstanceQuery().processInstanceId(id).count() > 0) {\n    runtimeService.setProcessInstanceDueDate(id, dueDate);\n}","handlingStrategy":"try-catch","validationCode":"boolean exists = runtimeService.createProcessInstanceQuery()\n        .processInstanceId(processInstanceId).count() > 0;","typeGuard":null,"tryCatchPattern":"try {\n    runtimeService.setProcessInstanceDueDate(id, dueDate);\n} catch (FlowableObjectNotFoundException e) {\n    if (ProcessInstance.class.equals(e.getObjectClass())) {\n        // instance ended before due date could be set; skip\n    }\n}","preventionTips":["For scheduled due-date jobs, expect and handle already-completed instances.","Pre-check existence when ids come from caches or external systems.","Confirm the engine is pointed at the intended database/schema."],"tags":["process-instance","not-found","runtime"],"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"}