Appearance
Email Workflows Guide
Workflows define how incoming emails are processed and responded to. This guide covers creating, configuring, and managing workflows.
Workflow Concepts
What is a Workflow?
A workflow is a series of steps that process an incoming email:
- Extract information from the email
- Collect missing contact information (name, email, etc.)
- Generate an AI-assisted response
- Perform actions (create tickets, book appointments, etc.)
- Send the response to the sender
Contact Information Collection
The system automatically collects and manages contact information:
Automatic Collection:
- Email Address: Automatically known from sender (channel_identifier)
- Name: Extracted from email content or requested if missing
- Phone: Extracted from email body if mentioned
- Company: Extracted from email content if mentioned
For New Conversations:
- System automatically prompts AI agent to ask for missing information
- Name is requested if not found in email content
- Agent asks naturally: "Hi! Before we continue, could I get your name?"
- Information is collected before addressing the main inquiry
Client Record Creation:
- Extracted contact information automatically creates/updates client records
- Conversations are linked to client records for cross-channel tracking
- Duplicate clients are automatically merged based on email/phone matching
Workflow Matching
Workflows are matched to emails based on:
Goal Type:
- General Inquiry: Matches all emails (catch-all)
- Lead Capture: Matches emails with pricing/quote keywords
- Helpdesk: Matches emails with support/help keywords
- Sales: Matches sales-related inquiries
- Appointment Booking: Matches appointment requests
Priority:
- Higher priority workflows are checked first
- Use priority to ensure important workflows match before catch-all workflows
- Recommended: 10 for specific workflows, 0 for general inquiry
Keyword Matching:
- System checks email subject and body for keywords
- Keywords vary by goal type
- Falls back to first workflow if no specific match
Workflow Matching Visualization:
When viewing email conversations, you can see detailed workflow matching information:
- Matched Workflow: Shows which workflow processed the email
- Match Reason: Displays keywords that triggered the match
- Priority Rank: Shows where this workflow ranked in priority order
- Competing Workflows: Lists other workflows that were considered
- Shows which workflows would have matched if priority was higher
- Displays why each competing workflow didn't match
- Test Match Feature: Test workflow matching with sample emails to debug issues
Creating a Workflow
Basic Workflow
- Navigate to Email Workflows page
- Click New Workflow
- Fill in required fields:
- Name: Descriptive name (e.g., "Lead Qualification")
- Goal: Select appropriate goal type
- Priority: Set priority number
- Agent: (Optional) Select specific agent to handle this workflow's emails
- Add context (business information for AI agents)
- Add workflow steps
- Click Save Workflow
Agent Assignment
You can assign a specific AI agent to handle emails matching a workflow:
- With Agent: Selected agent uses workflow context as guidance
- Without Agent: System selects agent using routing rules or defaults
- Agent Selection: If no agent assigned, system uses default email agent or routing rules
Workflow Steps
Extract Information Step
Extracts contact data from email body using regex patterns and AI-assisted PII extraction.
Configuration:
- Fields: Comma-separated list (e.g.,
name, email, phone, company)
Supported Fields:
email: Extracts email addresses (from email body or sender address)phone: Extracts phone numbers (various formats: XXX-XXX-XXXX, XXX.XXX.XXXX, etc.)name: Extracts names following patterns like "name is", "i'm", "i am"company: Extracts company names from phrases like "work at", "company is"
Extraction Methods:
- Regex Pattern Matching: Basic extraction from email body text
- AI-assisted contact info extraction: Optional extraction to identify contact information
- Sender Email: Email address is automatically known from sender
Best Practices:
- Always include
namein extraction fields for new conversations - Use
extract_infostep early in workflow (before send_response) - Combine with AI agent's automatic information collection for best results
- Extracted data is stored in
extractedDataand can be used in templates
Example:
Fields: name, email, phone, companyNote: The system also automatically extracts contact information using AI-assisted PII extraction, which is more accurate than regex patterns alone. The extract_info step provides additional extraction for workflow-specific needs.
Send Response Step
Generates and sends email response using AI agent or template fallback.
Configuration:
- Template: Response template with variable placeholders (used as guidance, not literal template)
- Variable Picker: Use the "Insert Variable" button to easily add variables to your template
Template Variables:
{name}: Extracted name{email}: Extracted email{phone}: Extracted phone{company}: Extracted company name{subject}: Original email subject{ticket_id}: Ticket ID from previous create_ticket step- Any extracted fields from previous extract_info steps
Variable Picker:
- Click Insert Variable button next to the template field
- Select from available variables (common variables + variables from previous steps)
- Variable is inserted at your cursor position
- Tooltip shows description for each variable
How It Works:
- AI Agent Response: The assigned agent (or selected agent) generates a natural, conversational response
- Workflow Guidance: Agent uses workflow context and template as guidance for tone and structure
- Not Template-Based: Agent adapts the template naturally, doesn't fill in variables literally
- Template Fallback: If AI generation fails, system uses template with variable substitution
- Signature Added: Agent's signature (signoff + name + custom signature) is automatically appended
Example Template (Guidance):
Thank you for contacting us, {name}. We've received your inquiry about {subject} and will respond within 24 hours.Agent Response (Adapted):
Hi John,
Thank you for reaching out about our hosting services. I've received your inquiry and I'm happy to help you find the right plan for your needs.
I'll review your requirements and get back to you within 24 hours with a personalized recommendation.
Best regards,
Sarah Johnson
Customer Success ManagerCreate Ticket Step
Creates a support ticket with unique ID.
Configuration:
- System: Ticket system type (internal, zendesk, etc.)
Result:
- Generates ticket ID (e.g.,
TICK-1234567890) - Stores in
extractedData.ticket_id - Can be referenced in response template
Book Appointment Step
Adds appointment booking link to response.
Configuration:
- Link: Appointment booking URL
Result:
- Appends booking link to email response
- Link is added after response text
Save to Database Step
Saves extracted data to database table.
Configuration:
- Table: Target database table name
Result:
- Saves all extracted data to specified table
- Useful for lead capture and data collection
Step Conditions
Steps can have optional conditions that determine when they execute.
Condition Syntax:
- Evaluated during workflow execution
- Can reference extracted data and email content
- Examples:
email contains 'urgent'budget > 1000phone is not empty
Best Practices:
- Keep conditions simple and clear
- Test conditions with sample emails
- Use conditions to create conditional workflows
Workflow Context
Workflow-Specific Context
Context added to a workflow is included in AI prompts when processing emails for that workflow.
Use Cases:
- Business-specific information
- Service descriptions
- Pricing information
- Policies and procedures
Example:
We are a web hosting company offering VPS, dedicated servers, and cloud hosting.
Our pricing starts at $29/month for VPS plans. We offer 24/7 support and 99.9% uptime guarantee.Context Library
Shared context entries available to all workflows.
When to Use:
- Information used across multiple workflows
- Company-wide policies
- General business information
When to Use Workflow Context:
- Workflow-specific information
- Goal-specific details
- Temporary or changing information
Workflow Priority
Priority determines the order workflows are checked when matching emails.
Priority Rules:
- Higher numbers = checked first
- Workflows with same priority: checked in creation order
- General inquiry workflows should have low priority (0)
Recommended Priorities:
- 10: Critical workflows (urgent support, VIP customers)
- 5: Specific workflows (sales, appointments)
- 0: General inquiry (catch-all)
Workflow Status
Active: Workflow is enabled and will match emails
Inactive: Workflow is disabled and will not match emails
Use Cases for Inactive:
- Temporarily disable workflow for testing
- Archive old workflows
- Seasonal workflows
Workflow Builder Views
The workflow builder offers two views for creating and editing workflows:
List View (Default)
Traditional step-by-step list interface:
- Steps displayed in vertical list
- Expand/collapse each step to configure
- Drag-and-drop to reorder steps
- Best for simple workflows and quick edits
Visual Editor
Node-based visual workflow builder:
- Steps displayed as connected nodes
- Visual flow shows execution order
- Drag nodes to reposition
- Connect nodes to change execution flow
- Click nodes to configure
- Best for complex workflows and visual understanding
Switching Views:
- Use the List View / Visual Editor toggle in the workflow editor
- Both views work with the same workflow data
- Changes in one view are reflected in the other
Testing Workflows
Test Email Matching
From Workflow Editor:
- Use the Test Workflow Matching section in the workflow editor
- Enter sample email subject and/or body
- Click Test Match
- See which workflow would match and why
- Review all workflows checked and their matching status
From Conversation Details:
- Open any email conversation
- Click Test Match button in the Workflow Match section
- Enter test email subject/body
- See matching results with detailed explanation
- Review which workflows were checked and why they matched or didn't match
Test Match Features:
- Shows matched workflow with priority and goal
- Displays keywords that triggered the match
- Lists all workflows checked with matching status
- Shows why competing workflows didn't match
- Helps debug priority and keyword matching issues
Test Response Generation
- Send test email matching workflow
- Check received response
- Verify AI response quality
- Check template fallback if AI fails
Debug Workflow Issues
- Check workflow is Active
- Verify priority is appropriate
- Use Test Match feature to see why workflow matches or doesn't match
- Review workflow matching visualization in conversation details:
- See which keywords triggered match
- View priority comparison with other workflows
- Check competing workflows and why they didn't match
- Check goal type matches email content
- Review workflow steps are configured correctly
- Check context is complete
Best Practices
- Start Simple: Create basic workflow first, add complexity later
- Use Priority Wisely: Higher priority for specific workflows
- Test Thoroughly: Test with various email types
- Keep Context Updated: Update business information regularly
- Monitor Performance: Review workflow matching accuracy
- Document Workflows: Use descriptive names and descriptions
Next Steps
- Troubleshooting - Resolve workflow issues
- API Reference - Programmatic workflow management

