Skip to content
Tutorials Center
My learning

Topics

Lesson 31 of 38 ยท Marketing Automation and AI

Marketing Automation and Workflows

Learn marketing automation: triggers, conditions and actions, welcome and abandoned-cart flows, lead nurturing, segmentation and how to test a workflow as code.

Marketing automation uses software to send the right message at the right moment based on what a person does, without someone pressing "send" every time. A visitor signs up and gets a welcome email. A shopper leaves items in a cart and receives a reminder. A trial user who has not set up their account gets a helpful nudge on day three. Done well, automation feels like good service; done badly, it feels like spam.

The building blocks

Every automation, in any tool (HubSpot, ActiveCampaign, Klaviyo, Mailchimp, Brevo, Customer.io and many others), is made from the same parts:

  • Trigger: the event that starts the flow (form submitted, tag added, purchase made, page visited, date reached).
  • Conditions: rules that choose a path (is the person a customer? did they open the last email? which country?).
  • Actions: what happens (send email, wait, update a field, add a tag, notify sales, create a task).
  • Delays: waits between steps (one day, until Tuesday 9:00).
  • Goal / exit: when the person should leave the flow (they bought, they replied, they unsubscribed).

Anatomy of a workflow

Trigger Signs up for the newsletter
Condition Already a customer?
Action Send the welcome email
Goal Purchase ends the flow

Always define when someone should leave.

1 / 2

Flows every business should consider

  1. Welcome series (2 to 5 emails): who you are, what to expect, best content, a first offer. Welcome messages usually get higher engagement than ordinary sends.
  2. Abandoned cart: a reminder one hour after, a second after a day, maybe a third with help or an incentive. Do not discount automatically for everyone; discounts teach people to abandon carts.
  3. Post-purchase: order confirmation, shipping updates, how to use the product, review request, cross-sell after a suitable time.
  4. Lead nurturing: educate leads who are not ready to buy, with content matched to their interest, until they show buying signals.
  5. Win-back: a series for customers or subscribers who have gone quiet, ending with a clear "should we keep emailing you?" and then suppression of non-responders to protect deliverability.
  6. Onboarding: step-by-step prompts for new users of a product to reach their first success.
  7. Event and birthday: webinar reminders, anniversaries, renewal reminders.

The channel is not limited to email: SMS, push notifications, in-app messages and direct mail are common too, each with its own consent rules (see privacy and compliance).

Design a workflow on paper first

Draw the path with decisions and exits before touching a tool. A flowchart prevents loops, contradicting messages and people receiving the same email twice.

flowchart TD
  A["Trigger: abandons cart"] --> B["Wait 1 hour"]
  B --> C{"Purchased?"}
  C -- "Yes" --> Z["Exit"]
  C -- "No" --> D["Email 1: reminder"]
  D --> E["Wait 24 hours"]
  E --> F{"Purchased?"}
  F -- "Yes" --> Z
  F -- "No" --> G["Email 2: help and reviews"]
  G --> H["Wait 48 hours"]
  H --> I{"Purchased?"}
  I -- "Yes" --> Z
  I -- "No" --> J["Email 3: last reminder"]
  J --> Z

An abandoned-cart flow checks the goal before every message.

Simulate a workflow in code

Understanding the logic helps you design and debug flows in any platform. This small engine runs people through steps and respects the exit goal.

JS A tiny workflow engine

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Ana buys before the first email and receives nothing, Ben receives two emails and then exits, and Cleo receives all three. Without the goal checks, Ana and Ben would have been pestered after buying.

Segmentation and personalization

Automation works best with data. Segment by:

  • Behavior: pages viewed, products carted, emails clicked.
  • Stage: subscriber, lead, customer, repeat customer, lapsed.
  • Attributes: country, language, industry, plan.
  • Value: order history, predicted lifetime value.

Personalization goes beyond a first name. Recommend related products, reference the page they read, and send at a useful time zone. Keep it respectful; messages that reveal too much tracking feel intrusive.

Frequency and fatigue

Add global rules: no more than one marketing message per day per person, suppress promotions for people in a support ticket, and exclude fresh customers from acquisition offers. Measure unsubscribes and spam complaints; rising numbers are a signal to slow down.

Measuring automation

Track per flow: delivery rate, open rate (an unreliable estimate since mail apps can preload images), click rate, conversion rate, revenue per recipient, unsubscribe rate. Compare automated flows to your one-off campaigns. Run A/B tests on subject lines, timing and offers.

JS Flow performance and revenue per recipient

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The win-back flow earns little and drives many unsubscribes, a reason to shorten it and clean the list. More lead-focused automation is in CRM and lead scoring.

Common mistakes

  • No exit condition, so buyers keep getting "come back" emails.
  • Setting a flow live without testing it with a test contact.
  • Overlapping flows sending several emails on the same day.
  • Over-automation that removes the human touch where it matters (sales replies, support).
  • Never reviewing flows; offers and links go stale.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which is the correct set of workflow building blocks?

    These parts make up nearly every automation flow.
  2. 2. Why should an abandoned-cart flow check for a purchase before each email?

    Goal checks prevent irrelevant, annoying messages.
  3. 3. What is a sound way to handle subscribers who ignore a win-back series?

    Suppressing non-responders keeps your sending reputation healthy.
  4. 4. Which metric is usually unreliable by itself today?

    Mail apps that preload images can inflate opens, so rely more on clicks and conversions.

Summary

  • Automation = trigger, conditions, actions, delays and a goal or exit.
  • Start with welcome, abandoned-cart, post-purchase, nurture and win-back flows.
  • Plan on paper, test with a dummy contact and add frequency limits.
  • Segment and personalize with respect for privacy.
  • Measure revenue per recipient and unsubscribes per flow.

Next: CRM and Lead Scoring