Flow Building Blocks Reference
This section provides comprehensive API documentation for each flow block available in Switchboard. Flow blocks are the core building units for creating Amazon Connect contact flows.
Block Categories
Interact
Blocks that interact with customers through prompts and input collection.
- PlayPrompt - Play audio or text-to-speech to the customer
- GetCustomerInput - Collect DTMF or voice input from customers
- StoreCustomerInput - Securely capture and encrypt sensitive input
- HoldCustomerOrAgent - Place customer or agent on hold
Check
Blocks that evaluate conditions and branch the flow accordingly.
- CheckContactAttribute - Branch based on contact attribute values
- CheckHoursOfOperation - Branch based on business hours
- CheckStaffing - Branch based on agent availability
- CheckQueueStatus - Branch based on queue metrics
Integrate
Blocks that integrate with external systems and other flows.
- InvokeLambda - Call AWS Lambda functions
- InvokeFlow - Transfer to another contact flow
Set
Blocks that configure contact properties and behaviors.
- SetContactAttributes - Set or update contact attributes
- SetLoggingBehavior - Enable or disable flow logging
- SetRecordingBehavior - Control call recording
- SetWhisperFlow - Configure whisper flows for agents
- SetQueueMetrics - Retrieve queue statistics
- SetCallback - Configure callback settings
Terminate
Blocks that end or transfer the contact flow.
- Disconnect - End the contact
- EndFlowExecution - End the current flow without disconnecting
- TransferToQueue - Transfer to an agent queue
- TransferToFlow - Transfer to another flow
- TransferToThirdParty - Transfer to external phone number
Logic
Blocks that control flow execution logic.
Common Patterns
Error Handling
Most blocks support error handling through .OnError():
csharp
.PlayPrompt("Welcome!")
.OnError(error => error
.PlayPrompt("Technical difficulties. Please try again.")
.Disconnect())Branch Continuation
Use .ThenContinue() to explicitly continue to the next action after a branch:
csharp
.GetCustomerInput("Press 1 for Sales, 2 for Support")
.OnDigit("1", sales => sales
.SetContactAttributes(attrs => attrs["Department"] = "Sales")
.ThenContinue()) // Continue to next action after this branch
.OnDigit("2", support => support
.SetContactAttributes(attrs => attrs["Department"] = "Support")
.ThenContinue())
.TransferToQueue("General") // Both branches continue hereJoin Points
Use .JoinPoint() and .ContinueAt() for complex flow convergence:
csharp
.PlayPrompt("Welcome!", "MainMenu")
.GetCustomerInput("Press 1 or 2")
.OnDigit("1", one => one
.PlayPrompt("You pressed 1")
.ContinueAt("MainMenu")) // Go back to main menu
.OnDigit("2", two => two
.TransferToQueue("Support"))Quick Reference
| Block | Category | Purpose |
|---|---|---|
PlayPrompt() | Interact | Play audio/TTS message |
GetCustomerInput() | Interact | Collect DTMF/voice input |
StoreCustomerInput() | Interact | Capture encrypted input |
CheckContactAttribute() | Check | Branch on attribute values |
CheckHoursOfOperation() | Check | Branch on business hours |
CheckStaffing() | Check | Branch on agent availability |
InvokeLambda() | Integrate | Call Lambda function |
SetContactAttributes() | Set | Update contact attributes |
SetLoggingBehavior() | Set | Configure logging |
Loop() | Logic | Repeat flow section |
Wait() | Logic | Pause execution |
Disconnect() | Terminate | End contact |
TransferToQueue() | Terminate | Transfer to queue |
TransferToFlow() | Terminate | Transfer to flow |