Triggers
A Trigger starts a Process each time a System event of its type occurs and its conditions pass. Each start creates a Run. Manage Triggers through the Data API at /automation/triggers.
Create a Trigger
Create the Process first, then link it to a System event type. This Trigger starts the Process when a conversation of one Assistant ends:
Create a Trigger
The response is the stored Trigger, with its id and enabled: true. The Trigger applies to System events that occur after you save it.
Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | No | Name shown in lists | |
description | string | No | What the Trigger does | |
eventType | string | Yes | The System event type to listen to | |
processId | string (UUID) | Yes | The Process to start. See Scope for the Processes a Trigger can reach. | |
conditions | object or null | No | null | Conditions the System event must pass. null starts the Process on every System event of the type. See Conditions. |
input | object or null | No | null | Fixed values the Process reads under input. See Input. |
retry | string or object | No | "none" | Retry policy of the Runs this Trigger starts. See Retry policy. |
enabled | boolean | No | true | false stops the Trigger from starting new Runs |
projectId | string (UUID) or null | Depends on the key | The Project of a project Trigger, or null for an organization Trigger. Cannot change after creation. | |
organizationId | string (UUID) | Set from the key | Cannot change after creation |
Scope
A Trigger belongs to one Project or to the whole Organization. The scope sets which System events it receives and which Processes it can start.
| Scope | projectId | Receives the System events of | Can start |
|---|---|---|---|
| Project | The Project's ID | Its Project | A Process of its Project, or an organization-level Process |
| Organization | null | Every Project of the Organization | An organization-level Process |
A project-scoped API key always creates project Triggers in its own Project. It can read the organization Triggers but not change them. An organization-scoped key creates a project Trigger when you set projectId, and an organization Trigger when you leave it out.
A Run belongs to the Project of the System event that started it, whatever the scope of its Trigger. A project-scoped key reads the Runs of an organization Trigger for its own Project only.
Conditions
Conditions use the syntax of a Rule step. Each condition reads a value from the System event with source, applies a filter, and compares the result with value when the filter needs one:
Conditions
operatorisAND(default) orOR.conditionsholds 1 to 20 conditions.sourceis a path inevent:id,type,occurredAt,refId,organizationId,projectId, and thedatafields of the System event type.filteris one of the Rule step filters, such asEQUALS,CONTAINS,GREATER_THAN,EXISTS, orIN.
Check filter names
Reecall does not check filter names when you save a Trigger. A Trigger with a misspelled filter never starts its Process.
Input
input holds fixed values, such as a webhook URL or a language, that the Process reads under input. Reecall passes them as they are, without rendering templates. They override the values of the same name in the Process's defaultContext. See Processes.
Do not put secrets in input. Store them as secret Variables and read them with {{ variables.KEY }}.
Retry policy
Retries are off by default. When a Run fails for a reason that is safe to repeat, such as a 429 or 503 answer, the policy decides whether it runs again:
| Value | Effect |
|---|---|
"none" | No retry |
{ "immediate": 2 } | Up to 2 retries, right after the failure. From 1 to 3. |
{ "delays": ["5m", "1h"] } | One retry per delay, after waiting that long. 1 to 3 delays, each in minutes (m) or hours (h), from 1m to 24h. |
A retry runs the whole Process again
A retry starts again from the first step. Steps that succeeded before the failure run a second time, and SMS and email steps send their messages again. Turn retries on only for a Process whose steps can safely run twice.
See Retries for the failures that start a retry and the Idempotency-Key header of request steps.
Turn a Trigger off
Set enabled to false to stop new Runs and keep the Trigger:
Turn a Trigger off
Runs already started continue. To stop one, cancel it.
Avoid loops
A Process that writes to the Reecall API can cause new System events. Check that it cannot start its own Trigger again, or add a condition that excludes the records it writes. A Run started by run.failed never announces another run.failed.
Errors
| Code | Status | Cause |
|---|---|---|
INVALID_TRIGGER | 400 | eventType is missing |
INVALID_EVENT_TYPE | 400 | eventType is not a System event type. The error lists the allowed types. |
INVALID_TRIGGER_CONDITIONS | 400 | conditions has an unknown key, no condition, more than 20, or a condition without source or filter |
INVALID_RETRY_POLICY | 400 | retry is not one of the forms above |
PROCESS_OUT_OF_REACH | 400 | The Process belongs to another Organization or Project, or a Project Process is linked to an organization Trigger |
NOT_FOUND | 404 | No Process with this ID in reach of the key |
READ_ONLY_FIELD | 400 | The update changes organizationId or projectId |
SCOPE_VIOLATION | 403 | A project-scoped key tries to change an organization Trigger |