Flito docs

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's objectType (contact, company, deal, quote or invoice) 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 given eventName arrives.
  • segment_entered, segment_exited: a record joins or leaves the saved segment segmentId.
  • schedule: every intervalMinutes.
  • 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 action or delay (delayMinutes, up to 90 days). continueOnError keeps going when a step fails; condition skips 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.request and agent.run.
  • The builder can also save branches: nodes (action, delay, filter and branch) joined by edges. When there are nodes, they replace steps.

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.preview dry-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_now with {"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.runs lists runs: running, waiting (on a delay), completed or failed, with each step's result.
  • A failed step is retried 3 times on its own. workflow.retry_run restarts 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

CapabilityWhat it doesKind
workflow.activateActivate automationwrite, needs approval
workflow.createCreate automationwrite, may need approval
workflow.default_alertsDefault alertsread
workflow.deleteDelete automationwrite, needs approval
workflow.getGet automationread
workflow.listList automationsread
workflow.pausePause automationwrite
workflow.previewDry-run automationread
workflow.retry_runRetry automation runwrite
workflow.run_nowRun automation nowwrite
workflow.runsAutomation run historyread
workflow.set_default_alertSwitch a default alertwrite, may need approval
workflow.updateUpdate automationwrite, may need approval

Was this page useful?

On this page