Skip to Content
Automations

Example: checking a rental caravan

Build step by step a flow that creates a check task with subtasks after departure, or raises the priority of the open task

Last updated on

This example builds a flow with a filter, Find task, Set task priority, an If / else and a task with subtasks. You do not need an API request for it.

In Tillor demo environments this flow is already there as a paused example under the name Rental caravan check. You can look at it there while you build along.

What the flow does

A guest leaves a static caravan. The caravan has to be checked before the next guest.

  • If there is no open check task for that terrain yet, the flow creates one, with five subtasks and a deadline after 7 days. The task also goes to the colleague who ended the occupation
  • If there is already an open check task, for example because the caravan became free twice shortly after each other, the flow does not create a second task. Instead the priority of the existing task goes up one step

The two task steps at the bottom are almost the same. Only the description differs: if the system ended the occupation, there is no colleague to mention.

What you need

  • You have the permission Manage automations, or All permissions
  • Your organisation has a terrain type for static caravans, in this example Static caravan
  • Optional: a board and a column for the check tasks

Building the flow

1. Creating an empty flow

  1. Go to Admin > Automations and click New automation
  2. Choose Start from scratch
  3. In the breadcrumb at the top, fill in the name Rental caravan check
  4. Click on the canvas, next to the steps, and in the panel fill in under Description what the flow is for

2. Setting up the trigger

  1. Click the trigger. Leave Starts from on When something happens
  2. Under Event choose occupation:ended. Type occupation to search
  3. Under Step name give the step the name Occupation ended

Now the flow starts for every occupation that ends. You want it only for static caravans:

  1. Under Only when click Add condition
  2. Click Variable and choose occupation.terrain.terrainTypeId
  3. Leave the comparison on is
  4. For the value, choose the terrain type Static caravan
Trigger with the condition terrain type is Static caravan

3. Finding an open check task

  1. Add a Find task step, connect the trigger to it and name it Open check task?
  2. Under Title fill in Check {occupation.terrain.name}
  3. Leave Linked to the records of the event, Only tasks that are not completed and Skip subtasks on

The step now looks for a main task that is not yet completed, is called exactly Check followed by the name of the terrain, and is linked to the same terrain, the same customer or the same reservation. Then the flow continues via Found or Not found.

4. Raising the priority

  1. Add a Set task priority step, name it Raise priority and connect the Found exit to it
  2. Leave Task on {foundTask.id}
  3. Leave Change on One step higher and Raise up to on High

5. Checking who ended the occupation

  1. Add an If / else step, connect the Not found exit of Open check task? to it and name it Ended by a colleague?
  2. Click Add condition and under Variable choose triggeredBy.id
  3. Choose the comparison is not empty

{triggeredBy.id} is empty if the system ended the occupation, for example a scheduled task. Then the flow goes via No.

6. Creating the task

Add a Create task step, name it Create check task and connect the Yes exit to it. Fill in the fields like this:

FieldValue
TitleCheck {occupation.terrain.name}
DescriptionGenerated automatically., an empty line, and Occupation ended by @{triggeredBy.name}({triggeredBy.id})
PriorityLow
Due after7 days
Also assign whoever caused the eventOn
Link to recordsOn
SubtasksFive lines: Cleaning, Inventory, Internet + TV, QR code frame, Check for odd jobs

With @{triggeredBy.name}({triggeredBy.id}) the colleague is mentioned in the description. If you want the task to go on a board, choose a board under Add to board and a column under Column. Whoever must always receive the task, you choose under Assign to.

Keep the title the same as in Open check task?. Otherwise the search step will not find the task the next time.

Create check task step with the settings in the panel

7. The task for the system

  1. Click the step Create check task and then Duplicate step
  2. Name the copy Create check task (system) and connect the No exit to it
  3. Set the Description to only Generated automatically.

8. Testing and enabling

  1. Check that there is no issues button (such as 1 issue) at the top of the panel
  2. Open the Test run tab and click Run test. You see which path the flow takes and which title and description the task would get. Nothing is created
  3. Turn the Active switch on

Why two steps instead of one

You can also use the Find task and Set task priority steps separately. If, for example, you want to do nothing when the task already exists, simply connect nothing to Found. If you want to give the existing task a comment or a different status, put another step after Found, such as Set task status with {foundTask.id}.

What happens in practice

SituationWhat the flow does
No open check task for this terrainCreates a new task with five subtasks
Open task with priority LowSets it to Medium
Open task with priority MediumSets it to High
Open task with priority High or UrgentLeaves the priority as it is
Occupation on a different terrain typeDoes not start

What the task looks like in Tillor

The task is in the name of Workflow and is linked to the terrain and the customer of the occupation, and to the reservation if there is one. Not every occupation has a reservation. The colleague who ended the occupation is on the task as the assigned person.

Was this page helpful?

On this page