Javid
Javid
6 min read

Automation Workflows: Event-Driven Email Sequences

Cover Image for Automation Workflows: Event-Driven Email Sequences

We've launched automation workflows in MailDiver. Send triggered emails based on user behavior - when someone signs up, abandons a cart, or completes any action in your app.

This has been one of the most requested features. You can now create welcome sequences, onboarding flows, and behavioral email campaigns that run automatically based on events from your application.

How It Works

Automation workflows are event-driven. When a user performs an action in your application, you send an event to MailDiver. If a workflow is configured for that event, it starts executing automatically.

Here's the flow:

  1. User performs an action in your app (signup, purchase, etc.)
  2. Your backend sends an event to MailDiver's API
  3. Active workflows listening for that event trigger
  4. Each workflow creates a separate execution for that user
  5. The workflow runs through its steps: sending emails, waiting, checking conditions
  6. You can track execution status in the dashboard or via API

Dashboard vs API

You only need the API to send events from your application. Everything else happens in the MailDiver dashboard:

Dashboard (no API needed):

  • Create and design workflows with the visual builder
  • List all your workflows
  • Monitor executions (see status, current step, wait times)
  • View all emails sent via workflows
  • Track which contacts are in which executions
  • See execution history and performance

API (required):

  • Send events from your application to trigger workflows
  • Update contact properties programmatically (optional)
  • Query execution data programmatically (optional)

The rest of this post shows API examples for developers who want programmatic access. If you just want to create workflows and monitor them visually, use the dashboard.

Sending Events

Trigger workflows by sending events from your application:

curl -X POST https://api.maildiver.com/v1/events \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "event_name": "user_signed_up",
    "email": "user@example.com",
    "properties": {
      "first_name": "John",
      "plan": "free",
      "signup_source": "landing_page"
    }
  }'

Properties you send get merged with existing contact data using deep merge. This means you only send what changed - no need to resend all properties every time.

Deep merge with null deletion:

  • Omitted fields: Preserved unchanged
  • Fields with values: Updated or added
  • Fields set to null: Deleted from contact
  • Nested objects: Recursively merged
  • Arrays: Replaced entirely

Example:

// First event
{ first_name: "John", plan: "free" }

// Later event
{ plan: "pro" }

// Result
{ first_name: "John", plan: "pro" }

Conditional Logic

Workflows support yes/no branching with 10 rule operators:

Comparison: equals, not_equals, greater_than, less_than Text matching: contains, not_contains, begins_with, ends_with Existence: exists, not_exists

Combine multiple rules with AND/OR logic. Create paths like "if plan = pro, send email A, otherwise send email B".

Rules check against contact properties at execution time, so they reflect the current state of the contact - not frozen from when the workflow started.

Wait Steps

Add delays between emails. Executions pause during wait periods and the system schedules automatic resumption - no polling or manual intervention needed.

For example, you can send a welcome email, wait 2 days, then send a tips email. All configured in the dashboard's visual workflow builder.

Updating Contact Properties

Update contact properties without triggering workflows:

curl -X PATCH https://api.maildiver.com/v1/automation/contacts/user@example.com \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "properties": {
      "plan": "pro",
      "last_login": "2025-10-18T12:00:00Z"
    }
  }'

Use this endpoint when you want to update contact data but don't want to trigger workflows. The event endpoint both updates contacts AND triggers workflows.

Tracking Executions

Query workflow executions via API:

# Get all executions for a contact
curl https://api.maildiver.com/v1/automation/executions?email=user@example.com \
  -H "Authorization: Bearer YOUR_API_KEY"

# Get executions for a specific workflow
curl https://api.maildiver.com/v1/automation/executions?workflow_id=wf_123 \
  -H "Authorization: Bearer YOUR_API_KEY"

Execution status:

  • IN_PROGRESS: Currently executing
  • WAITING: Paused on a wait step
  • COMPLETED: Finished successfully
  • FAILED: Encountered an error
  • CANCELLED: Stopped (usually from unsubscribe)

