Overview
The flow builder is a visual node-based editor for creating email workflows. Connect templates, variables, and outputs to define what happens when you call the API.
Flow Editor Interface
The flow editor shows:
- Canvas - Drag and connect nodes
- Node palette - Available node types
- Minimap - Navigate large flows
Node Types
Variables Node
Displays all variables extracted from a connected template:
- Shows variable names and defaults
- Connected automatically when you add a template
- Visual indicator of what data the template needs
Template Node
Represents an email template:
- Shows template name and preview
- Lists extracted variables
- Connect to output nodes
Provider Output
Sends email via your configured provider:
- Select which provider to use
- Requires
_toin the API request - Returns
messageIdon success
Callback Output
Returns rendered HTML without sending:
- No provider needed
- Returns
html,text, andsubject - Useful for preview or self-managed sending
Verification Node
Validates inputs before proceeding:
- Email Domain - Validates recipient email
- Required Fields - Ensures variables are provided
- Custom Regex - Pattern matching on variables
Building a Flow
Basic Send Flow
- Your template appears as a node
- Variables are automatically extracted
- Add a Provider Output node
- Connect template → provider output
- Configure which provider to use
[Variables] → [Template] → [Provider Output]
Callback Flow
For rendering without sending:
- Add your template
- Add a Callback Output node
- Connect template → callback output
[Variables] → [Template] → [Callback Output]
Validated Flow
Add verification before sending:
- Add your template
- Add a Verification node
- Configure verification type
- Add Provider Output
- Connect: template → verification → provider
[Variables] → [Template] → [Verification] → [Provider Output]
Connecting Nodes
- Hover over a node’s handle (small circle)
- Click and drag to another node’s handle
- Release to create a connection
Connection Rules
- Templates connect to outputs (provider, callback, verification)
- Verification can chain to other outputs
- Variables auto-connect to their template
Verification Types
Email Domain
Validates the _to address:
- Checks email format
- Verifies domain exists
- Checks MX records
If validation fails:
{
"success": false,
"type": "validation_failed",
"error": "Invalid email address",
"field": "_to"
}
Required Fields
Ensures specific variables are provided:
- Add verification node
- Select “Required Fields”
- Choose which variables must be provided
If validation fails:
{
"success": false,
"type": "validation_failed",
"error": "Missing required fields: firstName, orderNumber",
"field": "firstName"
}
Custom Regex
Validate a variable against a pattern:
- Add verification node
- Select “Custom Regex”
- Enter the regex pattern
- Select which variable to validate
Example: Validate phone numbers match a pattern.
Execution Flow
When you call /execute:
- Locate template - Find the template node
- Hydrate variables - Replace
{{var}}with values - Run verifications - Execute any verification nodes
- Output - Send via provider or return HTML
Multiple Outputs
A template can connect to multiple outputs:
- All verifications run first
- First provider output sends the email
- Callback outputs return HTML
Best Practices
Keep Flows Simple
- One template per flow typically
- Add verification when needed
- Avoid complex branching
Use Verification Wisely
- Validate user input (email addresses)
- Require critical fields
- Don’t over-verify (adds latency)
Test Your Flows
- Create the flow
- Use callback output first to test rendering
- Switch to provider output for production
- Test with real variables
Debugging Flows
Template not found in flow graph
- Template must be added to the project’s flow
- Check the flow editor shows the template node
Verification keeps failing
- Check your verification configuration
- Test with known-good inputs
- Review the error message
No output node
- Connect your template to an output
- Without an output, the flow defaults to callback behavior