Create a Contact Flow and Test

You start in your Amazon Connect instance. If you don't have your instance open, you can navigate there by entering amazon connect in the Find Services, click on your instance alias | Login URL | enter your Amazon Connect admin credentials if prompted. 

  1. On your Amazon Connect instance, under Routing, select Contact flows.Amazon Connect instance, Routing menu open and Contact flow highlighted by a red box and arrow
  2. Click Create contact flow.

Construct Your Contact Flow

From here, you’re going to create a contact flow. It involves dragging specific flow actions into a grid and connecting them together. You also modify the attributes of some of these actions.

The flow is complex. So, take your time and make sure you’ve connected the Success and Error points correctly. Double check to ensure you’ve set up the attributes of these actions correctly as well. And make sure you save your progress along the way.

  1. Give your Contact flow a fun name.
  2. Under Set, drag Set logging behavior into the frame next to Entry point.
  3. Connect Entry point Start to Set logging behavior.
  4. Under Set, drag Set voice into the frame next to Set logging behavior.
  5. Connect Set logging behavior Success to Set voice.
  6. Under Interact, drag Store customer input into frame under Entry point.
  7. Connect Set voice Success to Store customer input.
  8. Double-click Store customer input. In the popup, select the following:
    1. Under Prompt, select Text-to-speech or chat text.
    2. Then, select Enter text.
    3. Enter Please enter your phone number. in the field.
    4. Under Customer input, select Phone number.
    5. Then, select international format/Enforce E.164.
    6. Click Save.
  9. Under Integrate, drag Invoke AWS Lambda function next to Store customer input.
  10. Connect Store customer input Success to Invoke AWS Lambda function.
  11. Double-click Invoke AWS Lambda function. In the popup:
    1. Ensure Select a function is selected.
    2. Select the Lambda function you just connect to your Amazon Connect instance.
    3. Then, click Add a parameter.
    4. Ensure Use text is selected.
    5. Destination key: sf_operation
    6. Value: phoneLookup
    7. Then, click Add another parameter.
    8. This time, ensure Use attribute is selected.
    9. Destination key: sf_phone
    10. Type: System
    11. Attribute: Stored customer input
    12. Click Add another parameter, again.
    13. Ensure Use text is selected.
    14. Destination key: sf_fields
    15. Value: Id, Name
    16. Set Timeout to 8.
    17. Then, click Save.
  12. Under Interact, drag Play prompt next to Invoke AWS Lambda function.
  13. Connect Invoke AWS Lambda function Success to Play Prompt.
  14. Double-click Play prompt. In the popup:
    1. Select Text-to-speech or chat text.
    2. Ensure Enter text is selected.
    3. Enter Hello $.External.Name. Thank you for calling. In the field.
    4. Click Save.
  15. Under Interact, drag another Play prompt under Invoke AWS Lambda function.
  16. Connect Store customer input Invalid number and Error to the second Play prompt.
  17. Also connect Invoke AWS Lambda function Error to the second play prompt.
  18. Double-click the second Play prompt. In the popup:
    1. Select Text-to-speech or chat text.
    2. Ensure Enter text is selected.
    3. Enter I’m sorry, we encountered an error. in the field.
    4. Click Save.
  19. Under Terminate / Transfer, drag Disconnect next to a Play prompt.
  20. Connect both Play prompt Okay’s to Disconnect.the complete flow named DataDipFlow, configured as described above
  21. Now, click Publish to publish your Contact flow.

Assign Your Flow to Your Amazon Connect Phone Number

To test out the flow, assign it to your Amazon Connect phone number.

  1. Select Phone numbers from the Routing menu.
  2. Click the phone number you’ve provisioned for your Amazon Connect instance.
  3. Under Contact flow/IVR, select the flow you created.
  4. Then, click Save.

Test the Contact Flow

Remember the contact phone number you saved to test the Lambda app. Have it handy. You test it out here as well.

  1. Dial the Amazon Connect phone number.
  2. When prompted, enter the contact phone number you copied from your contact record. Ensure it’s in E.164 format, like this 1-785-241-6200. You get a greeting with the contact's name. If you entered the number incorrectly, or let the 8-second time limit lapse, you get the error message.

You’ve accomplished quite a bit! You’ve installed a serverless package and tested it, configured Amazon Connect to use a Lambda function, created a new contact flow, and tested that contact flow.

Next, you release your Amazon Connect phone number, and shut down your secret and key. This is critical so your AWS account doesn’t get charged.

Release Your Amazon Connect Phone Number

  1. Navigate to the Amazon Connect admin page.
  2. Log in to your Amazon Connect instance.
  3. Under Routing, select Queues.
  4. Select BasicQueue.
  5. Remove the phone number from Outbound caller ID number. Click the x.
  6. Click Save.
  7. Under Routing, select Phone numbers.
  8. Check the box next to your phone number.
  9. Click Release, then Remove.

Delete Your Secret

  1. Head back to AWS.
  2. Navigate to AWS Secrets Manager.
  3. Click your secret.
  4. Click Actions, then select Delete secret.
  5. Enter 7 for your waiting period days.
  6. Select Schedule deletion.

Remove Your Key

  1. Head to Key Management Service.
  2. Select Customer managed keys.
  3. Select your key.
  4. Click Key actions, then select Schedule key deletion.
  5. Enter 7 for your waiting period days.
  6. Check the box next to Confirm that you want to delete this key in 7 days.
  7. Click Schedule deletion.

This was a challenging project, but you made it through and built the foundation for excellent customer service. You’ve integrated Amazon Connect, AWS Lambda, and Salesforce. You've automated tasks to help keep your agents efficient. And you've customized the interactive voice response (IVR). Good job!

Keep learning for
Sign up for an account to continue.
What’s in it for you?
  • Get personalized recommendations for your career goals
  • Practice your skills with hands-on challenges and quizzes
  • Track and share your progress with employers
  • Connect to mentorship and career opportunities