# Branch

Set multiple branches based on multiple outcomes with the Branch core connector

## Overview

There will be times when using the simple yes/no logic of a Boolean connector will not suffice, and you will need to set multiple pathways depending on the results being picked up from your data.
This is where the Branch connector comes in!

> **Warning:** Please be aware that the Branch connector is **not** a parallel processing connector!If you want to set up asynchronous parallel processing to increase workflow efficiency, please see the guide to [using callable workflows](https://tray.ai/documentation/platform/automation-integration/building-workflows/composable-workflows/calling-other-workflows) in our 'Processing data and scaling' section

## Example - creating branches depending on support ticket type

The below workflow illustrates an example whereby you have received a support ticket as a trigger:
![branch-workflow](https://tray.ai/documentation/images/connectors/core/branch/0a82345e-9a6303d5_branch-workflow-2.png)

## Step 1 - set the Value to Test

You will see that the **Value to Test** for the **Branch** connector is set as `$.steps.trigger.body.info.task_type`
Note that the value you are checking for here will depend on the data that is sent by the webhook / trigger / service connector. It could, for example, be `$.steps.trigger.body.info.ticket_type` or `$.steps.trigger.body.data.task-category` etc.

## Step 2 - name the branches

You will also see that the branches are named according to the different types that the ticket might be - **new, escalate, resolve, deescalate**.
You can then set each branch to take the appropriate action according to the ticket type. In the above example, as well as creating an SF task for every ticket, the **escalate** and **resolve** ticket types also include a notification to Slack - to replicate the idea that you want to make sure people are notified immediately.
Below is a sample output for the trigger, from which you can see that the **resolve** value was picked from the `$.steps.trigger.body.info.task_type` jsonpath, thus triggering the **resolve** branch:

```json
{
	"method": "post",
	"path": "/",
	"body": {
		"info": \{
	"ticket_requester_name": "Ron Jackson",
	"ticket_organization_name": "Acme",
	"ticket_title": "Replacement Widgets",
	"ticket_requester_email": "rjackson@acme.com",
	"task_type": "resolve",
	"urgency": "",
	"ticket_requester_org_id": "3345234554",
	"ticket_id": "4567",
	"service_plan": "plan_inactive",
	"ticket_account": "Central Command",
	"ticket_url": "http://centralcommand.zendesk.com/agent/tickets/4567",
	"pd_incident_id": ""
     \},
	"query": {},
	"headers": \{
		"x-real-ip": "10.x.xxx.x5",
		"user-agent": "Zendesk URL Target (centralcommand)",
		"accept": "*/*",
	\}
}
```
