Workflows API
The Workflow object
A workflow watches one record type and runs its actions when a trigger fires and every condition matches. It is the same object you build under Automations in the app.
| Field | Type | Notes |
|---|---|---|
id | string | Read-only |
name | string | Up to 80 characters |
entity | string | LEAD, CONTACT, DEAL, EMAIL (inbound mail) or TASK. Fixed after creation |
trigger | string | See the table below. Fixed after creation |
active | boolean | Paused workflows never run |
conditions | array | Filters on the record. All must match |
triggerConfig | object or null | Settings for STALLED and TIME_IN_STAGE |
actions | array | What to do, in order |
runCount | integer | How many records the workflow has run on |
createdAt, updatedAt | string (ISO 8601) | Read-only |
Triggers
| Trigger | Record types | Fires when |
|---|---|---|
CREATED | All | A record is created, or for EMAIL an inbound message arrives. The only trigger for EMAIL and TASK |
STATUS_CHANGED | LEAD | The lead's status changes |
STAGE_CHANGED | DEAL | The deal moves to another stage |
REPLY_RECEIVED | CONTACT | The contact replies |
STALLED | DEAL | An open deal has had no activity for triggerConfig.idleDays days (default 10) |
TIME_IN_STAGE | DEAL | A deal has sat in triggerConfig.stage (any open stage if omitted) for triggerConfig.days days (default 7) |
Conditions
Each condition is { "field", "op", "value" }. value is always a string and comparisons ignore case.
op | Matches when |
|---|---|
eq | The field equals value |
neq | The field does not equal value |
contains | The field contains value |
olderThanDays | The date in the field is more than value days ago |
Actions
type | Fields | Notes |
|---|---|---|
CREATE_TASK | title, dueInDays, priority (LOW/MEDIUM/HIGH), assignToOwner | Linked to the record |
ADD_TAG | tag (a name) or tagId | A new name creates the tag. Stored by name. Not for tasks |
ASSIGN_ROUND_ROBIN | none | Skipped when the record already has an owner. Not for tasks |
SET_FIELD | field: "status", value | Leads: NEW, WORKING, QUALIFIED, UNQUALIFIED, CONVERTED. Contacts: NEW, ACTIVE, CUSTOMER, DORMANT. Inbound email: OPEN, CLOSED. Deals and tasks have no status |
SEND_EMAIL | templateSubject, templateBody, mode (DRAFT default, or SEND) | DRAFT puts the email in the approval queue. Suppressed addresses are never emailed |
NOTIFY | target, title, body | target is "owner", a user ID, or an email address |
ENROLL_IN_SEQUENCE | sequenceId | The sequence must be active |
Templates can use {{name}}, {{email}}, {{company}}, {{title}} and {{when}}.
Example object
{
"id": "cmq5wflo0alk34567890",
"name": "Chase stuck proposals",
"entity": "DEAL",
"trigger": "TIME_IN_STAGE",
"active": true,
"conditions": [{ "field": "value", "op": "neq", "value": "0" }],
"triggerConfig": { "stage": "PROPOSAL", "days": 14 },
"actions": [
{ "type": "NOTIFY", "target": "owner", "title": "{{title}} has been in Proposal for two weeks" },
{ "type": "CREATE_TASK", "title": "Follow up on proposal", "dueInDays": 1, "assignToOwner": true }
],
"runCount": 12,
"createdAt": "2026-09-01T15:04:00.000Z",
"updatedAt": "2026-09-20T09:12:00.000Z"
}