Triggers

Email Trigger

Category
Trigger
Node Type
Email-Based

Overview

The Email Trigger node automatically starts a workflow whenever an email is received at a unique, system-generated workflow email address.

It is ideal for building workflows that react to incoming communication — such as automated ticket creation, customer onboarding, routing messages, extracting information, file processing, or building AI-driven email assistants.

Whenever an email arrives, all details (sender, recipients, subject, body, attachments, spam scores, metadata) become instantly available to downstream workflow nodes.

Description

Trigger workflow when an email is received at a workflow inbox.

When you add an Email Trigger node to a workflow, the system generates a unique address:

workflow-[id]@mails.worqhat.app

Any email sent to this address will trigger the workflow automatically.

The node captures entire email metadata including:

  • Sender and recipients
  • Subject
  • Text and HTML content
  • Attachments
  • Threading details
  • Spam & virus scores
  • Delivery metadata
Setup

To generate a new workflow inbox, set incomingEmail to:

{{GENERATE_INCOMING_EMAIL}}

The system assigns a unique incoming address automatically.

Input Parameters

Note
  • Only incomingEmail is configured manually.
  • All other fields are populated automatically when an email arrives.
  • Access inputs with:
    {{emailTrigger.input.<name>}}
    
incomingEmailstringRequired
Unique workflow email address. Use "{{GENERATE_INCOMING_EMAIL}}" to auto-create it.
htmlMessagestringOptional
HTML version of the email content.
textMessagestringOptional
Plain-text version of the email body.
subjectstringOptional
Email subject line.
fromstringOptional
Sender email address.
tostringOptional
Recipient workflow email address.
ccarrayOptional
CC recipients.
bccarrayOptional
BCC recipients.
inReplyTostringOptional
Message ID of parent email.
referencesarrayOptional
Thread reference message IDs.
attachmentFilestringOptional
Attachment file ID, if present.
attachmentFileNamestringOptional
Name of attached file.
attachmentFileTypestringOptional
MIME type of the file.
attachmentFileSizenumberOptional
File size in bytes.
spamScorenumberOptional
Likelihood that the email is spam.
virusScorenumberOptional
Likelihood of malicious content.
deliveryTimestringOptional
Timestamp of delivery.
deliveryIdstringOptional
Unique delivery identifier.
deliveryStatusstringOptional
Delivery status: "delivered", "failed", etc.

Access inside workflows:

{{emailTrigger.input.from}}
{{emailTrigger.input.subject}}
{{emailTrigger.input.textMessage}}
{{emailTrigger.input.attachmentFile}}

Output Parameters

This node does not produce any output parameters of its own.
It only exposes the incoming email data through {{nodeId.input.*}} for downstream nodes.

Accessing Data

You can access incoming email values in other nodes using:

{{emailTrigger.input.from}}
{{emailTrigger.input.subject}}
{{emailTrigger.input.textMessage}}
{{emailTrigger.input.htmlMessage}}
{{emailTrigger.input.attachmentFile}}

Output Type

Output Type: None

The node does not define or emit any structured output type.
It only forwards the incoming email data as input fields accessible via {{nodeId.input.<key>}}.

Example Usage

Trigger Workflow with Email

Incoming Email Configuration:

{  "incomingEmail": "{{GENERATE_INCOMING_EMAIL}}"}

The system assigns a unique workflow inbox at workflow-[id]@mails.worqhat.app.

Example: Use an Existing Workflow Inbox

Configuration:

{  "incomingEmail": "workflow-123@mails.worqhat.app"}

Accessing Values Inside the Workflow:

{{emailTrigger.input.from}}           → "sender@example.com"
{{emailTrigger.input.subject}}        → "Test Email"
{{emailTrigger.input.textMessage}}    → "Email body content"
{{emailTrigger.input.htmlMessage}}    → "<html>Email body</html>"
{{emailTrigger.input.attachmentFile}} → "file-id-123"

How to Use in a No-Code Workflow

1

Add the Email Trigger Node

Place the node at the start of your workflow. It acts as the entry point for incoming emails.

2

Configure Incoming Email

Use {{GENERATE_INCOMING_EMAIL}} to auto-create a new inbox, or specify an existing workflow inbox address.

3

Save & Deploy

Once configured, the workflow email address becomes active immediately. The system will generate an address like workflow-[id]@mails.worqhat.app.

4

Connect to Processing Nodes

Link this trigger node to other nodes (e.g., AI, Database, Email, Storage) to process, store, or react to incoming emails automatically.

5

Test the Connection

Send a test email to the workflow inbox address to verify the workflow triggers correctly.

Example Using Mailgun

