Skip to content
Tutorials Center
My learning

Topics

Lesson 24 of 37 ยท Automation and Workflows

Workflows: Triggers, Actions and Enrollment

Learn how HubSpot workflows automate work: object types, enrollment triggers, common actions, re-enrollment and unenrollment, with a runnable workflow engine stand-in.

A workflow is HubSpot's automation engine: "when this happens to a record, do these steps." Workflows can send emails, set properties, create tasks, assign owners, call a webhook and more. Every Hub has them (at Professional level and above for most features), and they are the glue that makes the CRM feel alive.

HubSpot is a hosted product and cannot run here. This lesson describes the workflow editor, and the Python code is a small stand-in engine that demonstrates the same triggers-and-actions logic.

Anatomy of a workflow

Create one under Automation > Workflows > Create workflow. You choose:

  1. What the workflow is based on: an object type such as contacts, companies, deals, tickets, or custom objects. A contact-based workflow runs one record at a time.
  2. How it starts: from scratch (with your own trigger) or from a template. Some workflows are triggered by a schedule or an event instead of a record changing.
  3. The enrollment trigger: the condition that puts a record into the workflow.
  4. Actions: the steps run in order.
  5. Settings: re-enrollment, unenrollment and suppression, goals, and timing.

A record is enrolled when it meets the trigger and then proceeds through actions; each enrolled record is independent.

Enrollment triggers

Common trigger types:

  • Filter-based: "Lifecycle stage is Marketing Qualified Lead and Country is Germany". It fires when a record newly matches the filters (and, by default, also enrolls existing matches when you turn it on).
  • Event-based: "Contact submitted a form" or "Contact opened a marketing email" (requires the right plan).
  • Schedule: runs on a date or repeating timetable.
  • Manual or from another workflow: records are enrolled by an action in a different workflow or by a user.

Pick the narrowest trigger that does the job. A vague trigger such as "email is known" will enroll everybody.

Common actions

Category Example actions
CRM Set property value, Copy property value, Create record, Rotate record to owner
Communication Send email, Send internal notification, Send Slack message (with an integration)
Tasks Create task
Logic Delay, If/then branch, Go to action
Developer Trigger a webhook, Custom code (Operations Hub Professional)
Data Format data (Operations Hub)

Ordering matters: for instance set the owner before sending an email that uses the owner's name token.

Workflow pieces

Object Contact, deal, ticket ...
Trigger Who gets enrolled
Actions Email, task, set property
Goal and exit When to stop

One record, one path, step by step

1 / 2

A stand-in workflow engine

Python Triggers and actions in Python (stand-in)

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

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice that the owner is set before the email, so the email can mention the owner.

Re-enrollment, unenrollment and suppression

  • By default a record is enrolled once. Turn on re-enrollment to allow a record to go through again when it meets the trigger again (useful for recurring events like each new purchase).
  • Unenrollment: remove a record when it no longer matches, for example when it becomes a customer.
  • Suppression lists block listed records from ever being enrolled; use them for employees or test contacts.
  • A goal exits records once they reach the desired outcome, such as booking a meeting, so you stop nurturing them.
Python One-time enrollment versus re-enrollment

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

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Safety checklist

  • Test with a few records first; use the workflow's history tab and the "Test" option to see what would happen.
  • Check the estimated enrollment count before turning on, because turning on can enroll every existing match and send emails to all of them.
  • Give workflows clear names, such as "Lead: assign owner (DE)", and keep a short note of purpose.
  • Avoid two workflows that edit the same property in conflicting ways.

Check your understanding

Quick check ยท 3 questions

of 3 answered You scored / 3 ยท perfect!

  1. 1. What decides which records enter a workflow?

    Enrollment triggers are the conditions that start a record on its path.
  2. 2. By default, how many times can one record enroll in a workflow?

    Re-enrollment is off by default.
  3. 3. Why is it risky to turn on a workflow without checking the estimated enrollment?

    Existing matches can be enrolled when turned on, so verify the count.

Summary

  • A workflow = object type + enrollment trigger + ordered actions + settings.
  • Triggers can be filters, events, schedules or enrollment from elsewhere.
  • Re-enrollment, goals and suppression control who goes through and when to stop.
  • Test and check counts before activating.

Next: Branches, Delays and Enrollment Rules