System events
Reecall announces a System event when something happens on the platform, such as the end of a conversation. A Trigger listens to one System event type and starts its Process each time one occurs.
| Type | Announced when | refId points to |
|---|---|---|
exchange.started | A conversation starts | The Exchange |
exchange.completed | A conversation ends and its Exchange is complete | The Exchange |
run.failed | A Run fails | The Run |
System events are not the Exchange events of a conversation's timeline. See Exchange events for those.
What a Process reads
A Run started by a Trigger reads the System event under event:
| Field | Type | Description |
|---|---|---|
id | string (UUID) | Identifies the System event. A type and a record always give the same ID. |
type | string | The System event type, such as exchange.completed |
occurredAt | string | ISO 8601 date and time of the change that caused the System event |
refId | string (UUID) | ID of the record the System event comes from |
data | object | Fields of the record, listed below for each type. Each field can be null. |
For example, {{ event.refId }} is the Exchange ID in a Process started by exchange.completed, and {{ event.data.duration }} is the conversation's duration. See Templating language.
Trigger conditions read the same fields, plus event.organizationId and event.projectId.
Each Trigger starts at most one Run for a System event. If Reecall delivers the same System event again, its Trigger starts nothing new.
exchange.started
Announced when Reecall registers an Exchange at the start of a conversation, with status: "inProgress". refId is the Exchange ID.
data field | Type | Description |
|---|---|---|
status | string | Status of the Exchange: "inProgress" |
type | string | Conversation type, such as "voice" |
assistantId | string (UUID) | The Assistant holding the conversation |
roomId | string | Identifier of the conversation's room |
externalId | string | The external ID supplied for the conversation |
exchange.completed
Announced once per Exchange, when it reaches status: "completed". This covers both the normal case, where Reecall updates the Exchange at the end of the conversation, and the fallback, where the start registration failed and Reecall creates the completed Exchange at the end. Later updates of a completed Exchange announce nothing.
refId is the Exchange ID. data has the fields of exchange.started, plus:
data field | Type | Description |
|---|---|---|
title | string | Short description of the conversation |
duration | number | Conversation duration in seconds |
audioUrl | string | URL of the recording, when one is available |
messages | array | The transcript. See Messages. |
events | array | The Exchange events of the conversation. See Exchange events. |
resources | array | Configuration metadata and media references. See Resources. |
data | object | Data extracted from the conversation. See Data Extraction. |
The Exchange ID is not in data. Use event.refId.
event in a Process started by exchange.completed
run.failed
Announced when a Run ends with status: "failed", whether a Trigger or an API call started it. refId is the ID of the failed Run.
data field | Type | Description |
|---|---|---|
triggerId | string (UUID) | The Trigger that started the failed Run, or null for a Run started through the API |
processId | string (UUID) | The Process of the failed Run. Absent when the Run ran steps sent with the API call. |
errorCode | string | Why the Run failed, as a code. See Why a Run failed. |
errorMessage | string | Why the Run failed, in a sentence that never holds the Run's data, such as Request failed with status code 503 (Service Unavailable) |
failedStep | string | Position of the step that failed, such as "2", or null when no step failed, as when the attempt timed out |
A Run started by run.failed that fails announces no run.failed, so an alert Process cannot start itself in a loop. See Email an alert when a Run fails.
List the types through the API
List System event types
Response
ref names the kind of record refId points to.