{"record":{"id":"cfa1b82c73fbca80","repo":"langgenius/dify","slug":"not-found-cfa1b8","errorCode":"not_found","errorMessage":"Workflow run not found","messagePattern":"Workflow run not found","errorType":"error_code","errorClass":"NotFoundError","httpStatus":404,"severity":"error","filePath":"api/controllers/console/app/workflow_run.py","lineNumber":394,"sourceCode":"        \"Workflow run detail retrieved successfully\",\n        console_ns.models[WorkflowRunDetailResponse.__name__],\n    )\n    @console_ns.response(404, \"Workflow run not found\")\n    @setup_required\n    @login_required\n    @account_initialization_required\n    @rbac_permission_required(RBACResourceScope.APP, RBACPermission.APP_CREATE_AND_MANAGEMENT)\n    @get_app_model(mode=[AppMode.ADVANCED_CHAT, AppMode.WORKFLOW])\n    def get(self, app_model: App, run_id: UUID):\n        \"\"\"\n        Get workflow run detail\n        \"\"\"\n        run_id_str = str(run_id)\n\n        workflow_run_service = WorkflowRunService()\n        workflow_run = workflow_run_service.get_workflow_run(app_model=app_model, run_id=run_id_str)\n        if workflow_run is None:\n            raise NotFoundError(\"Workflow run not found\")\n\n        return WorkflowRunDetailResponse.model_validate(workflow_run, from_attributes=True).model_dump(mode=\"json\")\n\n\n@console_ns.route(\"/apps/<uuid:app_id>/workflow-runs/<uuid:run_id>/node-executions\")\nclass WorkflowRunNodeExecutionListApi(Resource):\n    @console_ns.doc(\"get_workflow_run_node_executions\")\n    @console_ns.doc(description=\"Get workflow run node execution list\")\n    @console_ns.doc(params={\"app_id\": \"Application ID\", \"run_id\": \"Workflow run ID\"})\n    @console_ns.response(\n        200,\n        \"Node executions retrieved successfully\",\n        console_ns.models[WorkflowRunNodeExecutionListResponse.__name__],\n    )\n    @console_ns.response(404, \"Workflow run not found\")\n    @setup_required\n    @login_required\n    @account_initialization_required","sourceCodeStart":376,"sourceCodeEnd":412,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/api/controllers/console/app/workflow_run.py#L376-L412","documentation":"Thrown by GET /apps/{app_id}/workflow-runs/{run_id} when WorkflowRunService.get_workflow_run cannot locate a run with the given run_id for the app. The run may not exist or may belong to a different app. Returned as 404 code 'not_found'.","triggerScenarios":"GET /console/api/apps/{app_id}/workflow-runs/{run_id} where run_id is unknown, was deleted, belongs to another app, or is malformed (but passed URL UUID parsing).","commonSituations":"User clicks a stale run link from history/email after the run was purged; copying a run_id across environments; race condition where the run is still being committed; passing the app run id instead of the workflow run id.","solutions":["List runs via GET /apps/{app_id}/workflow-runs to obtain a valid run_id before fetching detail.","Confirm run_id belongs to app_id; cross-app references return None.","If the run was just published, retry after the run record is committed (brief propagation window).","Check the workflow_runs table for the run_id to rule out deletion."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const runs = await get(`/apps/${appId}/workflow-runs`);\nconst exists = runs.data.some(r => r.id === runId);\nif (!exists) { /* do not fetch detail */ }","typeGuard":null,"tryCatchPattern":"try {\n  await get(`/apps/${appId}/workflow-runs/${runId}`);\n} catch (e) {\n  if (e.code === 'not_found' && /workflow run not found/i.test(e.message)) {\n    // show 'run expired or unknown' state, refresh runs list\n  } else { throw e; }\n}","preventionTips":["Use run ids obtained from the workflow-runs list, not from log lines.","Treat deep links to runs as best-effort: the run may be purged by retention."],"tags":["api","not-found","workflow-run","execution"],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T12:31:55.035Z"}