Reecall

Processes

A Process is a stored sequence of steps. Its steps call APIs, generate structured data with an LLM, send SMS and email, branch on conditions, and loop over lists. A Trigger or an API call starts it, and each start creates a Run.

Create a Process

Create a Process through the Data API at /automation/processes. This Process posts the title and duration of a completed conversation to your endpoint:

TerminalCreate a Process
curl https://data.reecall.io/automation/processes \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer sk_YOUR_API_KEY' \ --data '{ "name": "Post call summary", "description": "Send the title and duration of each completed call to the CRM", "steps": [ { "type": "request", "output": "crm", "config": { "url": "https://crm.example.com/calls", "method": "POST", "headers": { "Authorization": "Bearer {{ variables.CRM_TOKEN }}" }, "data": { "exchangeId": "{{ event.refId }}", "title": "{{ event.data.title }}", "duration": "{{ event.data.duration }}" } } } ] }'

The response is the stored Process with its id. Link it to a System event with a Trigger, or start it with POST /v2/execute/{id}.

Fields

FieldTypeRequiredDefaultDescription
namestringNoName shown in lists
descriptionstringNoWhat the Process does
stepsarrayYesThe steps to run, in order. See Steps.
defaultContextobject or nullNonullValues the Process reads under input when its caller leaves them out. Anyone who can read the Process can read them, so keep secrets in Variables.
projectIdstring (UUID) or nullDepends on the keyThe Project of the Process, or null for an organization-level Process
organizationIdstring (UUID)Set from the keyCannot change after creation

A project-scoped API key creates Processes in its Project. An organization-scoped key creates a project Process when you set projectId, and an organization-level Process when you leave it out. An organization-level Process can be started by the Triggers of every Project in the Organization.

Steps

Each step has a type that selects its action and a config object for its settings. Steps run in order, and a failed step fails the Run.

FieldTypeRequiredDescription
typestringYesThe step type, from the table below
configobjectYesSettings of the step type. Most fields accept templates.
outputstringNoName under which later steps read the step's result. See Context.
timeoutnumberNoStep timeout in milliseconds. Defaults to 30000, at most 300000 (5 minutes).
StepUse it to
RequestCall an HTTP API
AgentGenerate structured data with an LLM
SMS and EmailSend messages through the configured providers
RuleRun the first branch whose conditions match
BatchRun independent steps in parallel
MapRun a sequence for each item in an array
RespondEnd the Run and store a status, body, and headers as its result

What a Process reads

Templates and conditions read the Run's context. It starts with four values, and each step with an output adds its result:

NameHolds
eventThe System event that started the Run: id, type, occurredAt, refId, and data. Absent when an API call started the Run. See System events.
inputThe Process's defaultContext, overridden by the Trigger's input or by the context of the API call
variablesThe Variables of the Run's Organization and Project
runThe Run: id, attempt (starting at 1), triggerId, and processId

For example, with defaultContext set to { "lang": "fr", "limit": 10 } and a Trigger input of { "lang": "en" }, the Process reads input.lang as "en" and input.limit as 10.

event, input, variables, and run are reserved: a step whose output uses one of these names fails with STEP_INVALID. See Context for how step results add to the context.

Variables

A Run reads the Variables of its Organization and of its Project under variables. When both define the same key, the Project's value wins.

JSONA request step reading a secret Variable
{ "type": "request", "config": { "url": "https://crm.example.com/calls", "method": "POST", "headers": { "Authorization": "Bearer {{ variables.CRM_TOKEN }}" }, "data": { "exchangeId": "{{ event.refId }}" } } }
  • Each attempt reads the current values, so a retry uses a Variable you changed after the first attempt.
  • SMS and email steps do not receive secret Variables. Use them in request and agent steps.
  • Rule conditions read Variables with a source such as variables.REGION.

Change or delete a Process

Each attempt of a Run reads the Process's current steps. A change applies to Runs still in the queue and to retries. Deleting a Process fails its queued Runs with PROCESS_DELETED.

Last modified on