Self Checks
Dify version
1.3.0
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
I'm injecting the script below to load an existing conversation_id, but the chat always starts as a new conversation, creating a new conversation_id, instead of loading the one I passed.
<script>
window.difyChatbotConfig = {
token: 'token',
baseUrl: 'https://mydomain',
systemVariables: {
// user_id: '47433ef6-345b-4c0f-ac33-39e00de43e7d',
conversation_id: 'e87a4c48-f72a-4150-92d7-3ba545791dee'
},
}
</script>
<!-- Chatbot Script -->
<script src="https://mydomain/embed.min.js" id="id" defer></script>
🧪 What I'm seeing
Even when I pass a valid conversation_id, a new conversation is started.
When I include a user_id, I can see in the network tab that the existing conversations for that user are correctly listed via:
GET /api/conversations?limit=100&pinned=false
However, when a message is sent (with the user_id present), the system still creates a new conversation_id, instead of continuing the one I specified.
✅ What I want to achieve
In my app’s dashboard, I need to load an existing conversation_id, which was previously created by an automated backend process via API.
Current flow:
- Front-end calls a backend endpoint that creates a new chat via API.
- This endpoint returns a
conversation_id.
- The front-end should then load the chatbot using this specific
conversation_id.
Initially, I tried using an <iframe>, but it didn’t work as expected. Then I moved to embed.min.js, but got the same issue — the conversation_id is ignored and a new one is always created.
🤔 Any idea what's going wrong?
If this is not an issue, would love any guidance on how to correctly inject and resume a conversation using a known conversation_id.
✔️ Expected Behavior
When providing a valid conversation_id via window.difyChatbotConfig, the chatbot should load and resume the existing conversation, instead of creating a new one.
If both user_id and conversation_id are provided:
- The chat should continue exactly from the given
conversation_id context.
- No new
conversation_id should be created unless explicitly requested.
❌ Actual Behavior
Even when a valid conversation_id is provided through window.difyChatbotConfig, the chatbot starts a new conversation every time it loads.
- A new
conversation_id is generated, ignoring the one passed.
- If a
user_id is provided, the API correctly fetches the list of existing conversations for that user (/api/conversations?...), but sending a message still creates a new conversation instead of continuing the specified one.
This breaks the expected behavior of resuming an existing conversation, and makes it impossible to preload or control chat history from the frontend.
Self Checks
Dify version
1.3.0
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
I'm injecting the script below to load an existing
conversation_id, but the chat always starts as a new conversation, creating a newconversation_id, instead of loading the one I passed.🧪 What I'm seeing
Even when I pass a valid
conversation_id, a new conversation is started.When I include a
user_id, I can see in the network tab that the existing conversations for that user are correctly listed via:However, when a message is sent (with the
user_idpresent), the system still creates a newconversation_id, instead of continuing the one I specified.✅ What I want to achieve
In my app’s dashboard, I need to load an existing
conversation_id, which was previously created by an automated backend process via API.Current flow:
conversation_id.conversation_id.Initially, I tried using an
<iframe>, but it didn’t work as expected. Then I moved toembed.min.js, but got the same issue — theconversation_idis ignored and a new one is always created.🤔 Any idea what's going wrong?
If this is not an issue, would love any guidance on how to correctly inject and resume a conversation using a known
conversation_id.✔️ Expected Behavior
When providing a valid
conversation_idviawindow.difyChatbotConfig, the chatbot should load and resume the existing conversation, instead of creating a new one.If both
user_idandconversation_idare provided:conversation_idcontext.conversation_idshould be created unless explicitly requested.❌ Actual Behavior
Even when a valid
conversation_idis provided throughwindow.difyChatbotConfig, the chatbot starts a new conversation every time it loads.conversation_idis generated, ignoring the one passed.user_idis provided, the API correctly fetches the list of existing conversations for that user (/api/conversations?...), but sending a message still creates a new conversation instead of continuing the specified one.This breaks the expected behavior of resuming an existing conversation, and makes it impossible to preload or control chat history from the frontend.