Architecting Serverless Orchestration for Multi-Channel Campaign Blending

Architecting Serverless Orchestration for Multi-Channel Campaign Blending

What This Guide Covers

  • Breaking down the silos between Genesys Cloud Outbound Dialing, SMS campaigns, and Email marketing.
  • Architecting a serverless AWS Step Functions state machine to orchestrate multi-touch, omnichannel outbound campaigns based on real-time customer behavior and historical engagement data.
  • The end result is a highly personalized “Blended” outbound strategy where a failed Voice call automatically triggers an SMS, followed by an Email, without manual list scrubbing or redundant API calls.

Prerequisites, Roles & Licensing

  • Licensing: Genesys Cloud CX 2 or 3 (with Outbound capabilities).
  • Permissions: Outbound > Campaign > Edit, Integrations > Action > Execute.
  • Infrastructure: AWS Step Functions, Amazon EventBridge, AWS Lambda, and an active Genesys Cloud OAuth Client (Client Credentials Grant).

The Implementation Deep-Dive

1. The Flaw of Siloed Outbound Campaigns

Standard contact center operations often run three entirely separate campaigns for the same objective (e.g., debt collection): a predictive dialer campaign, an SMS blast, and a marketing email sequence.

The Trap:
If these campaigns run in isolation, the customer experience degrades rapidly. A customer might answer the predictive voice call and pay their bill at 9:00 AM, but still receive the automated “Payment Due” SMS at 10:00 AM because the SMS list was generated the night before. This leads to customer frustration and increased inbound volume (“I just paid this, why are you texting me?”). You must orchestrate these channels chronologically based on real-time dispositions.

2. The Serverless Orchestration Architecture

We will use AWS Step Functions to act as the “Brain” of the campaign. Genesys Cloud will execute the individual touches (Voice, SMS, Email), but Step Functions will control the timeline and conditional logic.

Architectural Overview:

  1. The Trigger: A CRM event (e.g., “Invoice 30 days overdue”) fires an API call to start an AWS Step Function execution for that specific customer.
  2. Touch 1 (SMS): The Step Function triggers a Lambda that calls the Genesys Cloud Agentless SMS API. It then enters a Wait state for 24 hours.
  3. The EventBridge Hook: If the customer clicks the payment link in the SMS, the backend CRM fires an event to AWS EventBridge. EventBridge intercepts the running Step Function and safely terminates it (Success).
  4. Touch 2 (Voice Dialer): If the 24 hours expire without a payment event, the Step Function triggers a Lambda that calls the Genesys Cloud Outbound Campaign API to dynamically inject the customer into a high-priority predictive dialing list.
  5. Disposition Loop: If the Voice call results in a “No Answer” wrap-up code, EventBridge sends that disposition back to the Step Function, triggering Touch 3 (an Email).

3. Step Functions Implementation (The State Machine)

The visual workflow logic is defined in Amazon States Language (ASL).

Example ASL Snippet (Multi-Touch Sequence):

{
  "StartAt": "SendInitialSMS",
  "States": {
    "SendInitialSMS": {
      "Type": "Task",
      "Resource": "arn:aws:lambda:REGION:ACCOUNT:function:GenesysAgentlessSMS",
      "Next": "WaitForPaymentOrTimeout"
    },
    "WaitForPaymentOrTimeout": {
      "Type": "Wait",
      "Seconds": 86400,
      "Next": "CheckPaymentStatus"
    },
    "CheckPaymentStatus": {
      "Type": "Task",
      "Resource": "arn:aws:lambda:REGION:ACCOUNT:function:CheckCRMForPayment",
      "Next": "PaymentChoice"
    },
    "PaymentChoice": {
      "Type": "Choice",
      "Choices": [
        {
          "Variable": "$.paymentStatus",
          "StringEquals": "PAID",
          "Next": "CampaignSuccess"
        }
      ],
      "Default": "InjectToVoiceDialer"
    },
    "InjectToVoiceDialer": {
      "Type": "Task",
      "Resource": "arn:aws:lambda:REGION:ACCOUNT:function:GenesysOutboundContactListInsert",
      "Next": "EndCampaign"
    },
    "CampaignSuccess": {
      "Type": "Succeed"
    },
    "EndCampaign": {
      "Type": "Pass"
    }
  }
}

4. The Genesys API Payloads (Lambdas)

Your Lambda functions act as the “hands” of the Step Function, executing the specific Genesys Cloud API endpoints.

Lambda 1: Agentless SMS

import requests
# Call POST /api/v2/conversations/messages/agentless
payload = {
  "fromAddress": "+18005550199",
  "toAddress": event['customerPhone'],
  "toAddressMessengerType": "sms",
  "textBody": f"Hi {event['customerName']}, your invoice is overdue. Please pay here: {event['paymentLink']}"
}

Lambda 2: Dynamic Contact List Insertion (Voice)
If the SMS fails, we don’t upload a CSV. We dynamically append the single contact to an active Voice campaign.

import requests
# Call POST /api/v2/outbound/contactlists/{contactListId}/contacts
payload = [{
  "data": {
    "Phone": event['customerPhone'],
    "FirstName": event['customerName'],
    "Priority": "HIGH"
  },
  "callable": True
}]

Validation, Edge Cases & Troubleshooting

Edge Case 1: The “Do Not Call” (DNC) Race Condition

  • The Failure Condition: The customer receives the SMS. They reply “STOP” (opting out). 24 hours later, the Step Function injects them into the Voice dialer list. They receive a phone call, violating TCPA compliance regulations.
  • The Root Cause: The Step Function is unaware of DNC status changes that occur natively within the Genesys Cloud SMS gateway.
  • The Solution: The Lambda function that injects contacts into the Voice campaign (POST /api/v2/outbound/contactlists/...) must first perform a synchronous check against the internal Genesys Cloud DNC list (GET /api/v2/outbound/dnclists/{dncListId}/phonenumbers/{phoneNumber}). If the number exists on the DNC list, the Lambda returns a DNC_Active flag to the Step Function, which branches to a Fail or Email-Only state.

Edge Case 2: Concurrency and API Rate Limits

  • The Failure Condition: Marketing uploads a list of 500,000 customers to the CRM. The CRM triggers 500,000 concurrent AWS Step Function executions. All 500,000 executions immediately trigger Lambda 1 to send an Agentless SMS. Genesys Cloud returns 429 Too Many Requests, crashing the entire campaign.
  • The Root Cause: Serverless architectures scale infinitely, but vendor APIs (Genesys) have strict rate limits (e.g., 300 requests per minute).
  • The Solution: Implement SQS Buffering or Step Function Distributed Maps with concurrency limits. Place an Amazon SQS queue between the CRM and the Step Function execution trigger. Configure the Lambda consuming the SQS queue to pull exactly 50 records per minute, acting as a governor valve to ensure you never breach the Genesys Cloud API threshold.

Official References