This tutorial explains how to set up a Facebook Help Desk for 'Check Status Journey' (for Abc Broadband, as an example) using Zendesk setup as Custom Integration.
Here is a quick summary of what we will accomplish with this Tutorial
- Customer visits ABC Broadband.
- Clicks Get Started and Check Status Menu.
- Automated Help Desk gathers the Ticket ID to check status
- After checking, the Help Desk presents the Status to the customer. When the Issue Status is either "Solved" or "Closed, then an option to Reopen the ticket is presented to the customer through Quick Reply option.
- If Customer chooses to re-open, then the Help Desk creates a new ticket with details of the old ticket on Zendesk and informs the customer of the new ticket details. Customer is also presented with the option to check another ticket.
- If the Customer chooses not to re-open the Help Desk presents the customer with the option to check another ticket.
- If the Issue Status checked in Step 4 is other than "Solved" or "Closed", then the Help Desk presents the customer with the option to check another ticket.
- If the Customer chooses not to check another ticket, the Help Desk closes the conversation with the Customer.
There are a set of preliminary steps that you need to complete before you begin this tutorial. Check them by clicking the below button:
Flow Set Up
Step 1 - Create Session Data Variables
A session data variable allows temporary storage of data during each execution of a flow. We will need these variables to be available through out the customer journey.
After opening a flow, create the following variables under Session Data by clicking the Settings icon on the top right corner.
Step 2 - Set the Session Key
A Session Key uniquely identifies each run of a flow.
Set the Session Key to facebook.psid under Settings available on the top right corner. This is a one-time configuration for this flow. This is required to resume the flow after receiving message on the Receive Node by maintaining a Session between the Send & Receive steps of the conversation.
Step 3 - Welcome Message and Get Ticket ID
Add a Send Node by dragging Send node onto the flow canvas. Double click on the Send node icon on the canvas, choose Facebook Channel. Configure the Welcome Message and Get the Ticket ID as shown below:
Note: $(facebook.name) will be dynamically replaced by the name of the Customer during the flow execution.
Step 4 - Receive Ticket ID
Add a Receive Node to receive the Ticket ID as a response from your customer. A sample configuration is show below:
Store the customer response under the Session Data tab of the Receive Node. Set it to be stored On-Leaving the node to be used later in the variable id_ticket_cust
Note: The message that the Receive Node receives is stored under the variable sysResponseMessage
Step 5 - Get Ticket Status
Add the TicketStatus Node to the flow (created as part of the Preliminary Set Up) for fetching the Ticket Status.
- Set the Method to "Get Ticket"
- Assign $(id_ticket_cust), the variable which was configured to hold the Ticket ID shared by your customer in step 4. This will be dynamically replaced in the endpoint URL of Get Ticket during flow run-time for fetching the ticket required.
- Go to Response Tab and assign the following variables. The variables received from Zendesk will be mapped to the flow defined variables, so that they can be relayed to the Customer in the confirmation message.
Step 6 - Evaluate the Ticket Status - Evaluate Node -1
Add an Evaluate Node 1 to check if the Ticket Status is either "Closed" or "Solved". A Sample script is shown below:
On Choice 1, set the tag as Closed and on Choice 2, set the tag as Others. These tags will be used for branching out of the Evaluate Node.
Note: After entering the script for the first time, the system will ask to Test the script. Give a sample value as shown below.
Step 7 - Branch Out from Evaluate Node -1 On Choice 1 - Solved /Closed
Branch out of the Evaluate Node 1, created in Step 6, on Choice 1 and Add a Send Node with the details of the ticket. Present the Customer with the choice of Re-opening the ticket through Quick Replies. A sample Configuration is shown below:
Step 8 - Receive Customer Choice On Re-Opening
Add a Receive Node to check if the customer is wants to re-open the ticket. A sample configuration is shown below:
Note: When the customer chooses a quick reply, the response is received as Incoming Message. Hence this option is chosen in the Receive Node for Event Name
Store the customer response in the variable reopen_request to be used in the Evaluate Node next.
Step 9 - Evaluate Customer Response on Re-Open Request - Evaluate Node -2
Add Evaluate Node 2 to Evaluate the customer response on Re-Opening. A sample script is shown below.
On Choice 1, set the tag as Re-open and on Choice 2, set the tag as Continue. These tags will be used for branching out of the Evaluate Node. Test the script before moving to the next step.
Step 10 - Branch Out from Evaluate Node 2 on Choice 2 - Continue
Branch out of the Evaluate Node 2, created in Step 9, on Choice 1 and add a Send Node presenting the Customer with the choice of checking another Ticket through Quick Reply. A sample is shown below:
Step 11 - Receive Customer Response on checking another Ticket
Add a Receive Node to receive if the customer wants to check another Ticket. A sample configuration is shown below:
Store the customer response in the variable new_request to be used on the Evaluate Node next.
Step 12 - Evaluate Customer Response on checking another Ticket - Evaluate Node - 3
Add Evaluate Node 3 to evaluate if the Customer wants to check another Ticket. A sample script is shown below:
On Choice 1, set the tag as Yes and on Choice 2, set the tag as No. These tags will be used for branching out of the Evaluate Node. Test the script before moving to the next step.
Step 13 - Branch Out from Evaluate Node - 3 on Choice 1 - Re-check
Branch out from Evaluate Node 3, created in Step 12, on Choice 1 and add a Send Node to get the Ticket ID to check another ticket. A sample is shown below:
Connect this Send Node to the Receive Node created in Step 4 to continue the process.
Step 14 - Branch Out from Evaluate Node - 3 on Choice 1 - End Flow
Branch out from Evaluate Node 3, created in Step 12, on Choice 1 and add a Send Node to close the conversation with the customer and end the flow. A sample is shown below:
Step 15 - Branch Out from Evaluate Node - 2 on Choice 1 - Re-open
Branch out of the Evaluate Node 2, created in Step 9, on Choice 1 and add the TicketStatus Node (created as part of the Preliminary Set Up).
- Set the Method Name to "Create Ticket".
- Content-Type is auto-populated as the value was already provided in the Custom Node configuration while creating the Integration under Header Section.
- Provide the Ticket Comment details as follows:
- "This is a re-open ticket. Following are the details: Ticket id: $(id_ticket_cust); Ticket Subject: $(subject); Ticket Comment: $(description)". All of the variables are configured in the Receive Node - On Leave event and the TicketStatus Node used earlier and hold the customer response and the Ticket Details. They will be replaced dynamically during flow execution.
- Under the Response Tab, assign the ticket_id generated by the API to a variable called id_ticket_cust to communicate the information to customer.
Step 16 - Send Confirmation to Customer
Add a Send Node to send confirmation to the Customer. A sample configuration is shown below:
Add a delay Node and connect the Delay Node to the Send Node created in Step 10 to present the customer with the choice of checking another Ticket. The flow will proceed to execute from this Node.
Step 17 - Branch Out from Evaluate Node -1 On Choice 2 - Others
Branch out of the Evaluate Node 1, created in Step 6, on Choice 1 and Add a Send Node with the details of the ticket. There will be no Quick Reply button for Re-opening in this case. A sample is shown below:
Add a Delay Node and connect the Delay Node to the Send Node created in Step 10 to present the customer with the choice of checking another Ticket. The flow will proceed to execute from this Node.
Step 18 - Handle Errors/Timeouts/Invalid Choices
It is a good practice to handle all the Errors/Timeouts/Invalid Choices. You can end the flow on all of the above. Here is an example on how to handle it. Add a Send Node to inform the customer that something went wrong and connect all the Error/Timeouts/Invalid Choices edges to this node. End the flow on this Send Node. End the flow on Error edge of this flow. A sample is shown below:
Rule to activate the flow
Publish the flow before creating a Rule.
- Create a Rule to invoke the flow.
- Set the Event to Postback
- Set the Condition to facebook-postback.payload EQUALS status. status is the payload set for the Persistent Menu corresponding to New Connection Request
- Invoke the flow when the above Event and Conditions are met.
Note: While setting the Rule to Active State, ensure that the Start Time is in UK timezone as the servers are in UK timezone.
For more details on how to set up a Rule, refer here. A sample is shown below: