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:
Create a Process
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
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | No | Name shown in lists | |
description | string | No | What the Process does | |
steps | array | Yes | The steps to run, in order. See Steps. | |
defaultContext | object or null | No | null | Values 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. |
projectId | string (UUID) or null | Depends on the key | The Project of the Process, or null for an organization-level Process | |
organizationId | string (UUID) | Set from the key | Cannot 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.
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | The step type, from the table below |
config | object | Yes | Settings of the step type. Most fields accept templates. |
output | string | No | Name under which later steps read the step's result. See Context. |
timeout | number | No | Step timeout in milliseconds. Defaults to 30000, at most 300000 (5 minutes). |
| Step | Use it to |
|---|---|
| Request | Call an HTTP API |
| Agent | Generate structured data with an LLM |
| SMS and Email | Send messages through the configured providers |
| Rule | Run the first branch whose conditions match |
| Batch | Run independent steps in parallel |
| Map | Run a sequence for each item in an array |
| Respond | End 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:
| Name | Holds |
|---|---|
event | The System event that started the Run: id, type, occurredAt, refId, and data. Absent when an API call started the Run. See System events. |
input | The Process's defaultContext, overridden by the Trigger's input or by the context of the API call |
variables | The Variables of the Run's Organization and Project |
run | The 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.
A request step reading a secret Variable
- 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
sourcesuch asvariables.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.