Automations
Run steps when something happens in the CRM, on a schedule, or when your system calls a webhook.
An automation is a trigger, optional conditions on the record, and steps that run capabilities. People build them in the app's automation builder; the same automations can be read, made and run over the API.
Triggers
record_created,record_updated: a record of the automation'sobjectType(contact,company,deal,quoteorinvoice) is added or changed.criteria: a record starts to match the conditions.record_assigned: a record gets a new owner.event: an analytics event with the giveneventNamearrives.segment_entered,segment_exited: a record joins or leaves the saved segmentsegmentId.schedule: everyintervalMinutes.manual: only when someone runs it.webhook: when your system posts to its URL. See Webhooks.
Turning an automation on never replays the past; it acts on what happens from then on.
Steps
Each step runs one capability with an input:
{
"id": "task",
"type": "action",
"capabilityId": "task.create",
"input": {
"objectType": "deal",
"objectId": "{{record.id}}",
"title": "Call {{record.name}} within a day",
"priority": "high"
}
}- A step is
actionordelay(delayMinutes, up to 90 days).continueOnErrorkeeps going when a step fails;conditionskips it for records that do not match. - Steps can run
task.create,activity.log,tag.apply,contact.update,company.update,deal.create,deal.update,deal.update_stage,quote.update,email.send,sequence.enroll,notification.send,chat.notify,http.requestandagent.run. - The builder can also save branches:
nodes(action, delay, filter and branch) joined byedges. When there are nodes, they replacesteps.
Fill inputs from the trigger
Inputs take {{…}} fields:
{{record.*}}: the record that fired it, such as{{record.email}}.{{owner.*}}: the record's owner.{{trigger.*}}: the trigger's data. A webhook's JSON body is{{trigger.body.*}}.{{steps.<id>.output.*}}: what an earlier step returned.{{record.firstName|there}}: a fallback when the field is empty.
Make one
curl -s "$FLITO_URL/api/cap/workflow.create" \
-H "Authorization: Bearer $FLITO_API_KEY" -H "Content-Type: application/json" \
-d '{"input": {
"name": "New deal: call within a day",
"objectType": "deal",
"trigger": {"type": "record_created"},
"steps": [{
"id": "task", "type": "action", "capabilityId": "task.create",
"input": {"objectType": "deal", "objectId": "{{record.id}}", "title": "Call about {{record.name}}", "priority": "high"}
}]
}}'A new automation is paused. Before you switch it on, see what it would do:
workflow.previewdry-runs it over every record that matches now: how many match, and for each the steps that would run with their final inputs. It never writes.workflow.run_nowwith{"workflowId": "…", "recordId": "…", "dryRun": true}tries it on one record.
Then switch it on with workflow.activate, which needs "approved": true. Making or updating an automation with "enabled": true needs it too; pausing never does.
Runs and retries
workflow.runslists runs:running,waiting(on a delay),completedorfailed, with each step's result.- A failed step is retried 3 times on its own.
workflow.retry_runrestarts a failed run from the step that failed. - Triggers that are checked (record changes, criteria, segments, schedules) are looked at every 5 minutes. A schedule fires on the first check after its interval has passed. Webhooks and owner changes fire at once.
Capabilities
| Capability | What it does | Kind |
|---|---|---|
| workflow.activate | Activate automation | write, needs approval |
| workflow.create | Create automation | write, may need approval |
| workflow.default_alerts | Default alerts | read |
| workflow.delete | Delete automation | write, needs approval |
| workflow.get | Get automation | read |
| workflow.list | List automations | read |
| workflow.pause | Pause automation | write |
| workflow.preview | Dry-run automation | read |
| workflow.retry_run | Retry automation run | write |
| workflow.run_now | Run automation now | write |
| workflow.runs | Automation run history | read |
| workflow.set_default_alert | Switch a default alert | write, may need approval |
| workflow.update | Update automation | write, may need approval |
Was this page useful?