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:
- Cadence Step Flow
- Apex Invocable Method
- Queueable Apex with Database.AllowsCallouts
- Named Credential for WATI
- 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:
- Does Cadence Step Flow require manual user interaction from Work Queue to execute?
- Is Cadence Step Flow suitable for backend API automation like WhatsApp sending?
- Has anyone successfully implemented automatic WhatsApp sending from Sales Cadence?
- Would Record Triggered Flow + Apex be a better architecture than Cadence Step Flow?
- Are there limitations with Invocable Apex inside Cadence Step Flow?
Any guidance or recommended architecture would be very helpful.
Thanks!