> For the complete documentation index, see [llms.txt](https://docs.senpiper.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.senpiper.com/workflow-builder/how-to-create-workflows/defining-conditions-for-a-step.md).

# Define conditions for a workflow step

## Apply a condition

### Sample use case

> Let's say if you want to create two branches in a process. There is a field named as "Total Amount" in a form where you are applying the workflow. We need to apply a condition as follows
>
> If Total amount is > 10000 then a new branch of workflow is created
>
> If Total amount <= 10000 then a seperate branch is created

<figure><img src="https://4216568905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mc6E3BSGr4i8kVdH38k%2Fuploads%2FlxpvMrQTJ75TvaH23bQn%2Fworkflow%20sample%20condition.png?alt=media&amp;token=ac9bca30-b757-455c-b591-2ac8c401fb33" alt=""><figcaption></figcaption></figure>

### Start of a workflow

A workflow starts when a form is submitted, so when you start configuring a workflow the first item you will see is a "submit" button step. Submit button step has the following properties

<figure><img src="https://4216568905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mc6E3BSGr4i8kVdH38k%2Fuploads%2FppcACsskAuKMIpMaIj2S%2FSubmit%20button.png?alt=media&amp;token=74708a49-c8f5-4b82-9633-d0ca9e08b4fa" alt=""><figcaption><p><em>Workflow Initial Step</em></p></figcaption></figure>

1. **Node ID:** This ID helps identify a step in the workflow. it follows a sequence n-1, n-2, n-3 ....etc
2. **Settings icon:** Clicking on this icon helps you provide the process log when the form is submitted.
3. **"+" icon**: which helps you define the further steps of the workflow

### Let's apply a condition in the workflow builder

When you click the "**+**" icon next to the button system asks if you need to "apply a condition"

<figure><img src="https://4216568905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mc6E3BSGr4i8kVdH38k%2Fuploads%2F7lOIHoF7chJcHEFfc5Ti%2FSubmit%20button%20%E2%80%93%20condition%20yes%20no.png?alt=media&amp;token=df461c8f-8315-45f6-97c5-7833ce7d1121" alt=""><figcaption><p><em>Apply a condition on Initial Step</em></p></figcaption></figure>

&#x20;The **Set condition** window is displayed on the right. Click on "**Add rule**" to define the criteria

<figure><img src="https://4216568905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mc6E3BSGr4i8kVdH38k%2Fuploads%2FyJJy0PEai9VfCUv7g5HD%2FAdd%20rule.gif?alt=media&amp;token=7e26a845-82de-44f7-a570-cbed5cba6c3a" alt=""><figcaption><p><em>Add Rule for conditions</em></p></figcaption></figure>

2\.    You can select the form field, Operator, and value while adding a rule

> Example: In a process you want to create a condition, if "Total Amount" is > 10000 then create a branch&#x20;

<figure><img src="https://4216568905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mc6E3BSGr4i8kVdH38k%2Fuploads%2FdtmhMfibjgQR5KewUrd9%2Fimage.png?alt=media&amp;token=75d7bb80-1019-4610-a69a-90edea24ec6c" alt=""><figcaption><p><em>Set Condition (Total Amount>10000)</em></p></figcaption></figure>

3\.    To save this condition, click **Apply** at the bottom right.  The condition is added to the workflow in the following manner.

<figure><img src="https://4216568905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mc6E3BSGr4i8kVdH38k%2Fuploads%2Fox36Ipn4ZRfUM9Wccb0Y%2Fimage.png?alt=media&amp;token=c0f869c4-23fa-4632-a517-4dc6336af20a" alt=""><figcaption><p><em>Condition Added</em></p></figcaption></figure>

{% hint style="info" %}
**Question:** Now that we know how to add a condition, can you add the condition: Total Amount <= 10000 similarly?&#x20;

**Answer:** Click on "**+**" icon again in front of submit button and repeat the above steps
{% endhint %}

The final result will look like this:

<figure><img src="https://4216568905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mc6E3BSGr4i8kVdH38k%2Fuploads%2FfGlcxJp3tJwrs65LNZG6%2Fimage.png?alt=media&amp;token=d006a3c1-05ba-4614-812e-640eccb1e811" alt=""><figcaption><p><em>Both Conditions added</em></p></figcaption></figure>

{% hint style="info" %}
You can add multiple conditions at a step as per the process requirement
{% endhint %}
