Skip to main content

Introduction to tasks

Tasks are a powerful feature of Bobuild, that let you create automated workflows without programming. They can be used to perform a variety of operations, such as:

  • Sending emails to one or more records
  • Updating values
  • Calculating formulas
  • Performing checks
  • Advancing a workflow
  • Generating documents
  • Creating new records
  • Deleting records

Tasks can be configured in several contexts. According to the context, they will run on one single record or will run on multiple records.

ContextRecordsDescription
FormSingleTask will be executed at form submission.
GridMultipleUsers will be able to select one or more records with checkboxes and run a task on multiple records at once.
API endpointSingle/MultipleTask will be executed whenever the endpoint is called.
Batch taskMultipleTask can be run manually to perform batch updates.
Scheduled taskMultipleTask will be run automatically according to a schedule.

Anatomy of a task

The interface to configure a task differs based on whether it's running on a single record (such as form tasks) or whether it's running on multiple records (such as grid or batch tasks) as things can get a bit more complex in the second case but definitely very powerful. However, in general a task has:

  • a set of conditions under which the task will be executed or not
  • one or more actions to run

Actions are evaluated sequentially. If a condition doesn't match, evaluation doesn't stop and the next action will be evaluated.

For tasks that run on multiple records, all the actions are repeated for all the input records. This will be the sequence:

  1. Record #1
    1. Action #1 is processed on record #1
    2. Action #2 is processed on record #1
    3. Action #3 is processed on record #1
  2. Record #2
    1. Action #1 is processed on record #2
    2. Action #2 is processed on record #2
    3. Action #3 is processed on record #2

However, if you don't want to repeat an action for all the records you can decide to run it only for the first one or the last one. For instance:

  1. Record #1
    1. Action #1 is processed only on the first record
    2. Action #2 is processed on record #1
    3. Action #3 is processed on record #1
  2. Record #2
    1. Action #2 is processed on record #2
    2. Action #3 is processed on record #2
Example

Let's see a complex example. Suppose you want to let the user select multiple products from a list and then click a button to generate an invoice. For this, you'll create a grid with the product list, and configure a task on this grid that performs the following actions:

  • Action #1: create a new object of type invoice and attach it to the current customer (to be run only on the first record)
  • Action #2: attach the currently processed record to the last created invoice (to be run on all records)
  • Action #3: send a notification e-mail to the team (to be run only on the last record)

Creating a task

We'll now see how to create a task at the object level, but the procedure is the same for any other place where tasks are supported. So, open the object you want to run the task on and click the Tasks button:

Now click on the Add task button and your task will be created:

Now, give your task a name, then set conditions to define which records will be affected by the task, and finally set one or more actions to perform on the selected records.

Example

Suppose you want to send a reminder e-mail to all customers who owe you money:

Scheduled tasks

Scheduling a task is a convenient way to perform automated actions, such as sending reminders or advancing workflows. Bobuild lets you configure a task to be run on a hourly, daily, weekly or monthly basis.

tip

Contact us in order to enable scheduled tasks for your app.