# HubSpot Workflows API: How to Create Parallel Branches (Like UI's Visual Branching)?

**URL:** <https://community.hubspot.com/t/hubspot-workflows-api-how-to-create-parallel-branches-like-uis-visual-branching/136354>\
**Category:** APIs & Integrations\
**Tags:** workflows\
**Created:** [July 16, 2025, 4:54pm UTC](https://community.hubspot.com/t/hubspot-workflows-api-how-to-create-parallel-branches-like-uis-visual-branching/136354 "2025-07-16T16:54:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDevAdmin](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@SDevAdmin](https://community.hubspot.com/u/SDevAdmin)\
**Post date:** [July 16, 2025, 4:54pm UTC](https://community.hubspot.com/t/hubspot-workflows-api-how-to-create-parallel-branches-like-uis-visual-branching/136354/1 "2025-07-16T16:54:15Z")

</div>

Hi all,

I’m currently building automated workflows using the[HubSpot Workflows API.](https://developers.hubspot.com/docs/api/automation/workflows) I’m trying to replicate the same logic I see in the **HubSpot UI** , where we can define **parallel branches** based on filters like contact job titles (e.g., CEO, CISO, COO), and assign different email sequences to each branch.

In the HubSpot UI, I can create a branching step that evaluates multiple conditions in parallel, like:

- If job title is CEO → send Email A
- If job title is CISO → send Email B
- If job title is COO → send Email C
- Else → end workflow or do fallback action

 ![SDevAdmin_0-1752684518219.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/3/2/32b1bf33882630cda051c5d3c2b3f8d7cda31aeb.png)

I want to create the same kind of clean, flat branching structure using the API.

Work done:

- Workflow enrolls contacts based on list membership (via segmentCriteria).
- For each contact, I’m checking their job title (e.g., CEO, CISO, VP, etc.) and sending them a tailored email sequence.
- My current implementation builds branching logic using BRANCH actions, with one condition per branch and the next condition linked via rejectActions.

This creates a deeply nested structure that works correctly, but it doesn’t reflect the **UI-style layout** we want: where conditions appear as **parallel branches** checked in order (like “If title is CEO → do this, else if title is CISO → do that, else if VP → another,” etc.).

 ![SDevAdmin_1-1752684640198.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/7/74b01a9d539ec9051e932a90cfb1b0042e486c1a.png)

Here is my code:

for (const company of companies) {  
const companyName = company[“company name”];  
const listId = company[“listId”];  
const people = company[“person”];

const workflow = {  
name: `[Agentic AI] ${companyName} Workflow`,  
type: “DRIP\_DELAY”,  
enabled: false,  
onlyEnrollsManually: true,  
segmentCriteria: [  
[  
{  
filterFamily: “ListMembership”,  
operator: “IN\_LIST”,  
list: listId,  
withinTimeMode: “PAST”  
}  
]  
],  
actions: []  
};

let branchActionId = 1;  
let actionId = 100;  
let lastRejectBranch = null;

for (let i = people.length - 1; i \>= 0; i--) {  
const person = people[i];

const branch = {  
type: “BRANCH”,  
actionId: branchActionId++,  
filters: [  
[  
{  
property: “jobtitle”,  
operator: “EQ”,  
value: person.jobtitle,  
type: “string”,  
filterFamily: “PropertyValue”  
}  
]  
],  
acceptActions: [  
{  
type: “EMAIL”,  
emailContentId: person.email\_id,  
actionId: actionId++,  
stepId: 1,  
goalListCount: 0  
},  
{  
type: “DELAY”,  
actionId: actionId++,  
delayMillis: 3 \* 24 \* 60 \* 60 \* 1000 // 3 days  
},  
{  
type: “EMAIL”,  
emailContentId: person.email\_follow\_up\_id,  
actionId: actionId++,  
stepId: 2,  
goalListCount: 0  
}  
],  
rejectActions: lastRejectBranch ? [lastRejectBranch] : []  
};

lastRejectBranch = branch;  
}

if (lastRejectBranch) {  
workflow.actions.push(lastRejectBranch);  
}

await tools.HubSpot\_Workflow(workflow);  
}

#### **What I’m trying to achieve:**

I want to create workflows via the API that result in a **flat, UI-equivalent structure** :

- One branching step - single BRANCH action with multiple filters and set them in order.
- Multiple conditions based on (job titles)
- One path executed per title
- A clean fallback “None met” action (like ending the workflow)

**Is there a recommended way to implement “parallel” conditional branches** (as seen in UI) using the API without chaining deeply nested rejectActions?

---

<div class="post-metadata">

**Author:** ![MichaelMa](https://avatars.discourse-cdn.com/v4/letter/m/b5ac83/32.png) [@MichaelMa](https://community.hubspot.com/u/MichaelMa)\
**Post date:** [July 16, 2025, 7:57pm UTC](https://community.hubspot.com/t/hubspot-workflows-api-how-to-create-parallel-branches-like-uis-visual-branching/136354/2 "2025-07-16T19:57:18Z")

</div>

FYI: You can run pull a workflow and see the JSON for it via the GET request. This is probably the easiest way to see how something is built for workflows.

> **[Retrieve workflows - HubSpot docs](https://developers.hubspot.com/docs/api-reference/legacy/automation/workflows/get-workflows)**
>
> Retrieve a list of automation flows with optional pagination using the 'after' and 'limit' query parameters.

As for your question, you need to use listBranches option in the Branch node. You would then use the nextActionId to the items under each node. This would mean you would have to define each action with an Id and then push one action to the next.

Eg,

```lia-code-sample
{
	"actionId": "7",
	"listBranches": [
		{
			"filterBranch": {
				"filterBranches": [
					{
						"filterBranches": [],
						"filters": [
							{
								"property": "hs_email",
								"operation": {
									"operator": "IS_EQUAL_TO",
									"includeObjectsWithNoValueSet": false,
									"values": [
										"johndoe@hubspot.com"
									],
									"operationType": "MULTISTRING"
								},
								"filterType": "PROPERTY"
							}
						],
						"filterBranchType": "AND",
						"filterBranchOperator": "AND"
					}
				],
				"filters": [],
				"filterBranchType": "OR",
				"filterBranchOperator": "OR"
			},
			"branchName": "Test 001",
			"connection": {
				"edgeType": "STANDARD",
				"nextActionId": "8"
			}
		},
		{
			"branchName": "Test 002",
			"connection": {
				"edgeType": "STANDARD",
				"nextActionId": "9"
			}
		},
		{
			"branchName": "Test 003",
			"connection": {
				"edgeType": "STANDARD",
				"nextActionId": "10"
			}
		}
	],
	"type": "LIST_BRANCH"
}

```

_Moderator Note: this post was reviewed for relevancy and optimized for clarity on September 30, 2026. Thank you for your contributions to the HubSpot Community!_

---

<div class="post-metadata">

**Author:** ![OJ\_ONT](https://avatars.discourse-cdn.com/v4/letter/o/a587f6/32.png) [@OJ\_ONT](https://community.hubspot.com/u/OJ_ONT)\
**Post date:** [September 23, 2026, 9:56am UTC](https://community.hubspot.com/t/hubspot-workflows-api-how-to-create-parallel-branches-like-uis-visual-branching/136354/3 "2026-09-23T09:56:31Z")

</div>

Static branches didn’t include the logic operator in json exports or allow you to set this in imports - but that changed yesterday.

static branches are the only ones that can use the output values from custom code or webhook triggers - so this was a big gap!

I spoke to a CS rep at unbound last week. They raised an engineering ticket for it that evening. Two business days later it was released in production.

JSON now includes;

staticBranches[].operator

Which allows you to set the logic for the branch e.g is equal to, is not equal to.

I’m stoked about this!

---

<div class="post-metadata">

**Author:** ![Berangere](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/berangere/32/220784_2.png) [@Berangere](https://community.hubspot.com/u/Berangere)\
**Post date:** [September 23, 2026, 11:38am UTC](https://community.hubspot.com/t/hubspot-workflows-api-how-to-create-parallel-branches-like-uis-visual-branching/136354/5 "2026-09-23T11:38:40Z")

</div>

Hi @OJ_ONT and all!

This is awesome news! 🙌 Thanks for sharing the update with the HubSpot Comunity and especially for calling out the new `staticBranches[].operator` field. That’s a really helpful detail for anyone working with static branches and JSON imports/exports.

Love seeing how quickly this went from feedback to production, too! 🚀

Here are the resources for more information:

- [Retrieve a workflow - HubSpot docs](https://developers.hubspot.com/docs/api-reference/legacy/automation/workflows/get-workflow)
- [Update a workflow - HubSpot docs](https://developers.hubspot.com/docs/api-reference/legacy/automation/workflows/update-workflow)

Are you already putting this to use in one of your workflows? Would love to hear what you’re building with it @OJ_ONT and all!

Thanks again and wishing you a fabulous day!

Looking forward to seeing you around the Community! 🧡  
Bérangère
