> For the complete documentation index, see [llms.txt](https://docs.jetadmin.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.jetadmin.io/workflow/build-workflow-steps/add-conditions-and-branches.md).

# Add conditions and branches

In this section you will learn about Rules

Use a condition when later steps should depend on an input or a step result.

![](https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FKdwHh3eLanKGe84WSsBb%2Fdznxbt.png?alt=media\&token=ba5dca9c-e189-422f-af71-5be1ab529513)

## Add a Yes/No condition

1. Add a rule step and choose the Yes/No condition.
2. Open the condition's formula.
3. Compare a workflow parameter or step value with the expected value.
4. Add the actions for the Yes and No branches.
5. Test one input for each branch.

For a ticket-priority check, choose the priority value through the picker and compare it with the source's exact priority text. The formula editor supports equality comparisons such as **EQ()**. Quote literal text values.

![](https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2F5saNl36qJ1VA2L0FPO2e%2Fsrbtf.png?alt=media\&token=f3ac5bd6-f439-4909-8e6a-53740a69f1c2)

A blank value is a separate test case. Decide whether it should follow a fallback route or stop before a write action.

## Add a Switch condition

Use Switch when the process needs several condition-based routes. Configure each route's condition and an **ELSE** fallback for inputs that do not match.

![](https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FdZEApy4DkDEClqqLhKuC%2Fszvxcr.png?alt=media\&token=4dee1435-b6d3-49f8-bff0-3d701f8dc13e)

Make the conditions mutually exclusive when you intend one route per input. Test each route and the fallback; do not rely on an unverified precedence rule for overlapping conditions.

## Verify the outcome

| Test input                       | Expected result                       |
| -------------------------------- | ------------------------------------- |
| A value matching the first route | Only the intended actions change data |
| A value matching another route   | The corresponding outcome is saved    |
| A blank or unrecognized value    | The fallback behaves as designed      |

Inspect both the executed steps and the final record. For independent simultaneous work or a pause, see [parallel branches and delays](/workflow/build-workflow-steps/run-parallel-branches-and-add-delays.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.jetadmin.io/workflow/build-workflow-steps/add-conditions-and-branches.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
