Skip to main content

Hi Everyone,

I am trying to implement WhatsApp messaging through Salesforce Sales Engagement Cadences using WATI API integration, but I am facing issues with Cadence Step Flow execution and variable passing.

Current Architecture:

Contact Record Triggered Flow

→ Add Contact to Cadence

→ Cadence Step Flow

→ Apex Invocable Action

→ Queueable Apex

→ WATI API Callout

My goal:

When a contact reaches a cadence step, I want to automatically send a WhatsApp template message through WATI.

What I have implemented:

  1. Cadence Step Flow
  2. Apex Invocable Method
  3. Queueable Apex with Database.AllowsCallouts
  4. Named Credential for WATI
  5. Formula payload generation in Flow

Current Flow Payload:

959585****|||abd|||{"name":"Rakesh"}

Invocable Apex:

public with sharing class WatiWhatsAppService {

public class Request { @InvocableVariable(required=true) public String rawInput; } @InvocableMethod( label='Send WATI WhatsApp Message' description='Cadence-compatible WhatsApp action.' ) public static void sendWA(List<Request> requests) { List<String> rawInputs = new List<String>(); for(Request req : requests){ if(String.isNotBlank(req.rawInput)){ rawInputs.add(req.rawInput); } } System.enqueueJob(new WatiQueueable(rawInputs)); } 

}

Issue:

  • Cadence Step Flow is not executing automatically
  • Sometimes the flow step does not launch from cadence
  • Input variables like MobilePhone and FirstName were initially blank
  • I fixed variable mapping using input variables
  • Formula payload is now generating correctly
  • Apex action now appears in flow correctly
  • However, cadence screen flow execution itself is inconsistent

Questions:

  1. Does Cadence Step Flow require manual user interaction from Work Queue to execute?
  2. Is Cadence Step Flow suitable for backend API automation like WhatsApp sending?
  3. Has anyone successfully implemented automatic WhatsApp sending from Sales Cadence?
  4. Would Record Triggered Flow + Apex be a better architecture than Cadence Step Flow?
  5. Are there limitations with Invocable Apex inside Cadence Step Flow?

Any guidance or recommended architecture would be very helpful.

Thanks! 

#Salesforce Developer #Apex #Sales Cadences #Flow

3 comments
0/9000