{"record":{"id":"61acadbb42ea40ed","repo":"flowable/flowable-engine","slug":"a-process-instance-id-is-required-but-the-provide-61acad","errorCode":null,"errorMessage":"A process instance id is required, but the provided id '${processInstanceId}' points to a child execution of process instance '${processInstance.getProcessInstanceId()}'. Please invoke the ${class simple name} with a root execution id.","messagePattern":"A process instance id is required, but the provided id '(.+?)' points to a child execution of process instance '(.+?)'\\. Please invoke the (.+?) with a root execution id\\.","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/SetProcessInstanceDueDateCmd.java","lineNumber":58,"sourceCode":"\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":40,"sourceCodeEnd":67,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/SetProcessInstanceDueDateCmd.java#L40-L67","documentation":"SetProcessInstanceDueDateCmd requires the id of a root process instance execution. Flowable internally splits a process instance into a tree of executions; the given id resolved to a child execution instead of the root, so the command refuses to set a due date on it. This guards against callers passing execution ids from history/jobs instead of the actual process instance id.","triggerScenarios":"Calling runtimeService.setProcessInstanceDueDate(processInstanceId, dueDate) with an id that belongs to a concurrent/child execution rather than the root execution of the instance.","commonSituations":"Passing ExecutionEntity.getId() from a listener or job handler where child executions exist; confusing execution ids and process instance ids in custom code; fetching ids from history tables that record child executions.","solutions":["Use processInstance.getId() (or execution.getProcessInstanceId() from any child execution) to get the root id and pass that to setProcessInstanceDueDate.","Verify the id at the source: if you only have an execution, call execution.getProcessInstanceId() before invoking the command.","Check whether you fetched the execution from a child-execution query (e.g. by activity) instead of the process instance itself."],"exampleFix":"// before\nruntimeService.setProcessInstanceDueDate(execution.getId(), dueDate);\n// after\nruntimeService.setProcessInstanceDueDate(execution.getProcessInstanceId(), dueDate);","handlingStrategy":"validation","validationCode":"ProcessInstance pi = runtimeService.createProcessInstanceQuery().processInstanceId(id).singleResult();\nif (pi == null) throw new IllegalArgumentException(\"not a process instance id: \" + id);\nruntimeService.setProcessInstanceDueDate(pi.getId(), dueDate);","typeGuard":null,"tryCatchPattern":"try {\n    runtimeService.setProcessInstanceDueDate(id, dueDate);\n} catch (FlowableIllegalArgumentException e) {\n    log.warn(\"id {} is a child execution\", id, e);\n}","preventionTips":["Always derive the id from ProcessInstance objects, not ExecutionEntity.getId()","Use execution.getProcessInstanceId() when starting from a child execution","Never persist raw execution ids as if they were process instance ids"],"tags":["flowable","process-instance","execution","invalid-argument"],"backgroundTag":"invalid-argument-value","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}