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).Node types
Gomobile supports these node types:| Node | Purpose | Outputs |
|---|---|---|
| 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:| Source | Example | Description |
|---|---|---|
| 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 |
Answering Machine Detection (AMD)
WhenenableAMD is true on a dial node, Gomobile attempts to detect if a human or machine answered:
- Human detected → Routes to
onAnswer - Machine detected → Routes to
onVoicemail
Audio playback options
The Play node supports several audio types: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
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.