{"record":{"id":"d93ab9c1664cc62f","repo":"BerriAI/litellm","slug":"run-run-id-not-found","errorCode":null,"errorMessage":"Run '{run_id}' not found","messagePattern":"Run '(.+?)' not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"litellm/proxy/management_endpoints/workflow_management_endpoints.py","lineNumber":181,"sourceCode":"        )\n    else:\n        rows = await WorkflowMessageRepository(prisma_client).table.find_many(\n            where={\"run_id\": run_id},\n            order={\"sequence_number\": \"desc\"},\n            take=1,\n        )\n    return (rows[0].sequence_number + 1) if rows else 0\n\n\nasync def _require_run(\n    prisma_client: object,\n    run_id: str,\n    user_api_key_dict: UserAPIKeyAuth | None = None,\n) -> _RunRow:\n    \"\"\"Return the run or raise 404. For non-admin callers, also enforce key ownership.\"\"\"\n    run: Final[_RunRow | None] = await WorkflowRunRepository(prisma_client).table.find_unique(where={\"run_id\": run_id})\n    if run is None:\n        raise HTTPException(status_code=404, detail=f\"Run '{run_id}' not found\")\n    if user_api_key_dict is not None and not _is_admin(user_api_key_dict):\n        caller: Final = _caller_key(user_api_key_dict)\n        if not caller or run.created_by != caller:\n            raise HTTPException(status_code=404, detail=f\"Run '{run_id}' not found\")\n    return run\n\n\n# ---------------------------------------------------------------------------\n# Endpoints\n# ---------------------------------------------------------------------------\n\n\n@router.post(\n    \"/v1/workflows/runs\",\n    tags=[\"workflow management\"],\n    dependencies=[Depends(user_api_key_auth)],\n)\nasync def create_workflow_run(","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/workflow_management_endpoints.py#L163-L199","documentation":"HTTPException(404) from the _require_run helper: no workflow run row with the given run_id exists in the database (or, for non-admin callers, the run exists but is not owned by the caller's key, which is reported the same way to avoid leaking existence). The workflow endpoint cannot proceed without a target run.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/workflow_management_endpoints.py:181 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the run_id exists (list runs) before querying it."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}