Recipe Triggers

Each recipe has one or more triggers in order for it have the recipe’s set of Conditions checked. A trigger can be an incoming or received object or interaction such as an SMS. It can also be a unit of time, such as the local time ticking through to 9am.

Allowing a recipe to have multiple triggers increases the power that a small number of recipes has.

Each recipe must have at least one trigger. A recipe that is triggered by another recipe cannot have any additional triggers.


TEXT_MESSAGE


        {
            "type": "TEXT_MESSAGE"
        }

Description An SMS trigger. A recipe that has this trigger will have its conditions assessed when any SMS is received.

Links

Parameters None.

MISSED_CALL


        {
            "type": "MISSED_CALL"
        },

Description An Missed Call (or Flash Call) trigger. A recipe that has this trigger will have its conditions assessed when any Missed Call is received.

Links

Parameters None

TIME


        {
            "type": "TIME",
            "data": {
                "nextTriggerTime": 1407358800000
            }
        },
        {
            "type": "TIME",
            "data": {
                "scheduleType": "WEEKLY",
                "repeatFrequency": 1,
                "dayOfWeek": "MONDAY",
                "hourOfDay": 9,
                "minuteOfHour": 0
            }
        }

Description There are two types of Time trigger and both handle the case where a recipe’s conditions should be assessed at a certain point in time.

  1. Absolute time trigger

Simply takes a one-off time-date value that then triggers the recipe when that time is reached. Very useful for scheduling the sending of delayed SMS or reporting on the state of an object on a fixed point in time.

  1. Recurring time trigger

Used for recipes that should have their conditions assessed repeatedly at certain time intervals. Set the day(s), repetition interval and time, and the system will assess the recipe’s conditions at each repeating time interval.

Links

Parameters Each of the two Time trigger types takes a separate data structure.

  1. Absolute time trigger:
  1. Recurring time trigger:

 

RECIPE


    "actions": [
        {
            "type": "TriggerRecipeAction",
            "data": {
                "recipeToTriggerId": 1000,
                "delayTimeUnit": "HOURS",
                "delayLength": 5
            }
        }
    ]

...

    "triggers": [
        {
            "type": "RECIPE",
            "data": {
                "callingRecipeIds": [
                    888,
                    123
                ]
            }
        }
    ]

Description A recipe can have another recipe as its trigger, in the same way that any recipe can have an action that triggers a recipe.

If a recipe has a recipe as one of its triggers, it can only then have other recipes as additional triggers and not any other trigger type. This is in order to handle how trigger payloads are passed and referenced within recipes.

The example above shows a recipe (id = 1000) which is triggered by two recipes (shown only by their IDs 888 and 123), and one of the calling recipes referencing recipe 1000 as one of its actions.

‘Chaining recipes’ in this way relies entirely on the IDs of all of the recipes being accurate and set correctly in Actions and Triggers.

Links

Parameters Only one array (list) of Recipe IDs is required and stored:

 

FIRE

Description A fire trigger is one that is invoked by the user clicking on a button in the User Interface. This can prove very useful when testing automations or can even be included in some workflows that require someone to initiate the action(s) after responding to input that cannot be easily captured by our system…

When creating a fire triggered recipe, you can also select one or more user data entries that you can then later provide values for when executing the fire trigger.

Accessing of the user data specified when executing a fire trigger can be done as illustrated below.


    ${trigger.fire["userDataKey"]}

Where userDataKey is the key of the user data entry whose value was specified when executing the fire trigger.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.