# Step 3: Create Process flow

### The flow of our process as per our requirements

<figure><img src="/files/v5fGrly7dBgHKrLhIR3k" alt=""><figcaption></figcaption></figure>

### Step-by-step guide for implementing the above flow

Using the[ <mark style="color:purple;">**workflow builder tool**</mark>](https://docs.senpiper.com/workflow-builder/introduction) we’ll be able to **mimic the hierarchy** followed in the organization regarding the **business processes**.

#### 1. Initiate a workflow

Go to workflow builder and click "**Add a new workflow**" S**elect the group** and **the form** for which you want to **create the workflow**. Name your workflow "YourName\_ Reimbursement Workflow"

![](/files/Fi0OqlaZIcScxJn75D56)

Once you’ve filled in the requisite details, it’ll show you the interface for the workflow builder.

![](/files/ueNltF04f3O9lJgosnQG)

Now proceed by clicking the settings button beside the submit button to add a comment. “**The reimbursement form has been submitted**.” Learn more about the <mark style="color:purple;">**comments in workflow.**</mark>

{% hint style="info" %}
Comments are mandatory in every button of the workflow you create. It acts as a changelog when any workflow action button is clicked.
{% endhint %}

![](/files/SRB8OUGyVOrt9rhi0RLO)

#### 2. **Apply a condition**&#x20;

> Use case: As we discussed, if the reimbursement amount is **more than 10,000** it’ll be assigned to the **Department Head,** and amounts less than that will be handled by the **Manager**.

* Click the green plus icon and select the yes option for ‘**Do you want to apply any condition**’. Learn more on <mark style="color:purple;">**how to apply a condition at a step**</mark>

<figure><img src="/files/BD7WXNvCgP7uhRy6UGVP" alt=""><figcaption></figcaption></figure>

![](/files/5lcHMGZdzQP6Dr0NCsri)

* Now to set another condition go back to the ‘**+**’ icon in front of submit button and add the rule "Total Amount" <= 10,000

<figure><img src="/files/ZqH2tPjklw00Q1aYqIYA" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/Y7qHD3XnEnvs1kLMee0i" alt=""><figcaption></figcaption></figure>

* The above two conditions **create 2 separate paths** for the workflow based on the "**total amount**" of the reimbursement, the workflow would now look like this.

![](/files/h5pQo3oXKr7gNoaYljJu)

Now that we have created the 2 paths for different conditions of the workflow. we will proceed with each path

#### 3. Create action buttons in the workflow

* Click on "+" button below the condition box where "Total amount > 10000" to ‘**add a step**’. Each workflow step has the following properties
  * Target status
  * Action buttons
  * Other Actions

<figure><img src="/files/iwHjwsU2hct0u5mqqFWP" alt=""><figcaption></figcaption></figure>

* Select the target status for each node as "**submitted**". Learn more about the <mark style="color:purple;">**target status in a workflow step**</mark>
* Click on "**Define future actions**" and add a new action button "**Approve**".  Learn more about the <mark style="color:purple;">**actions buttons**</mark>

![](/files/vwi1oohWWpw6UlTRveQN)

* And while we do that, we’ll assign the button to the **Department Head**, by selecting **company defined roles** and then **Department Head**.

{% hint style="info" %}
Ensure that the "**department head"** role should be present in the system beforehand and allocated to the right users. Learn more about <mark style="color:purple;">**custom roles**</mark>
{% endhint %}

* Under the section "**form edit settings**". Click on "**manage individual fields**". &#x20;

<figure><img src="/files/dHJEZCzfDjOO0B3RFOFR" alt=""><figcaption></figcaption></figure>

* Click on manage fields and select the "**Approval remarks**" fields. Set the following properties
  * Visibility settings: **Show to user**
  * Edit settings: **make editable**
  * Optionality settings: **Make field mandatory**

> Learn more about <mark style="color:purple;">**managing fields at a workflow step**</mark>

<figure><img src="/files/T5K5JoIO8x59EFlbkzwr" alt=""><figcaption><p>Fields state management at a workflow step</p></figcaption></figure>

* Provide comments on this button under the section "**Comment log settings**".&#x20;
* Click on "**add a new button"** and add a "**Reject**" button with the same settings.

#### Adding steps for the "manager" role

* Now click on the other conditional node with "**total amount**" <= 10000 and repeat the above steps to add the "**Approve**" and "**Reject**" buttons.
* While creating the buttons on these nodes" choose the company-defined roles as "**Manager**"

{% hint style="info" %}
Ensure that the **Manager** role should be present in the system beforehand and allocated to the right users. Learn more about <mark style="color:purple;">**custom roles**</mark>
{% endhint %}

![](/files/ng3gf0ESKgVOWO1lT72o)

* Once the workflow action buttons are created for both conditions, click on the "+" icon of each button and select "**no**" to apply any condition.

> We selected no as we don't require further conditional logic in the stated requirements&#x20;

<figure><img src="/files/ADclNEQRra6khSD8ZzBv" alt=""><figcaption><p>Individual action button conditions</p></figcaption></figure>

* Once you click on continue a new step is created. Set the target status for the step accordingly. Following should be the statuses

| Button clicked | Workflow should move to following status |
| -------------- | ---------------------------------------- |
| Approve        | Approved                                 |
| Reject         | Rejected                                 |

<figure><img src="/files/R4dUwBwW1VCdezYxs7vp" alt=""><figcaption></figcaption></figure>

* Repeat this process for other sets of buttons&#x20;

#### 4. End the workflow

* Now we are at the end of the requirement of process flow requirements, let's close the workflow.
* Click on the define future actions and click on "**End workflow**"

<figure><img src="/files/wpHDnE7BWkfPxhzxkg78" alt=""><figcaption><p>End a workflow</p></figcaption></figure>

<figure><img src="/files/RR4AhqUbotiZKd8QV4AP" alt=""><figcaption><p>Workflow ended</p></figcaption></figure>

* Here’s how the finished workflow would look like

![](/files/V0fB9dSXt0VMgnrBM8rA)

To wrap everything up, click apply changes and the workflow configuration is completed.

### Testing the workflow

* Go to the created group
* Add a new submission to the reimbursement form with an amount less than 10000
* Assign the roles of "**manager**" and "**department head**" to two different users. Learn how to [<mark style="color:purple;">**add roles to users**</mark>](/user-management/roles-and-users-for-the-reimbursement-use-case.md)<mark style="color:purple;">**.**</mark>&#x20;
* Add those users to the group. Learn how to [<mark style="color:purple;">**add users to a group**</mark>](/user-management/managing-users/how-to-add-users-to-a-user-list.md)
* Login with the credentials of the that user
* Once a submission is made the user to whom the manager role is assigned will see two buttons "Approve" and "Reject"
* Click on any button and finish the workflow
* Check the status of the form


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.senpiper.com/digitize-a-sample-process/step-3-create-process-flow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
