langgenius/dify · warning · NotFound
Conversation Not Exists.
Error message
Conversation Not Exists.
What it means
Raised as NotFound('Conversation Not Exists.') in AdvancedChatDraftWorkflowRunApi.post when AppGenerateService.generate raises services.errors.conversation.ConversationNotExistsError (api/controllers/console/app/workflow.py:725-726). The supplied conversation_id does not correspond to an existing conversation for the app, so the advanced-chat draft run cannot continue.
Source
Thrown at api/controllers/console/app/workflow.py:726
args = args_model.model_dump(exclude_none=True)
external_trace_id = get_external_trace_id(request)
if external_trace_id:
args["external_trace_id"] = external_trace_id
try:
response = AppGenerateService.generate(
session=session,
app_model=app_model,
user=current_user,
args=args,
invoke_from=InvokeFrom.DEBUGGER,
streaming=True,
)
return helper.compact_generate_response(response)
except services.errors.conversation.ConversationNotExistsError:
raise NotFound("Conversation Not Exists.")
except services.errors.conversation.ConversationCompletedError:
raise ConversationCompletedError()
except InvokeRateLimitError as ex:
raise InvokeRateLimitHttpError(ex.description)
except ValueError as e:
raise e
except Exception:
logger.exception("internal server error.")
raise InternalServerError()
@console_ns.route("/apps/<uuid:app_id>/advanced-chat/workflows/draft/iteration/nodes/<string:node_id>/run")
class AdvancedChatDraftRunIterationNodeApi(Resource):
@console_ns.doc("run_advanced_chat_draft_iteration_node")
@console_ns.doc(description="Run draft workflow iteration node for advanced chat")
@console_ns.doc(params={"app_id": "Application ID", "node_id": "Node ID"})
@console_ns.expect(console_ns.models[IterationNodeRunPayload.__name__])
@console_ns.response(View on GitHub (pinned to ef8544b173)
Solutions
- Omit conversation_id (or send null) to start a new conversation for the draft run.
- If continuing an existing thread, obtain a fresh conversation_id from the conversation list for the app.
- Clear the front-end conversation state when a conversation is deleted or completed.
Example fix
// before: sending a stale conversation id
{query:'hi', conversation_id: oldId}
// after: start fresh when in doubt
{query:'hi', conversation_id: null} Defensive patterns
Strategy: validation
Validate before calling
// Validate conversation_id before the draft run
async function conversationExists(appId, convId) {
if (!convId) return true // new conversation
const res = await fetch(`/apps/${appId}/conversations`)
const list = await res.json()
return list.data.some(c => c.id === convId)
}
if (!(await conversationExists(appId, payload.conversation_id))) payload.conversation_id = null Try / catch
try {
return await runDraft(appId, payload)
} catch (e) {
if (e.status === 404 && /Conversation Not Exists/.test(e.message)) {
payload.conversation_id = null; return runDraft(appId, payload)
}
throw e
} Prevention
- Clear conversation_id when the thread is deleted.
- Pull conversation_id from a freshly loaded list.
- Fall back to a new conversation on 404.
When it happens
Trigger: POSTing /apps/{app_id}/advanced-chat/workflows/draft/run with a conversation_id that does not exist or does not belong to the app. The generate path loads the conversation and fails.
Common situations: Stale conversation_id from a deleted/ended conversation; conversation_id from a different app; UUID typo; conversation purged by retention; front-end not clearing conversation_id after the thread was removed.
Related errors
- conversation_completed
- Webhook trigger not found for this node
- Trigger not found
- Conversation Not Exists.
- usage_invalid_flag
AI-assisted analysis of langgenius/dify@ef8544b173 (2026-08-12).
Data as JSON: /api/errors/87e88d77f0858108.
Report an issue: GitHub.