Use if/then branches in workflows
Last updated: June 26, 2020
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 contact-based workflow, or creating a company, deal, ticket, or quote-based workflow.
- Click the plus icon +.
- 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.
- 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.
- Click the plus icon + to add more actions if needed.
Please note: you can add up to 19 if/then branch levels in a workflow. When you attempt to add more than 10 if/then branches, you'll see a warning message recommending you to streamline your workflow by enrolling contacts into another workflow.
- Next, click the Settings tab. Learn more about managing contact-based workflow settings or managing company-based, deal-based, ticket-based, or quote-based 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
Contact-based workflows
In contact-based workflows, the Test feature will enroll the record and all workflow steps will execute immediately. Therefore, if you set up a workflow with an if/then branch that depends on a record's action from a previous step, there will not be enough time for the test object to take action before they reach the if/then branch.
To test if/then branches in your contact-based workflow, add shorter delays to the workflow, then manually enroll a test object:
- In your HubSpot account, navigate to Automation > Workflows.
- Click the name of a workflow.
- In the workflow editor, select a delay.
- In the right panel, set each delay in your workflow to a few minutes. There should be enough time for the object to take action before reaching the if/then branch.
- Once you've edited your delays, click Review, then click Activate to turn on your workflow.
- Manually enroll your test object.
- Make sure that your test record meets the criteria of your if/then branches. For example, if the if/then branch criteria depends on a contact or associated contact having opened an email, make sure to open the email before the delay is over.
Company, deal, ticket, and quote-based workflows
