This example shows how you can collect data from a customer in Amazon Connect, pass that to Salesforce via REST API and invoke a flow that analyzes the data and returns routing destinations as requested. This is intended to demonstrate how existing routing logic built in Salesforce Flows can be used with Service Cloud Voice and Amazon Connect to control routing.
NOTE: This example has been configured for Service Cloud Voice only. Modifications would need to be made to support routing in a non-SCV environment.
This example relies on configuration in Salesforce to work appropriately. The components used are:
- Salesforce
- Queues
- Skills
- Users
- Service Resources (agents) with skills assigned
- Apex Classes
- Flows
- AWS
- AWS Lambda function
- Amazon Connect contact flow
- Amazon Connect Queues
- Customer calls into Amazon Connect
- Contact flow invoked to get intent, subintent, and possibly focus
- Lambda passes received values from Lex to flow via REST API to get routing targets
- Flow finds an agent with the appropriate skills and a matching queue
- Flow returns the targets to Lambda
- Lambda processes the response to generate routable targets for Amazon Connect
- Amazon Connect first tries to direct route to matched agents, if provided. If agent is online andavailable, call is route to agent
- Next, if an agent was not found, call is routed to received queue
- Agent connects to customer
While this example invokes a flow, you could just as easily do a simple query using parameters gathered in Connect, or do a lookup in a custom table in Salesforce, or find the data in whatever makes sense for the use case. The critical piece is receiving the destination in a predictable format, and then formatting that data so that it becomes a routable destination, such as a queue ARN or an agent ID.
This is simply an example that shows how one could approach this use case. There are cerrtainly other ways to accomplish this type of routing and there are obvious considerations that need to be made with this approach. This example is intended to guide thought, not to serve as a strict description of how one should accomplish data-directed routing.
To install this example, start with the prep instructions.