curl -s --user 'api:MAILGUN_API_KEY' \  https://api.mailgun.net/v3/YOUR_DOMAIN/messages \  -F from='Tester <test@yourdomain.com>' \  -F to='workflow-123@mails.worqhat.app' \  -F subject='Test Email Trigger' \  -F text='This is a test message for the workflow.'
6

Monitor Workflow Execution

Check workflow logs or downstream outputs to ensure emails are being processed correctly.

Best Practices

  • Use {{GENERATE_INCOMING_EMAIL}} for new workflows to ensure unique inbox addresses.
  • Handle both HTML and text versions of emails for maximum compatibility.
  • Verify attachments before processing to avoid errors.
  • Use AI nodes for summarization, autoresponse, and intelligent routing.
  • Utilize spamScore/virusScore for filtering logic and security.
  • Keep workflow inboxes private to prevent abuse and spam.
  • Always test your workflow with sample emails before production use.

Do / Don't

Do
  • ✔️ Use {{GENERATE_INCOMING_EMAIL}} for new workflows.
  • ✔️ Handle both HTML and text versions of the email.
  • ✔️ Verify attachments before processing.
  • ✔️ Use AI nodes for summarization, autoresponse, and routing.
  • ✔️ Utilize spamScore/virusScore for filtering logic.
  • ✔️ Keep workflow inboxes private to prevent abuse.
Don't
  • ❌ Don't share workflow email addresses publicly.
  • ❌ Don't assume every email contains HTML — always check text fallback.
  • ❌ Don't use attachment fields without validating their presence.
  • ❌ Don't store suspicious emails without checking spam/virus scores.
  • ❌ Don't reuse the same workflow inbox for multiple workflows.

cURL: Sending a Test Email

While email systems generally require SMTP, you can send a test email using a transactional email provider API such as SendGrid, Mailgun, or Postmark.

Example: Send a test email via Mailgun cURL

curl -s --user 'api:MAILGUN_API_KEY' \  https://api.mailgun.net/v3/YOUR_DOMAIN/messages \  -F from='Tester <test@yourdomain.com>' \  -F to='workflow-123@mails.worqhat.app' \  -F subject='Test Email Trigger' \  -F text='This is a test message for the workflow.'

Example: Send a test email with attachment

curl -s --user 'api:MAILGUN_API_KEY' \  https://api.mailgun.net/v3/YOUR_DOMAIN/messages \  -F from='Tester <test@yourdomain.com>' \  -F to='workflow-123@mails.worqhat.app' \  -F subject='Invoice Attached' \  -F text='Please find the invoice attached.' \  -F attachment=@invoice.pdf

Example Workflow Integration

Use Case: Automatically process incoming support emails.

  1. Trigger Node – Email Trigger (receives emails at workflow inbox).
  2. AI Node – Text Analysis (categorizes and summarizes the email).
  3. Utility Node – Send Email (sends auto-response) or Database (stores ticket).

Additional Email Use Cases

1. Support Ticket Automation

Incoming support emails automatically:

  • Create tickets
  • Categorize based on subject
  • Auto-respond with confirmation
  • Route to teams (support@, billing@, sales@)

2. Billing & Invoice Processing

Customers send invoices or payment confirmations:

  • Extract attachments
  • Process PDF invoices with extraction nodes
  • Update accounting systems
  • Notify finance teams

3. Sales Lead Capture

Inbound form submissions forwarded as emails:

  • Parse sender & content
  • Extract lead info
  • Push to CRM
  • Notify sales reps instantly

4. Hiring & Resume Intake

Applicants send resumes:

  • Extract text from resume
  • Classify skillsets with AI
  • Rank candidates
  • Store structured data in database

5. Customer Onboarding Automation

Trigger welcome steps when onboarding emails arrive:

  • Summarize content
  • Trigger KYC flow
  • Extract attachments (ID proofs)
  • Update user onboarding records

6. Report Ingestion

Internal systems email automated daily reports:

  • Parse attachment
  • Extract data
  • Trigger BI or analytics pipelines

Example Workflow Diagram

┌────────────────────┐
│   Email Trigger     │
│ workflow inbox      │
└─────────┬──────────┘
          │
          ▼
┌────────────────────┐
│   AI Processing     │
│ summary/classify    │
└─────────┬──────────┘
          │
          ▼
┌────────────────────┐
│ Integrations        │
│ Slack / DB / CRM    │
└────────────────────┘

Common Errors

Missing incomingEmailErrorOptional
Set "incomingEmail" to "{{GENERATE_INCOMING_EMAIL}}" or provide an existing inbox.
Email address in useErrorOptional
Each workflow must have its own unique inbox.
Empty email bodyErrorOptional
The email contains no usable content.
Attachment missingErrorOptional
Email referenced an attachment that was not included.