How to use branching logic in workflows

Last updated: May 15, 2018

Applies to:

Marketing Hub
marketing-pro-enterprise
Professional, Enterprise
Sales Hub
sales-pro-enterprise
Professional, Enterprise

Effective automation starts with a goal in mind and optimizes for each milestone along the way. By using branching logic in workflows, you can further develop distinct nurturing experiences for your contacts, creating "mini-goals" that help you optimize each step of your marketing or sales automation strategy to the fullest.

With branching logic, you can have your contacts follow one path or another based on an action in your workflow. For example, if you send someone an email, you can have that contact receive different content depending on if they clicked a link in the email or not.

Branching logic fits nicely within the goal-based framework of your workflows tool. Each workflow can still have a high-level goal, such as turning leads into marketing qualified leads, but now you can optimize around this even more. You can use branching logic in your workflows to check if the contacts in that workflow have performed a specific high-value action or completed a specific event. Branches should act like small-scale goals that still align with your overall goal. This way, you can further optimize your funnel without forgetting what you are really after.

Because of HubSpot's integrated nature, your workflows tool is able to branch on a slew of different criteria and triggers from every digital marketing channel. As a result, you can provide much-needed context to marketing and sales automation in an inbound way.

Let's take a look at how branching logic actually works.

Navigate to Workflows

  • In your HubSpot account, navigate to Automation > Workflows.
  • In your HubSpot Sales Hub Professional account, navigate to Automation Workflows

Create a new workflow or edit an existing one

From the workflows dashboard, click Create workflow in the upper right or click the name of an existing workflow.

Name your workflow and select workflow type

On this screen, enter a name for your workflow at the top and select a workflow type. In this example, we'll select Start from scratch. When you're done, click Create workflow in the upper right.

Implement the first steps of your workflow

Begin building your workflow. Ensure that you've set your desired enrollment triggers and a goal, if applicable. You can also add actions or delays as needed before adding in your branching logic.

Please note: if your branch criteria will be based on a contact engaging with an asset from a previous action within the workflow (e.g., contacts opening an email that is sent in a previous action), it's important to add a delay before your branch to ensure that your contacts have time to engage with your assets before being evaluated by the branching logic. 

Add if/then branch

Now that you've set your starting conditions and goal list, you can begin to identify where you'll want to use branching logic.

Select the plus icon in the desired step location where you want to begin your branch, then select Add if/then branch from the sidebar menu that appears.

For your if/then branch, set your criteria in the same way you would set your enrollment criteria at the start of the workflow.

This example criteria will look for any contacts that have a known value for the property Contact owner.

If 'Yes' or 'No'

Continue adding actions down the appropriate branches by clicking the plus icon to add an action under the Yes branch or under the No branch.

In the example below you'll see that, if the contact enrolled in this workflow has a known value for Last email click date, their Lifecycle stage contact property will be set to Marketing Qualified Lead. If they don't have a value for Last email click date, then their Lifecycle stage contact property will be set to Lead.

Activate workflow

After you've set up your workflow with your branching logic, click Review in the upper right-hand corner to review your workflow steps. Click Activate to turn your workflow on.

Was this article helpful?

If you still need help you can get answers from the , or to contact support.

Previous article:

Next article: