amazon-web-servicestelephonyamazon-connect

Reference one task from another in a contact flow


I'm building a contact flow which creates a block of tasks in pairs. Ideally, one task in a pair should include a reference to its partner in its description.

I've almost achieved this: When creating the second task, I add a reference type URL and I'm using the $.Task.ContactId attribute, prefixed with the access URL for my instance, i.e.

https://<myurl>.my.connect.aws/connect/contact-trace-records/details/$.Task.ContactID

I'd like to deploy this in more than one Connect instance without having to keep manually editing the contact flow. Is there any way I can specify the access URL as a parameter?


Solution

  • For dynamic attributes like this, you need to call a lambda. The lambda can return the appropriate value and then you can use that returned value to set your reference URL attribute.

    If I was writing the lambda I'd send through the $.Task.ContactID then use Details.ContactData.InstanceARN from the event that gets passed to the lambda to lookup the instance alias via the Connect API DescribeInstance function. You can then build the url in the lambda and send it back.

    More info about using lambdas in a contact flow can be found here