Using the Salesforce Voice Lambda Functions for Amazon Connect

Salesforce provides a set of Lambda functions, which are available within your Amazon Connect instance after provisioning the instance with Salesforce Voice. You can use these Lambdas in Amazon Connect contact flows.

These Lambdas interact with Salesforce to perform the following actions:

For more detail, refer to the reference pages for the Lambda functions.

  • How to Use Salesforce Lambda Functions

    Salesforce provides several Lambda functions for use in your Voice contact flows. These functions are used by the sample contact flows, and you can also use them in your own contact flows.

  • Salesforce Voice Authentication When Using InvokeSalesforceRestApiFunction

    OAuth is required if you want to use the InvokeSalesforceRestApiFunction Lambda function. If you need to set up or modify the OAuth, refer to these instructions.

  • InvokeSalesforceRestApiFunction Lambda Function

    This Lambda function calls the Salesforce REST API. You can place this Lambda function within a contact flow to create, update, or query Salesforce records.

  • InvokeTelephonyIntegrationApiFunction Lambda Function

    The invokeTelephonyIntegrationApi function contains actions which orchestrate voice call handling and routing. The function integrates telephony events with Salesforce, ensuring calls are properly processed and directed through the appropriate Omni-Channel logic. It also calls Voice integration APIs directly from an Amazon Connect contact flow. It receives request parameters from the flow, invokes the appropriate voice API endpoint, and returns the structured response back to the contact flow for further logic processing.

  • ContactLensConsumerFunction Lambda Function

    This Lambda function gets real-time transcripts and intelligence signals generated from Contact Lens for Amazon Connect and sends them to the ContactLensProcessorFunction Lambda function.

  • ContactLensProcessorFunction Lambda Function

    This Lambda function processes real-time transcripts and intelligence signals generated from Contact Lens for Amazon Connect and sends them to Salesforce. This Lambda function is invoked by the ContactLensConsumerFunction Lambda function with the generated real-time transcripts and events.

  • ContactDataSync Lambda Function

    This Lambda function fetches real-time transcripts generated by Contact Lens for Amazon Connect and uploads them to Salesforce using the Connect REST API. You can manually invoke this function to backfill missing transcripts in bulk. For multi-org use cases, the function reads the secretName and accessTokenSecretName from its payload and fetches the correct configuration values from the fetched secretName.

  • CTRDataSyncFunction Lambda Function

    After the contact record (previously called contact trace record or CTR) is created in Amazon, this Lambda function automatically syncs contact record data to the VoiceCall object. It finalizes the values of multiple VoiceCall object fields.

  • HandleContactEventsFunction Lambda Function

    This Lambda function handles the disconnect event for a missed or abandoned call and ensures that the PendingServiceRouting (PSR) record is cleaned up in Salesforce. This function is automatically invoked by an Amazon EventBridge rule after a disconnect. You don’t need to call this function manually.

  • JwtTokenRotatorFunction Lambda Function

    The JwtTokenRotatorFunction lambda function generates a JSON Web Token (JWT) and stores it in AWS Secrets Manager so that Amazon Connect can authenticate its connection to Salesforce to support real-time streaming for Agentforce Voice on Amazon Connect.

  • MultiorgContactLensConsumerFunction Lambda Function

    This Lambda function gets real-time transcripts and intelligence signals generated from Contact Lens for Amazon Connect and sends them to the ContactLensProcessorFunction Lambda function.

  • MultiorgHandleContactEventsFunction Lambda Function

    This Lambda function handles the disconnect event for a missed or abandoned call, and ensures that the Pending Service Routing (PSR) record is cleared in Salesforce.

  • MultiorgPostCallAnalysisTriggerFunction Lambda Function

    This Lambda function automatically gets sentiment data from a contact center’s Amazon S3 bucket for post call analysis.

  • MultiorgVoiceMailPackagingFunction Lambda Function

    This Lambda function creates a VoiceCall record, attaches the voicemail recording and transcription files to the record, and routes it to the Omni-Channel flow.

  • PostCallAnalysisTriggerFunction Lambda Function

    This Lambda function automatically gets sentiment data from a contact center’s Amazon S3 bucket for post-call analysis.

  • RealtimeAlertLambda Lambda Function

    This Lambda publishes the RealtimeAlertEvent platform event using the Salesforce REST API. This function is called by CloudWatch alarms in your Amazon Connect instance. You don’t need to call this function manually.

  • VoiceMailAudioProcessingFunction Lambda Function

    This Lambda function processes voicemail recordings.

  • VoiceMailPackagingFunction Lambda Function

    This Lambda function creates a VoiceCall record, attaches the voicemail recording and transcription files to the record, and routes it all to the Omni-Channel flow.

  • VoiceMailTranscribeFunction Lambda Function

    This Lambda function transcribes voicemail recordings.

  • kvsConsumerTrigger Lambda Function

    This Lambda function is the initiation point for starting real-time transcription.

  • kvsTranscriber Lambda Function

    This Lambda function does the actual real-time transcription work. This function is not directly invoked from a contact flow. It is triggered by the kvsConsumerTrigger Lambda function. You do not need to call this function manually.

  • Query AWS Lambda Functions to Analyze a Voice Call

    Query AWS Lambda function logs and Amazon Connect flows, and use the query results to analyze and troubleshoot the events that happen throughout the stages of a single voice call.

See Also