Unsubscribe Handling

Include {{ unsubscribe_url }} in your email templates. When a user clicks it, MailDiver immediately:

  1. Cancels ALL active executions (IN_PROGRESS and WAITING) for that workflow
  2. Prevents future events from triggering that workflow for this contact
  3. Sets cancellation_reason to "User unsubscribed from workflow"

Unsubscribe is workflow-specific. A user can unsubscribe from your welcome sequence but still receive transactional emails or emails from other workflows.

Building Workflows

Workflows are created in the dashboard using the visual builder - not via API. This prevents accidental workflow creation from code and ensures proper testing.

Once created, workflows run automatically based on events you send. You don't need to know anything about workflow internals - just send events and monitor executions.

The visual builder lets you:

  • Configure trigger events
  • Add email steps using existing templates
  • Set wait times between steps
  • Create conditional branches with rules
  • Test workflows before activating

Use Cases

Welcome sequences: Send a series of emails when users sign up Onboarding flows: Guide new users through your product Abandoned cart: Remind users about incomplete purchases Re-engagement: Bring back inactive users Post-purchase: Follow up after purchases Behavioral triggers: React to any user action

Getting Started

  1. Create a workflow in the automation dashboard
  2. Configure the trigger event and add email steps
  3. Activate the workflow
  4. Send events from your application

Check the automation workflows guide for detailed setup instructions and the API reference for all available endpoints.


We built automation workflows to handle the email sequences every application needs: welcoming new users, nurturing leads, and responding to user behavior. No complex integrations, no external tools - just send events and let the workflows run.

Start with a simple welcome sequence. Send a "user_signed_up" event when someone creates an account, and MailDiver handles the rest.

Get Started with MailDiver

Automation workflows are completely free - we only charge for emails sent. Your first 5,000 emails per month are free, and there are no hidden fees for automation features, domains, or team members.

Unlike other platforms that charge extra for automation, MailDiver includes all automation features at no additional cost. You pay for the emails you send, not the features you use.

Ready to automate your email sequences? Sign up for free and start building workflows today.

Related Articles

What is drip marketing and how does it work for businesses?
EMAIL MARKETING

What is drip marketing and how does it work for businesses?

Learn how drip marketing automates customer communication through strategic messaging sequences. Discover implementation strategies, personalization techniques, and best practices for building effective automated campaigns.

Read →
Email Marketing Automation: Complete Guide to Automated Email Sequences That Convert
EMAIL MARKETING

Email Marketing Automation: Complete Guide to Automated Email Sequences That Convert

Master email marketing automation with this comprehensive guide. Learn how to build automated email sequences that nurture leads, engage customers, and drive conversions while saving time and maximizing ROI.

Read →
Email Funnels: Complete Guide to Building High-Converting Customer Journeys
EMAIL MARKETING

Email Funnels: Complete Guide to Building High-Converting Customer Journeys

Master email funnel strategy with our comprehensive guide covering design, automation, and optimization for maximum conversion rates.

Read →
Complete Guide to Email Broadcast: What It Is, How It Works, and Best Practices
EMAIL MARKETING

Complete Guide to Email Broadcast: What It Is, How It Works, and Best Practices

Learn email broadcasting with this comprehensive guide covering everything from basic concepts to advanced strategies. Discover how to create effective broadcast campaigns that drive engagement and deliver results for your business.

Read →
Why maildiver.com is different
EMAIL MARKETING

Why maildiver.com is different

Discover what makes maildiver.com different from other email platforms. From transparent pricing to native inbox support, learn why thousands of businesses choose MailDiver for their email needs.

Read →
Email Delivery Best Practices - Part 1
EMAIL MARKETING

Email Delivery Best Practices - Part 1

Learn the essential email delivery best practices for both broadcast and transactional emails. Learn about subdomain strategies, domain warm-up, content optimization, and deliverability techniques that ensure your emails reach the inbox.

Read →