Search code examples
twiliotwilio-conversations

How to separate Test and Prod environment for WhatsApp Studio Flow?


I have bought two Twilio phone numbers which are validate and configured by Twilio and WhatsApp.

I created two Conversation Services ("Main Conversation Service" (SID:IS1234) and "Dev Conversation Service" (SID:IS4321)

  • Both are configured as "Engage in a discussion" Use case configuration.
  • Both are configured as "Autocreate a Conversation" in the Integration configuration.
  • Each service has a different phone number configured in the Sender Pool
  • Each WhatsApp Sender number Endpoint Configuration is configured a "Use Messaging Service (recomended)" with its respective Conversation Service

I have 2 Studio Flows ("WA_MAIN" and "WA_DEV"). In Flex > Manage > Messaging I have 2 WhatsApp addresses pointing each phone number to its respective Studio Flow.

This is the complete configuration, if something important is missing please ask me in the comments.

When I send a whatsapp message to each number the conversation is routed to the correct Studio Flow, but it is managed by the Main Conversation Service (IS1234), which is the older one. I have zero conversations in Dev Conversation Service (IS4321). All previous conversations with my phone number are in "closed" state.

Why is this happening? How can I build to independent environments to work with Conversations API without risking the SLA of Production environment?


Solution

  • This happens because of a Conversation Configuration where you configure the default messaging service that will handle the inbound conversations, you can see it on Conversations > Manager > Defaults.

    The Twilio Team advises creating a new account to Homolog or Staging, so it's can be a solution to not affect your production environment.

    I hope that it can help you.