How to use branching logic in workflows

Last updated: November 17, 2017

Available For:

Marketing: Pro, Enterprise
Sales: Professional

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

Navigate to Workflows
  • In your Marketing Professional or Enterprise account, navigate to Contacts > Workflows.
  • In your Sales Professional account, navigate to Sales Tools > Workflows.

Create a new workflow or edit an existing one

From the workflows dashboard, click New workflow in the upper right-hand corner or hover over an existing workflow and click Edit.

Name your workflow and select workflow type

Name your workflow, then select the type of workflow you wish to use. In this example, we will select the Standard workflow type. Once selected, click Create workflow.

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 HubSpot 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 the toggle ON in the upper right-hand corner to activate your workflow.

Was this article helpful?

Previous article:

Next article: