Flows
Flows define what happens during a call. They're the brains of your campaigns—controlling everything from the initial dial to the final hangup.
How flows work
A flow is a directed graph of nodes. Each node performs an action and then routes to the next node based on what happened. Execution starts at a designated start node and continues until it reaches a terminal node (usually a hangup).
┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐
│ Dial │────▶│ Play │────▶│ DTMF │────▶│ Hangup │
└─────────┘ └─────────┘ └─────────┘ └─────────┘
│ │
│ onBusy │ onTimeout
▼ ▼
┌─────────┐ ┌─────────┐
│ Hangup │ │ Hangup │
└─────────┘ └─────────┘Node types
Gomobile supports these node types:
Dial
Places the outbound call
onAnswer, onVoicemail, onNoAnswer, onBusy, onRejected, onError, default
Answer
Answers an inbound call
onSuccess, onError, default
Play
Plays audio to the recipient
onComplete, onError, default
DTMF
Collects keypad input
branches (by digit), onSuccess, onTimeout, onInvalid, onMaxRetries, onError, default
Record
Records the recipient's voice
onComplete, onTimeout, onError, default
Condition
Branches based on variables
onTrue, onFalse, onError
Set Variable
Stores a value for later use
onSuccess, onError, default
Hangup
Ends the call
None (terminal node)
Creating a flow
Here's a complete flow that plays a message and collects a response:
Variables in flows
Flows can read and write variables during execution. Variables come from several sources:
System
sys.callId, sys.contactPhone
Automatically available
Contact
contact.firstName, contact.city
From the contact being called
Custom Attribute
contact.customAttributes.balance
Custom fields on contacts
Flow Variable
customerResponse
Set during execution
Use variables in conditions or to personalize audio playback.
Answering Machine Detection (AMD)
When enableAMD is true on a dial node, Gomobile attempts to detect if a human or machine answered:
Human detected → Routes to
onAnswerMachine detected → Routes to
onVoicemail
This helps you leave voicemail messages instead of playing interactive prompts to answering machines.
Audio playback options
The Play node supports several audio types:
Types include:
audioFile- Pre-recorded audionumber- Dynamic number playbackdate- Dynamic date playbackword- Dictionary-based word playback
Flow validation
Before saving, Gomobile validates your flow:
Every node must be reachable from the start node
All output references must point to existing nodes
Terminal nodes (hangup) shouldn't have outputs
Required configuration must be present
You can validate without saving:
Best practices
Start simple - Get a basic flow working before adding complexity
Handle all outcomes - Every dial result should route somewhere
Use descriptive labels - Makes debugging much easier
Test thoroughly - Use ad-hoc calls to test before launching campaigns
Version carefully - Changing a flow affects all programs using it
Related concepts
Call Flows Guide - Detailed node configuration
Audio Management - Managing audio files
Dictionaries - Dynamic audio for numbers and words
Programs - Using flows in campaigns
Last updated

