Friday, April 8, 2016

Automate Request for Leave with Rethink Workflow

Request for Leave is one of the most common paper-based processes in many organizations. In this process, the employee who wants to take leave has to submit an application to the manager for approval. The manager, upon receiving the request, checks for validity of the application and either approves or rejects it. This simple workflow can be automated quickly, easily, and efficiently with Rethink Workflow at so let's get started.

First, to be able to create a workflow, the user must be an administrator of the company. Right after logging in using Google Apps for Work or Education admin account, Rethink Workflow will try to synchronize directory data including users, groups, and organizational units automatically so that you don't need to spend hours on migration.

Once the synchronization process completes, click on "Workflow" and click on "New Workflow". On the "Add a new workflow" dialog, enter the name as "Request for Leave" and click "Add."

1. Build a form

On the "FORM" tab on the workflow design screen, we will start dragging and dropping a date time field onto the center panel to create "From Date" field. On the "PROPERTIES." panel on the right,  set "Display Name" to "From Date"; "Help Text" as "Select the start date of your leave." and mark "Required" as "Yes" to indicate that this field is required.

Repeat the same steps to create "To Date" field. This time, we select "Required" as "No" to indicate that the field is optional to allow in case the employee wants to request only one day off.

Now, we will add "Type of Leave" field to allow the employee to select the type of their request. Drag and drop the "Radios" control to the center panel. On the "PROPERTIES" panel, set "Display Name" to "Type of Leave"; "Help Text" to "Select one of the following options"; "Required" to "Yes." To add three options for this field, click on the small green plus button three times and change the name to "PTO," "Sick", and "Unpaid."
Next, we will provide a textbox for the employee to enter their comment (optional) and one text box for the manager to respond. The manager's response is required if he rejects the request.

But, as you might wonder, what if each employee has a different manager? Rethink Workflow provides a feature called "Dynamic User" which help the admin to add a User Picker to the form. The employee will pick the manager from the list while filling the request.

Drag and drop a "User Dropdown" from "CONTROLS" to the form in between "Comment" and "Manager's Response" field. Set "Display Name" to "Manager" and mark "Required" as "Yes." Please take note on "manager" displayed in the "Code" field since we are going to use it later.

That is all we need for the form. Now, let's continue to build the flow.

2. Design Workflow

In this step, we will design how a request (or document), created from the form built previously, will be routed.

A workflow comprises of states and transitions. A state, represented as an oval, is the status of the document at a particular time, and a transition, represented by an arrow, denotes an action moving the document from one state to another.

To create a new state, click on "NEW STATE" and to create a new transition, click on "NEW TRANSITION". To edit an existing state or transition, simply double-click on them to open up their respective dialog.

New workflow has a "Create" transition pointing to "Created" state automatically indicating when an employee creates a request, it will be in "Created" state.

Now, let us create three more states: "Submitted" - indicating that the request is submitted and pending approval, "Approved" - the request is approved by the manager, and "Rejected" - the request is declined by the manager. Note that we check "Exit State" for both "Approved" and "Rejected" to tell Rethink Workflow that when the request reaches these states, there are no more transitions to take place.

We will continue to connect all states with transitions. First, let us add a transition from "Created" to "Submitted" state. This transition will be executed by the employee who submits the request. On the dialog, we will set "Action Name" to "Submit", "From State" to "Created", and "To State" to "Submitted." You can also decorate the action button which will be shown to the employee eventually by using fields in "Action Button Style."

On "Submit" transition, we also want to send an email notification to let the manager know, so that he or she can approve or reject the request. To do so, switch to "TRIGGERS" tab on the "New Transition" dialog, and click on "New". A "New Task" dialog will show up. On this dialog, set "Type" to "Send Email Notification", "Execution Order" to "After", "Subject" to "{{ownerName}} has submitted a {{workflowName}} for your approval." and copy the same text to the "Body" field.

Rethink Workflow supports placeholders in the email template which are useful when you want to generate email content to make it look less robotic as in other systems. When the email is sent out, it will be looking like this:

Switch to "RECIPIENTS" tab to determine the manager as the recipient of this email notification. Select "{{manager}}" in the list of options which is the code name of the Manager field in the form.

Continue doing the same to add two more transitions: "Approve" and "Reject" as in the video below. Of course, you can send out email notifications to the employee to let him know the result too. Note that in the email notification for "Reject" transition, we also include the {{managerResponse}} which is the value of "Manager's Response" field.

Remember to click on "Save" button at the bottom to save our work so far and move on to "Set Permissions" step.

3. Set Permission

In this step, we will set permissions for the employee and manager to define what they can see and do at each workflow state.

Let us first set the permission for the document owner, which is the employee who submits the request.

On "Created" state, in "Fields" section, the document owner can only view and edit "From Date", "To Date", "Type of Leave", "Comment", and "Manager" field. "Manager's response" field is kept hidden since the employee should not see this field when filling the form. In "Actions" section, the document owner will be able to take "Submit" action, so we set it to "Allowed".

On "Submitted" state, in "Fields" section, the document owner can only view all the fields except for "Manager's response". In "Actions" section, the document owner should not be able to take any action. "Approve" and "Reject" can only be taken by the manager.

On both "Approved" or "Reject" state, the owner can only view all fields including "Manager's response" but there are no actions he or she can take because they are marked as "Exit State" in step 2.

Now, let us set permission's for the manager. In all the following steps, we will select "An individual in the document" for "Viewer" field and "{{manager}}" for Document Field to tell Rethink Workflow who the manager is.

On "Created" state, the request has not yet been submitted for approval; therefore, we will set all fields to hidden. In "Actions", the manager should not be allowed to take "Submit" action.

On "Submitted" state, this is when the request is in the manager's inbox. He or she should be able to view all fields, view and edit "Manager's response", and should be able to take "Approve" or "Reject" action.

On both "Approved" and "Rejected" state, the manager can view all fields, but he or she won't be able to take any action.

4. Go live!

This step is the most rewarding step for our effort so far. We will save the workflow and publish it for everyone in our company.

Now take a cup of coffee, relax and see how your workflow operates in action knowing that you have used technology to replace a costly, and inefficient paper-based process.

In this demo, Jerry Anderson is going to submit a Request for Leave to Elizabet Dixon, and it gets approved.

The second demo, the request get rejected by Elizabet with a reason included in the email.

We have gone through four steps to create the first workflow: Build a form, Design Workflow, Set Permission, and Go Live. If you are stuck on any step along the way, please don't hesitate to contact us direct via or chat with us directly from within the application. We are looking forward to hearing feedback/comment from you.