Become a HubSpot power user — join us for HubSpot Training Day 2017.

How to use branching logic in Workflows

Last updated: December 13, 2016

Available For:

Marketing: Pro, Enterprise
Sales: N/A

Good marketing automation starts with a goal in mind. Great marketing automation 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 automation strategy to the fullest.

Branching logic means that 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 which option they click, A or B.

Branching logic fits nicely within the goal-based framework of HubSpot's Workflows. 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 "mini-goals" that still align with your overall goal. This way, you can further optimize your funnel without forgetting what you are really after.

When we create nurturing campaigns, we want those to be personalized and relevant, too, just like the rest of our marketing. That means we need to anticipate and consider how our contacts will interact with the content in the campaign, and optimize around those possible actions using branching criteria. Because of HubSpot's integrated nature, the Workflows tool is able to branch on a slew of different criteria and triggers from every digital marketing channel. Now, we can provide much-needed context to marketing automation in an inbound way.

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

Navigate to Workflows

From your HubSpot Marketing Dashboard, navigate to Contacts > Workflows.

Create a new workflow

From the Workflows Dashboard, click the button at the top-right to create a New workflow or click on the name of an existing workflow to 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 criteria and a goal, if applicable. You can also add actions or delays as needed before adding in your branching logic.

Note: If your branch criteria will be based on a contact engaging with an asset from a previous action within the workflow (i.e. 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 already set your starting conditions and goal list, you can begin to identify where you'll want to use branching logic.

Choose the plus icon in the desired step location where you want to begin your branch, then select add if/then branch.

In the step below, you can see that If/then branch was selected from the action menu. The criteria was set in the same way you would set your enrollment criteria in a workflow.

This example criteria will look for any contacts that clicked a link within an email that was sent from a previous step in the workflow. 

If YES or NO

Continue adding actions down the appropriate branches by clicking the plus sign 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 clicks on the set link in the "90 Day - close opp" email, they will have their Lifecycle Stage contact property set to Marketing Qualified Lead. If they don't click on the link in that email, the workflow will send an internal email for follow-up.

Activate workflow

After you've set up your workflow with your fancy new branching logic, make sure you toggle your workflow to ON.

Was this article helpful?

Previous article:

Next article: