Skip to content

Automations (Preview)

Warning

This feature is currently under development, and its final scope and capabilities have yet to be determined. The information provided here is subject to change, including potential removal.

Automations can be enabled in your local environment using the run_automations feature switch.

Automations is the perfect tool when you want something to happen automatically. Automations requires no coding and are created in a visual point-and-click tool.

Examples of Automations:

  • Create a "status change" when a deal is closed.
  • Send notifications upon work order assignment.
  • Enroll a lead into an automated flow upon creation.
  • Record a timestamp when a ticket is closed.

These can be conceptualized as "WHEN an event occurs, THEN execute the following actions." Automations break down these processes into triggers and steps:

WHEN: [Trigger occurs]
THEN: [Execute Step1], [Execute Step2], [Execute Step3], ...

The steps are picked from a list of available steps, which we call The Step Library. This library covers the most common needs such as creating and updating objects. For more complex Automations, multiple steps may be necessary.

To refine execution, steps can include prerequisite conditions, akin to if-statements, ensuring that only relevant actions are taken:

WHEN: [Trigger occurs]
THEN: IF [condition1] { Execute Step1 }, IF [condition2] { Execute Step2 }, IF [condition3] { Execute Step3 }, ...

Getting Started:

Access Automations in Lime Admin -> System -> Automations.

There you will find:

  • A visual automation builder
  • Logs from all previously run Automations

Triggers

Triggers define the WHEN part of an Automation. The only available trigger is "Lime object is being created or updated", applicable to various scenarios such as winning a deal, closing a ticket, or creating a lead.

Lime object is being created or updated

Use this trigger to automate many of the customizations that traditionally have been created using custom limeobjects. The automations are run on uow.commit() after prepare_update but before before_update.

Future Triggers (Not Available in Preview)

  • Lime object has been created or updated (not available in preview): Runs automations in the event handler. Sometimes this is preferable to be sure the originating change has been persisted to the database and other times its just to be able to run steps that takes longer to complete (like calling an external system).

  • User clicks an action in the web client: Today adding a new custom action to the web client requires both a custom command and a custom endpoint. Using a "standard automation action" this could be done without writing any code.

Step Library

The THEN part of an Automation consists of various steps available in the Step Library. These include creating new lime objects, calculating formulas, and updating fields.

Create new

This step creates new lime objects, for example status change, history or participant. This is used for cases such as "When a Deal changes status, create a Status Change Note about this" or "When a Lead is created, add this Lead as a Participant to a specific Automated Flow"

Formula

This step offers a kind of script language called Jinja. It can be used to for example format phone numbers, capitalize strings or do arithmetics. At first glance Jinja can be daunting but most users will only need to learn a subset.

The lime object that triggers the automation is available as the variable event.limeobject and all formatting-filters found in Document Templates can also be used here.

Examples:

  • Concatenate firstname and lastname when updating a coworker:

    {{event.limeobject.firstname}} {{event.limeobject.lastname}}
    
  • Get today's date:

    {{context.today}}
    
  • Compute the weighted value of a deal:

    {{event.limeobject.value * event.limeobject.probability}}
    
  • Create a good note (in markdown) to be used in a status change note when closing a Deal:

    {{context.active_user.name}} closed deal **{{event.limeobject.name}}**
    on company {{event.limeobject.company.name}} for 
    **{{event.limobject.value | format_number(locale="sv_SE", decimal_places=2)}} SEK**.
    

Refer to the Document Templates Document templates' documentation and the official Jinja documentation for more filter examples.

Update fields

This step updates one or more fields on a lime object. Typical use cases are "When a Deal is won or lost, set the Deal's Closed/Won Date to Today's date" or "When a Deal is updated, calculate the Weighted Value and save it to the field Weighted value."