Skip to main content

Email Triggers

Email triggers allow workflows to start when emails are received at designated addresses. This enables automation for email-based processes like support tickets, order notifications, and document processing.

How Email Triggers Work

  1. You configure an email address for your flow
  2. When email arrives at that address, the flow executes
  3. Email content (subject, body, attachments) becomes flow parameters
  4. The flow processes the email data

Setting Up Email Triggers

Enable Email Integration

  1. Navigate to Settings > Email Configuration
  2. Enable email triggers for your workspace
  3. Verify your domain (if using custom domain)

Configure Email Address

System-generated addresses:

orders-flow-abc123@inbound.factorythread.io
support-tickets@yourworkspace.factorythread.io

Custom domain addresses:

orders@automation.yourcompany.com
support-intake@yourcompany.com

Email Settings

Basic Configuration

SettingDescription
Email AddressThe address that triggers this flow
Subject FilterOnly process emails matching subject pattern
Sender FilterOnly process from specific senders
Attachment RequiredOnly process if attachments present

Subject Filters

Exact match:

Subject: ORDER CONFIRMATION

Contains:

Subject contains: "Order #"

Regex pattern:

Subject matches: ^Order\s#\d+

Sender Filters

Specific addresses:

From: orders@partner.com
From: notifications@supplier.com

Domain filter:

From: *@trusted-partner.com

Allow list: Multiple approved senders.

Attachment Handling

Require attachments: Only trigger when email has attachments.

Filter by type:

Attachments: *.xlsx, *.csv, *.pdf

Size limits: Maximum attachment size to process.

Available Parameters

When an email triggers a flow, these parameters are available:

Email Metadata

ParameterDescriptionType
fromSender email addressString
fromNameSender display nameString
toRecipient addressString
subjectEmail subject lineString
dateReceived timestampDateTime
messageIdUnique email identifierString

Email Content

ParameterDescriptionType
textBodyPlain text bodyString
htmlBodyHTML body contentString
bodyPreferred body (text or html)String

Attachments

ParameterDescriptionType
hasAttachmentsWhether attachments existBoolean
attachmentCountNumber of attachmentsNumber
attachmentsArray of attachment infoArray

Attachment object:

{
"filename": "orders.xlsx",
"contentType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"size": 15234,
"content": "(base64 encoded)"
}

Processing Email Content

Parsing Text Body

Extract data from email text:

[Email Trigger]
→ [Transform: parse body]
→ [Filter: valid data]
→ [Process]

Transform expressions:

OrderNumber = REGEX_EXTRACT(${body}, "Order #(\d+)")
CustomerName = REGEX_EXTRACT(${body}, "Customer: (.+)")

Processing Attachments

Excel attachment:

[Email Trigger]
→ [For Each: attachments]
→ [Parse Excel: attachment.content]
→ [Process rows]

CSV attachment:

[Email Trigger]
→ [Parse CSV: firstAttachment.content]
→ [Transform data]
→ [Load to database]

HTML Parsing

Extract from HTML body:

[Email Trigger]
→ [Transform: parse HTML]
→ [Extract tables/data]
→ [Process structured data]

Common Use Cases

Support Ticket Intake

Email: support@company.factorythread.io

Flow:

[Email Trigger]
→ [Parse subject for ticket type]
→ [Extract customer info]
→ [Create ticket in database]
→ [Notify support team]

Order Processing

Email: orders@company.factorythread.io Filter: Subject contains "Order Confirmation"

Flow:

[Email Trigger]
→ [Parse order details from body]
→ [Validate order data]
→ [Create order in ERP]
→ [Send confirmation]

Report Processing

Email: reports@company.factorythread.io Filter: Attachments required, *.xlsx only

Flow:

[Email Trigger]
→ [Extract Excel attachment]
→ [Parse spreadsheet data]
→ [Validate and transform]
→ [Update database]

Document Archival

Email: archive@company.factorythread.io

Flow:

[Email Trigger]
→ [Extract all attachments]
→ [Categorize by type]
→ [Store in document system]
→ [Log receipt]

Security Considerations

Sender Verification

Validate senders:

  • Allowlist trusted domains
  • Reject unknown senders
  • Log suspicious emails

Content Security

Attachment scanning:

  • Validate file types
  • Check for malware
  • Limit file sizes

Data Protection

Sensitive data:

  • Don't log sensitive content
  • Encrypt stored attachments
  • Follow data retention policies

Error Handling

Invalid Emails

Email doesn't match filters:

  • Logged but not processed
  • Optional notification to admin

Processing Failures

Flow execution fails:

  • Error logged
  • Email retained for retry
  • Alert notification sent

Duplicate Handling

Same email processed twice:

  • Check message ID
  • Implement idempotency
  • Skip duplicates

Troubleshooting

Email Not Triggering Flow

Possible causes:

  1. Email address incorrect
  2. Filters not matching
  3. Flow not deployed
  4. Email in spam/blocked

Solutions:

  • Verify email address
  • Check filter configuration
  • Confirm flow is deployed
  • Check email logs

Missing Data

Possible causes:

  1. Parsing rules incorrect
  2. Email format changed
  3. Encoding issues

Solutions:

  • Review raw email content
  • Update parsing rules
  • Handle encoding properly

Attachment Issues

Possible causes:

  1. Attachment too large
  2. Unsupported format
  3. Corrupt file

Solutions:

  • Check size limits
  • Verify file types
  • Validate attachments

Best Practices

Email Address Naming

Clear, purposeful names:

orders@automation.company.com
support-intake@automation.company.com
daily-reports@automation.company.com

Filter Configuration

Be specific:

  • Filter by subject when possible
  • Allowlist known senders
  • Require expected attachment types

Content Parsing

Handle variations:

  • Multiple email formats
  • Different attachment types
  • Missing optional fields

Monitoring

Track email processing:

  • Log all received emails
  • Monitor success/failure rates
  • Alert on unusual patterns

Next Steps