Trigger
A Trigger is what starts a Workflow: an Event, a schedule, or a Thing entering a state.
Properties
| Property | Type | Required | Description |
|---|---|---|---|
event | string | The Event selector it matches, such as Order.placed. | |
schedule | string | A cadence or cron expression. | |
state | string | The state whose entry fires it. | |
where | string | The predicate an event Trigger matches, such as choice = 'raise'. | |
threshold | json | A Metric staying below or above a value, optionally for a while, such as four weeks. | |
at | string | When in its cadence a schedule runs, on the namespace’s clock, such as mon 09:. |
Object
{
"$id": "https: //api.sb/ tutorloop.com/ triggers/ trigger_1",
"$type": "Trigger",
"event": "Example event",
"schedule": "Example schedule",
"state": "Example state",
"where": "Example where",
"threshold": {},
"at": "Example at"
}Relationships
- A Trigger fires on many Events: a Trigger fires each time an Event matching its selector happens.
firesOn, inversefires. - A Trigger starts many Workflows: when a Trigger fires, each Workflow it starts runs as a new Action.
starts, inversestartedBy.
Verbs
createCreates a Trigger.POST /{namespace}/triggersgetReturns one Trigger by id.GET /{namespace}/triggers/{id}listReturns Triggers, newest first, one page at a time.GET /{namespace}/triggersupdateChanges the given properties of a Trigger.PATCH /{namespace}/triggers/{id}deleteDeletes a Trigger; its history is kept.DELETE /{namespace}/triggers/{id}
Permissions
Which Access level may call each Verb. One-way Verbs wait their delay window.
| Operation | owner | admin | member | viewer |
|---|---|---|---|---|
Trigger.create | Yes | Yes | Yes | No |
Trigger.get | Yes | Yes | Yes | Yes |
Trigger.list | Yes | Yes | Yes | Yes |
Trigger.update | Yes | Yes | Yes | No |
Trigger.delete | Yes | Yes | Yes | No |
Call it
Add a trigger to QuietCopy.Example
The Event Lead.created is the Trigger of Answer inbound. The schedule 0 9 * * 1 is the Trigger of the Monday Role review.