Using N8N with Dify for a automated Whatsapp Chatbot

Hello, I’m using n8n alongside Dify and Z-API to make a automated Whatsapp chatbot. Unfortunately I’m having a issue that every message on whatsapp the bot acts like each message is a different conversation, that causes him to never remember any past information. On my HTTP Request to the Z-API (the last node) I do push the conversation_id, so I don’t know what is the issue. On n8n is there anything else that I need to do?

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

n8n online version and Windows

Hi there, it’s hard to visualize what you’re doing given the information provided. Could you provide your workflow (you can paste it inside Preformatted text </>). Also a screenshot of your input log in Z-API would probably help too.

Hi!

In your HTTP Request Node to Dify make sure to add the user key to the JSON body. It seems Dify keep track of conversations using this parameter instead of conversation_id (a bit unintuitive).

This is the complete JSON i have in my workflow and it works without perfect:

{
    "inputs": {},
    "query": "The query from the user",
    "response_mode": "blocking",
    "conversation_id": "",
    "user": "{{ ID of the WhatsApp user  }}"
}

Hope it helps.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.