Use if/then branches in workflows

Last updated: February 12, 2020

Applies to:

Marketing Hub  Professional, Enterprise
Sales Hub  Professional, Enterprise
Service Hub  Professional, Enterprise

Use if/then branches in workflows to direct enrolled objects down one path or another based on set conditions.

Add an if/then branch

  • In your HubSpot account, navigate to Automation > Workflows.
  • Click the name of an existing workflow, or create a new workflow by clicking Create workflow. Learn more about creating a workflow.
  • Click the plus icon +. add-an-action
  • In the right panel, select Add if/then branch.
  • Select the criteria for the if/then branch. If/then branch criteria options are identical to enrollment trigger criteria options.
  • After selecting the criteria, click Apply filter.
  • You can add up to 20 branches to an if/then action to consolidate your workflow. Objects will be evaluated against each if/then branch in the order that the branches are set. For example, if a contact meets the first if/then branch criteria, they'll proceed down that YES branch without being evaluated against other if/then branches.
  • To add more if/then branches:
    • After adding your first if/then branch condition, click Add another branch.

    • Select the criteria for the new branch, then click Apply filter.
    • You can name each branch by clicking into the Branch name field and entering text.
  • When you're done, click Save.

Please note: if your branch criteria is based on a contact or associated contact engaging with content in a previous action in the workflow (e.g., contacts opening a marketing email sent in a previous action), add a delay before your branch to ensure that they have time to engage with your content.

  • Click the plus icon + to add an action under the YES branch or under the NO branch. In the example below, if a contact has filled out the Contact Us form, they will go down the YES path. If they have not filled out the Contact Us form, they will go down the NO path.if-then-branch-example
  • Click the plus icon + to add more actions if needed.
  • Next, click the Settings tab. Learn more about managing workflow settings.
  • When you're done setting up your workflow, click Review.
  • Review your workflow settings, then click Turn on.
  • A dialog box will appear informing you that the workflow has been turned on.

Test branching logic

To test your if/then branches, use the Test feature in the upper right corner of the workflow. 


When testing, no workflow actions will execute. Instead, the testing panel will show whether or not the test record meets the enrollment criteria, followed by a simulated outcome and timestamp of each action. Learn more about testing your workflow.