Skip to main content

Automation logic, approvals and notifications

Besides calling other systems and sending messages, an automation can make decisions, repeat steps, wait, ask a person and tell people what happened. This page describes those steps. What starts an automation, and the limits that apply, are on Automation triggers and limits.

Each step reads values with templates such as {{trigger.caller}}, {{vars.total}} or {{nodes.ask.answer}}. Values keep their type (a number stays a number, a list stays a list) when a template is just one value.

Decisions​

StepWhat it doesExits
ConditionThe first rule that holds wins. Besides the classic tests (variable, caller, dialled number, time of day), a rule can test a value with equals, not equals, contains, starts with, greater than, less than, between, empty or in (one of the items of a list). Numbers compare as numbers, dates as dates, phone numbers in international format, text ignoring case for "contains" and "starts with". There are no regular expressions.One per rule, then else
SwitchCompares one value with up to 32 cases (each lists up to 16 values), optionally ignoring case.One per case, then default

Both also work in call flows, where they decide instantly while the caller waits.

Working with values: Transform​

A Transform step applies up to 16 operations in order; each writes a variable that the next ones can read:

  • pick a field of an object or list (order.lines), rename a field;
  • join a list into text, split text into a list;
  • trim, lower case, upper case;
  • phone to international format (a national number gets the company's country code);
  • date add (15m, 2h, 3d, -1d), date format (%Y-%m-%d %H:%M, in the company's time zone), number format (0.00, #,##0);
  • first, last and count of a list;
  • default: the value, or a fallback when it is empty.

Transform also works in call flows; there, results keep the call flow character set.

Repeating: For each​

For each runs a path once per item of a list (at most 100 items; a longer list is cut and the step says so). The current item is in the variable you name, its position (0, 1, ...) optionally in another. The path ends with a Next item step that names the loop; after the last item the done exit is taken. An empty list goes to done at once. For each is available in automations only.

Waiting​

StepWhat it doesExits
WaitPauses for a number of seconds (up to 30 days) or until a date and time taken from the data (for example an appointment time). A time in the past goes on at once.next, and on error when the time cannot be read or is more than 30 days ahead
Wait for eventPauses until a matching event arrives: an SMS, a chat or inbox message, a voicemail, a missed or ended call, a form, a CRM event or the end of a call assistant session. You match on up to 8 fields of the event, for example "an SMS from the caller's number". The fields of the event that arrived are then available to the next steps.received, or timeout (60 seconds to 30 days)

A waiting automation uses no resources while it waits. If you roll back a flow, runs that already wait finish on the version they started with.

Starting another automation: Call flow​

Call flow starts another automation of the company whose trigger is Run now, passing it inputs. With wait on, the step waits for it to finish (up to the timeout you choose) and its variables become available, for example {{nodes.lookup.vars.customer_id}}; if it fails or is cancelled, the on error exit is taken. This lets you keep shared logic in one place.

Chains are limited: an automation started this way can start another one, at most 4 levels deep, and a chain may never come back to an automation that is already on it. Publishing refuses a flow that would break either rule.

Asking a person: Approval​

An Approval step asks one person, everyone with a role, or the flow's owner (the user of a personal automation, otherwise the people who may edit flows) a question with up to three answers, such as Approve and Reject, and optionally a comment box. The automation waits for the first answer of anyone asked, or for the timeout (1 minute to 30 days).

The people asked get:

  • a notification on the MonoPhone app and in their browser (it tells them there is something to answer; the question itself is shown in the app and the console, never in the notification);
  • the question in Notifications in the web console and in the app, with the answers as buttons;
  • optionally an e-mail with the question, the answers and a link to it (the link uses your company's preferred web address when one is set up).

Each answer takes its own exit; on timeout is taken when nobody answered. The answer, the comment and who answered are available to the next steps ({{nodes.ask.answer}}, {{nodes.ask.comment}}). Answers are recorded in the audit log with the answer and where it was given (app, web, e-mail link), not the comment. Later answers are refused politely: the question shows who already answered.

If nobody can be asked (the user is not active, nobody has the role), the on error exit is taken, or the run ends as failed.

Telling people: Notify​

A Notify step sends a short notification (a title and an optional text) to one person, everyone with a role, or the flow's owner. They see it on their phone and browser and in Notifications. It also works in call flows, for example "VIP call from {{trigger.caller}}": the caller is never held up by it, and if it cannot be sent the call goes on.

For users​

People find what automations told or asked them under Notifications in the web console and in the MonoPhone app settings. See Notifications from automations.