Lanka Lanka docs

Script

Calculate or change variables, call an outside service — with no reply to the person.

The "Script" step in the editor

When to use it

  • Work out a cart total, a discount, a booking date.
  • Add an order to a list.
  • Fetch data from an API: a rate, stock, free slots.

How it works

A script is short lines like total = price * count. Everything the language can do is on the Scripts page. The "Full reference" link in the step's form opens it.

If the script fails, the dialog takes the "error" branch — add one so the person is not left without an answer. A failed request to a service is not an error: check its result yourself.