{"record":{"id":"832d303275670204","repo":"apache/dolphinscheduler","slug":"workflow-definition-not-found-workflowcode-vers","errorCode":null,"errorMessage":"Workflow definition not found: <workflowCode> version <workflowVersion>","messagePattern":"Workflow definition not found: <workflowCode> version <workflowVersion>","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/workflow/trigger/AbstractWorkflowTrigger.java","lineNumber":94,"sourceCode":"        }\n\n        return onTriggerSuccess(workflowInstance);\n    }\n\n    // todo: 使用WorkflowInstanceConstructor封装\n    protected abstract ImmutablePair<WorkflowDefinition, WorkflowInstance> constructWorkflowInstance(final TriggerRequest triggerRequest);\n\n    // todo: 使用CommandConstructor封装\n    protected abstract Command constructTriggerCommand(final TriggerRequest triggerRequest,\n                                                       final WorkflowInstance workflowInstance);\n\n    protected abstract TriggerResponse onTriggerSuccess(final WorkflowInstance workflowInstance);\n\n    protected WorkflowDefinition getProcessDefinition(final Long workflowCode, final Integer workflowVersion) {\n        final WorkflowDefinitionLog workflow = workflowDefinitionDao.queryByDefinitionCodeAndVersion(\n                workflowCode, workflowVersion);\n        if (workflow == null) {\n            throw new IllegalStateException(\n                    \"Workflow definition not found: \" + workflowCode + \" version \" + workflowVersion);\n        }\n        return workflow;\n    }\n\n    protected User getExecutorUser(final Integer userId) {\n        return userDao.queryOptionalById(userId)\n                .orElseThrow(() -> new IllegalStateException(\"User not found: \" + userId));\n    }\n\n}\n","sourceCodeStart":76,"sourceCodeEnd":106,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/workflow/trigger/AbstractWorkflowTrigger.java#L76-L106","documentation":"Thrown in AbstractWorkflowTrigger.getProcessDefinition when workflowDefinitionDao.queryByDefinitionCodeAndVersion(workflowCode, workflowVersion) returns null during a workflow trigger: the master cannot load the exact code+version of the workflow definition it was asked to run — the definition was deleted, the version never existed, or metadata is inconsistent, so triggering cannot proceed.","triggerScenarios":"Thrown at dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/workflow/trigger/AbstractWorkflowTrigger.java:94 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the workflow with that code/version still exists and is not deleted in the UI","If a schedule or retry references a stale version, update it to a valid published version","Check t_ds_workflow_definition_log for the code/version pair to confirm what the master expected","Re-trigger the workflow after restoring a valid definition version"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}