Our first queue


In this tutorial, we will create an expense approvals process.
Let's assume our company needs to set up a system for Finance to review and approve employee expenses. The requirements we have gathered are:
  1. 1.
    Display some information submitted by the user as part of the report (receipt image, amount and concept)
  2. 2.
    Approve or reject the expense.
  3. 3.
    Correct the report where needed.
  4. 4.
    Categorize the expense.
Human Lambdas allows you to visually build UIs to execute manual processes, through what we call Queues. In the next section we will create our first queue. Let's get to the action!

Defining a queue

After we have logged in, we will go to New Queue in the Queues Home. This will take us to an empty queue builder screen:
Here we will construct a UI for this process. We can start by entering a suitable title for the queue in question, at the top of the screen. On the left-hand side panel we have a selection of blocks to drag and drop into the canvas. Let's start by adding a Text block which will act as the expense's concept:
Once we drop it into the canvas the configuration dialog will pop up. You may want to type in a Label name such as "Concept" and check the Read-only checkbox. This will prevent the concept from being edited in the UI. We can set a sample value for this block in the Placeholder field so it looks less empty.
Now, we will add a Number block for the amount (sorry, no Currency block yet!) and an Image block for the receipt image. You can use the Placeholder field to display a sample image: for instance, by using this image URL.
Next, we will add a Binary block to approve or reject the expense:
Last, we will drop a Single Selection block into the canvas, which will be used to categorize the expense. We will add a few categories through the block's configuration dialog by adding options:
And that's it! Here's the final result:
Let's go ahead and click Create. We will be taken to the Queue view right thereafter.

Bonus: Including a reason in case of rejection

Let's assume we have received an additional requirement: we want to prompt the user to specify a reason when they reject the expense. To do this, we will remove the Binary block that we have used for approving and we'll replace it with a Form block.
Form blocks allow us to specify sequences of questions with the option to configure logic jumps within it. In this case, we will set up 1) a Binary question, 2) followed by a Text question. Then we will configure the first question's conditional logic to only continue to the second question in case of a rejection:

Creating a sample task

Once the queue has been created we can create our first task. The easiest way to do this is by clicking New Task in the Queue view.
New Task creates a new task and navigates you to the task view. If the task has an attribute which needs to be set prior to creation —in the case of read-only blocks or for unmodifiable blocks such as Image— you will be prompted for those. In this example we should see the following:

Working your first task

Once you're in the task view, you can interact with it:
You can click Save if you want to persist your changes and come back to the task later, or Submit once you're done. Submitting the task will mark it as completed and send it to the queue's registered destinations, which we address in a bit more detail in the next section.

Adding connections

Connections represents any channel that may create new, or receive completed, tasks. Currently supported channels are the API, CSV file upload and download, Zapier and Webhooks —in addition to manually as we have seen earlier.
In this example we will add a webhook callback. The simplest way to test it will be to use this testing site to generate a unique URL, and log all of its received callbacks.
We access Connections through the Queue view:
We go to Destinations > Webhooks and set the callback URL. Then we can test the newly configured webhook by creating and completing a new task.

Wrapping up

This guide has focused on demonstrating how you can go about building your first queue and processing tasks end to end. If you want to learn more about each specific feature and what it can do for you, you can refer to the Manual.