Automations

Actions

Build automated workflows and business logic.

Actions define what happens when an automation triggers and conditions pass. Kantos supports six action types that can be chained together in sequence.

Send Email

Send an email using a template with dynamic variables:

{
  "type": "send_email",
  "config": {
    "template_id": "tmpl_welcome_email",
    "to": "{{record.email}}",
    "variables": {
      "name": "{{record.name}}",
      "company": "{{record.company}}"
    }
  }
}

Update Record

Update fields on the triggering record:

{
  "type": "update_record",
  "config": {
    "fields": {
      "status": "contacted",
      "last_contacted_at": "{{now}}",
      "follow_up_count": "{{record.follow_up_count + 1}}"
    }
  }
}

Create Record

Create a new record in the same or different object:

{
  "type": "create_record",
  "config": {
    "object_definition_id": "obj_def_tasks",
    "data": {
      "title": "Follow up with {{record.name}}",
      "due_date": "{{date_add(now, 3, 'days')}}",
      "related_record_id": "{{record.id}}"
    }
  }
}

Send Webhook

Send data to an external URL:

{
  "type": "webhook",
  "config": {
    "url": "https://api.example.com/webhook",
    "method": "POST",
    "headers": {
      "Authorization": "Bearer {{secrets.api_key}}",
      "Content-Type": "application/json"
    },
    "body": {
      "event": "new_lead",
      "lead_id": "{{record.id}}",
      "email": "{{record.email}}"
    }
  }
}

See Webhooks for detailed configuration, retry policies, and debugging tips.

Wait / Delay

Pause before executing the next action:

{
  "type": "wait",
  "config": {
    "duration": 24,
    "unit": "hours"
  }
}

Conditional Branch

Execute different actions based on conditions:

{
  "type": "branch",
  "config": {
    "conditions": [
      {
        "if": {"field": "deal_value", "operator": "greater_than", "value": 10000},
        "then": [{"type": "send_email", "template": "high_value_alert"}]
      },
      {
        "else": [{"type": "send_email", "template": "standard_notification"}]
      }
    ]
  }
}

Variables & Templates

Use double curly braces to insert dynamic values in any action configuration:

Record Fields

{{record.field_name}}     - Access any field on the record
{{record.id}}             - The record's unique ID
{{record.created_at}}     - When the record was created
{{record.updated_at}}     - When the record was last updated

Date Functions

{{now}}                           - Current timestamp
{{date_add(now, 7, 'days')}}      - 7 days from now
{{date_format(record.date, 'MMM D, YYYY')}}  - Formatted date

Text Functions

{{upper(record.name)}}            - UPPERCASE
{{lower(record.email)}}           - lowercase
{{trim(record.notes)}}            - Remove whitespace
{{truncate(record.message, 100)}} - First 100 characters

Automation Examples

Welcome Email Sequence

{
  "name": "New Lead Welcome Sequence",
  "trigger": {
    "event": "record.created",
    "object": "obj_def_leads"
  },
  "actions": [
    { "type": "send_email", "template": "welcome_email" },
    { "type": "wait", "duration": 2, "unit": "days" },
    { "type": "send_email", "template": "follow_up_email_1" },
    { "type": "wait", "duration": 3, "unit": "days" },
    {
      "type": "branch",
      "conditions": [{
        "if": {"field": "status", "operator": "equals", "value": "new"},
        "then": [{"type": "send_email", "template": "follow_up_email_2"}]
      }]
    }
  ]
}

Lead Scoring

{
  "name": "Update Lead Score",
  "trigger": {
    "event": "record.updated",
    "object": "obj_def_leads"
  },
  "actions": [{
    "type": "update_record",
    "fields": {
      "lead_score": "{{
        (record.has_company ? 20 : 0) +
        (record.has_phone ? 15 : 0) +
        (record.page_visits > 5 ? 25 : 0) +
        (record.email_opened ? 20 : 0) +
        (record.link_clicked ? 20 : 0)
      }}"
    }
  }]
}

Next Steps

    Actions - Automations | Kantos Docs