Table of Contents

WhatsApp: Show a Different Flow on Return Visits

Desirรฉe M Updated by Desirรฉe M

In WhatsApp bots, once the conversation reaches the last block, any new message from the user restarts the bot from the beginning. Without a workaround, returning users would go through the exact same flow every time.

This article shows you how to detect whether someone has visited before and route them through a different path on their second visit.

๐Ÿ’ก How it works: You use a Field to "remember" that a user has already completed the flow. The first time someone chats, that Field is empty. At the end of the flow, you set it to a value. The next time they return, the bot checks that Field and sends them down a different path.

๐Ÿ› ๏ธ Setting it up

Capture the user's first message

Place a Collect Intent block right at the start of your flow. This block captures whatever the user sends first and saves it in a Field called @user_input.

Check if they've been here before

Add a Conditions block right after. Set it up to check whether a Field called @returning_visitor has a value or not.

Connect the outputs to the right paths:

๐Ÿ”ด False (empty) โ€“ first visit. Connect to your main flow.

๐ŸŸข True (has value) โ€“ returning visitor. Connect to your second visit flow.

Mark them as a returning visitor

At the very end of your main flow, add a Set a Field block. Set @returning_visitor to yes.

This means the next time this user messages your bot, the Conditions block will detect the value and route them through the returning visitor path instead.

โ“ FAQ

What happens if a user messages the bot before reaching the last block?

The @returning_visitor Field only gets set at the end of the flow, so if a user drops off mid-conversation, they'll go through the main flow again next time. This is usually the desired behavior since they didn't complete it the first time.

Can I create more than two paths, for example a third visit flow?

Yes. You can add extra Conditions blocks that check for different Field values. For example, set @returning_visitor to visit_2 after the second flow ends, then check for that value to route users to a third path.

Was this article helpful?

WhatsApp bots - Feature Compatibility Guide

WhatsApp - Get user out of error message loop

Contact