Skip to content

How to pass data from Journey flow lambda (Custom action) into the Contact flow for outbound campaigns?

0

We're building an agentless outbound campaign in Amazon Connect. In the Journey flow, we have a Custom action block that invokes a Lambda function. The lambda receives a batch of customer profiles, calls an external API to fetch account summary data (balance, payment due, etc.), and returns it as ResultData per profile.

The problem is we need this account data to be available in the Contact flow (the flow that runs when the customer answers the call) so we can play a personalised prompt. However, $.LambdaInvocation.ResultData is only available within the Journey flow itself. The Journey flow only allows setting flow attributes (not user-defined contact attributes), and flow attributes are scoped to the current flow and don't carry over when the contact is routed to the Contact flow on answer.

Is there a supported way to pass data from a Journey flow Custom action lambda result into the Contact flow? Or is the recommended approach to skip the Journey flow lambda entirely and do the API lookup directly inside the Contact flow using the Customer Profiles block + a Lambda invocation?

1 Answer
0

Based on the current architecture of Amazon Connect outbound campaigns, the Lambda function invoked in a Journey flow through a Custom action block is designed to process customer profiles and return results that determine campaign execution decisions within that Journey flow context. The data returned from this Lambda function is scoped to the Journey flow and does not automatically carry over to the Contact flow that executes when a customer answers the call.

The recommended approach for your use case would be to perform the API lookup for account summary data (balance, payment due, etc.) directly within the Contact flow itself rather than in the Journey flow. In your Contact flow, you can:

  1. Add an AWS Lambda function block that retrieves the customer data from your external API
  2. Use a Set contact attributes block after the Lambda function block to store the returned values as user-defined contact attributes
  3. Reference these attributes throughout your Contact flow to play personalized prompts

When configuring the Set contact attributes block, you would select "Use attribute" and choose "External" as the Type. Then map each attribute returned from your Lambda function (such as balance, payment due date, etc.) to destination keys that you can reference later in your flow for personalization.

This approach ensures that the account data is available within the Contact flow context where you need it for playing personalized prompts, rather than trying to pass data between the Journey flow and Contact flow contexts, which are separate execution environments.
Sources
Store a value from a Lambda functions as a contact attribute in Amazon Connect - Amazon Connect
Grant Amazon Connect access to your AWS Lambda functions - Amazon Connect
Invoke Lambda functions - Amazon Connect

answered 2 months ago
EXPERT
reviewed 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.