Hey everyone, I’m stuck with my n8n project. I’m trying to get multiple responses from users through WhatsApp. My workflow gets the first message okay, but I can’t figure out how to grab the second one. I’ve tried a few things like using extra webhooks and messing with the Meta API, but no luck. Has anyone cracked this? Here’s a bit of what I’m working with:
I’ve faced a similar challenge with n8n and WhatsApp. One approach that worked for me was implementing a state management system. You can use the ‘Set’ node to store the initial response, then set up a loop with a ‘Wait’ node to listen for subsequent messages. The key is to use a unique identifier (like the user’s phone number) to track the conversation state.
Another method is to leverage n8n’s ‘Function’ node to create custom logic that maintains the conversation context. This allows you to build a more complex interaction flow, handling multiple inputs sequentially.
Remember to properly handle timeouts and edge cases. It’s not a straightforward process, but once you get it working, it’s quite powerful for creating interactive WhatsApp workflows.
have u tried using webhook node with unique endpoints? i did it and it worked well. using webhook ID to track messages is key. ensure different timeouts on each so they dont overlap
I’ve actually tackled this issue before in my n8n projects. What worked for me was implementing a queue system using Redis. Essentially, you set up a Redis instance to store incoming messages, then use n8n’s Redis nodes to poll for new messages at regular intervals. This way, you can process multiple messages in sequence without losing context.
The tricky part is managing the conversation state, but you can use the user’s WhatsApp ID as a key in Redis to keep track of where each user is in the conversation flow. It’s a bit complex to set up initially, but it’s robust and scalable once you get it running.
Just make sure to implement proper error handling and rate limiting to avoid any issues with the WhatsApp API. Also, consider adding a timeout mechanism to close inactive conversations and free up resources.