> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ouraicalling.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Automations

> Native workspace workflows — triggers, actions, run history, and assistant webhook binding.

The **Automations** page (`/automations`) is the native workflow builder for your workspace. Build multi-step graphs with triggers, actions, test runs, and a full run history.

Plan gate: `automation_platform`. Monthly **free** run allowance: `max_automation_runs` (`-1` = unlimited free, `0` = no free runs). After the free quota is exhausted, each additional run debits `automation_run_credits` (platform base in `credit_settings`, tenant sell price via `tenants.credit_pricing`).

**AI steps** (Custom Prompt, Extract Fields, MCP · Call tool) additionally debit workspace credits for token usage: list price × **2.5** (token cost + **150%** margin). Charged credits appear on the run (`credits_charged`) and in step output / Test panel.

**Graph end:** A leaf with no outgoing edge completes the run successfully. Explicit terminals (`stop`, `variables.return`, `webhook.respond`) set `halt` and end immediately — no further connection is required (canvas hides the source handle).

## Triggers

* **On Call Completed** — after a voice call ends (with analysis). Requires a **specific assistant**.
* **On Inbound Call** — when an inbound call starts.
* **Inject input variables** (`call.variables`) — at call start, replaces the assistant variable webhook. End with **Return variables**.
* **Email received** — inbound email via SendGrid.
* **Conversation started / ended** — messaging channel open / closed.
* **Incoming Webhook** — `POST /api/automations/{id}/webhook`.
* **Booking created / cancelled / rescheduled**, **Manual**, **Schedule** (soon).
* **App events (Beta)** — each connected app (Gmail, GitHub, …) appears as its own platform with schema-driven triggers. Requires workspace **Beta Features**. Activating creates the trigger instance.

## Actions (plugins)

Organized as **Platform → type → action** (Famulor, AI, Time, WhatsApp, Telegram, X, HTTP, Slack, …).

* **AI:** Extract Fields, Custom Prompt
* **Time:** Delay For / Until, Get Current Date and Time, Convert Timezone, Format
* **Logic:** Condition, Filter, Switch, Random, Stop, Note, Set variable, Run Code, **Loop on Items**
* **Contacts:** Create/Update, Get by phone, List, Add tags/attributes
* **Calls:** Call Phone Number
* **Messaging:** SMS, Email (workspace channel), **Send Email (SMTP)** via a saved SMTP connection, Channel message (WhatsApp / Telegram / X on open conversations)
* **Knowledge:** Add / Delete / Get source
* **HTTP / webhooks:** HTTP Request, Slack / Discord / Teams Incoming Webhooks, **Webhook respond** (sync HTTP status/body for inbound webhooks)
* **CRM / SMTP / MCP connections:** reusable credentials under Automations → Connections (Airtable, HubSpot, Salesforce, Close, SMTP, **Supabase / Neon / Brevo / Atlassian / Shopify Storefront MCP**, plus Notion/Stripe/GitHub/Linear/Slack MCP). Test Connection for SMTP verifies the relay and sends a test email to the admin. Official MCP presets that are **OAuth-only** in the vendor docs (e.g. ClickUp, Asana, PayPal login) are not listed yet — our connection model needs a Bearer/API key for headless automation runs.
* **Connected apps (Beta):** **Browse apps** in Connections to OAuth-connect toolkits (search + infinite scroll over the full catalog). In the builder, app platforms load as paginated metadata first; tools/triggers load per app when selected (runtime: `composio.execute` / `composio.event`). Requires the platform app-connector API key and Beta Features. Native CRM/SMS/MCP nodes are unchanged. Bulk catalog (`/api/automations/composio/catalog`) warms only the requested page (default 40, max 100) — prefer `toolkit=` or `/tools` + `/trigger-types` for lazy load.
* **Airtable actions:** List, **Find record**, **Search records**, **Find or create**, Get by id, Create / Create records (batch ≤10), Update, Delete. Find/Search map to List Records + `filterByFormula`.
* **MCP:** Call tool — connection + tool multi-select (or all) + agent prompt with flash variables; the agent picks the tool and fills arguments
* **Variables:** Return variables (for `call.variables`)

## Organization

Automations support free-form **tags** (filter on the list page) and show the bound **assistant** when the trigger uses `assistant_id`. Create/update via UI, REST (`tags` on `/api/v1/automations`), or MCP (`create_automation` / `update_automation`).

## Runs & failure alerts

The list page has **Automations** and **Runs** tabs. Use **Alert settings** to set a workspace inbox for failed runs (`tenants.automation_alert_email`) and toggle alerts on/off (`automation_failure_alerts_enabled`).

When no custom email is set, failed runs email:

* **Whitelabel customer workspaces** → tenant-admin `support_email` (plus workspace owners/admins)
* **Platform root workspaces** → platform admin contact/SMTP email from `/admin/settings` (`welcome_email.contact_email`, else `smtp_settings.from_email`) plus workspace owners/admins

Toggle per automation: `notify_on_failure` (default on).

## Assistant webhook binding

In the assistant Webhook card, choose **Automation** delivery and pick a `call.completed` automation, or keep a custom HTTPS URL.
