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

# After-call Settings

> Extract data from the call and send it to an app/webhook for automation workflows.

Configure what happens after calls end - extract specific information from conversations and send it to external systems for further processing.

## Overview

Post-call actions automatically:

* Extract structured data from conversations using AI
* Send extracted variables to webhooks for automation
* Trigger workflows in connected platforms
* Update CRM records and databases
* Enable complex automation scenarios

## Post-call Variables

> [!NOTE]
>
> Where to find it: **Variables → Out of the call**.

Define the variables that the AI will extract from the call and send to a webhook.

### Variable Configuration

Configure which information the AI should extract from each conversation:

> [accordion] Variable Definition
>
> Create variables that the AI will identify and extract from conversations.
>
> **How extraction works:**
> The AI analyzes the complete call transcript and considers your system prompt context to extract the requested variables. It understands what was discussed during the call and extracts relevant information based on your variable descriptions.
>
> **Configuration:**
>
> * **Name:** Variable identifier (3-16 characters, lowercase, alphanumeric)
> * **Type:** Data type for the extracted value
> * **Description:** Clear explanation so AI understands what to extract from the conversation
>
> **Variable Types:**
>
> * **String:** Text values (names, addresses, comments)
> * **Number:** Numeric values (quantities, prices, scores)
> * **True/False:** Boolean values (yes/no answers, objectives achieved)
> * **Tags:** One or more values from a list you define (for example `hot`, `warm`, `cold`)
> * **Object:** A set of named fields (string, number, or true/false) extracted as one record
> * **List:** Several of those objects (for example every appointment mentioned)
> * **JSON:** Free-form structured data when the shape is not known in advance

> [accordion] Default Variables
>
> Every assistant includes these essential variables by default:
>
> **Status (True/False):** Whether the call objective was achieved or not
>
> **Summary (String):** Call summary in a few words
>
> You can add custom variables based on your specific use case.

> [accordion] Variable Examples
>
> Common variables for different scenarios:
>
> **Sales qualification:**
>
> * `budget` (Number): Customer's budget range
> * `decision_maker` (True/False): Is caller the decision maker
> * `timeline` (String): When they need the solution
> * `pain_points` (String): Main challenges mentioned
>
> **Appointment booking:**
>
> * `appointment_date` (String): Preferred appointment date
> * `service_type` (String): Type of service requested
> * `contact_method` (String): Preferred contact method
>
> **Support calls:**
>
> * `issue_type` (String): Category of the problem
> * `urgency_level` (Number): Priority score (1-10)
> * `resolution_status` (True/False): Was issue resolved

### Extraction Process

> [accordion] How AI Extracts Variables
>
> The AI uses sophisticated analysis to extract variables from your calls:
>
> **Data sources:**
>
> * **Complete call transcript:** Everything said by both the AI and the customer
> * **System prompt context:** Your assistant's objectives and instructions help guide extraction
> * **Variable descriptions:** Clear descriptions you provide for each variable
>
> **Analysis method:**
>
> 1. AI reviews the entire conversation transcript
> 2. Considers the system prompt and call objectives
> 3. Identifies relevant information based on variable descriptions
> 4. Extracts and formats data according to specified types
> 5. Validates extracted values before sending to webhook

### Best Practices

> [!WARNING]
>
> **Variable naming:** Use lowercase, alphanumeric characters only. No spaces or special characters except underscores.

> [!TIP]
>
> **Clear descriptions:** Write descriptions that clearly explain what the AI should look for in the conversation transcript. The more specific and context-aware, the better the extraction accuracy.

> [!NOTE]
>
> **System prompt synergy:** Your variable descriptions work best when they align with your system prompt objectives. If your assistant is designed for lead qualification, your variables should reflect that purpose.

## Webhook Configuration

> [!NOTE]
>
> Where to find it: **Webhooks & channels**.

Make a request to a URL that sends the extracted variables to external systems.

### Webhook Settings

> [accordion] Webhook Status
>
> **Enabled/Disabled:** Control whether webhooks are sent after calls
>
> **Default:** Disabled - Enable only when you have a webhook endpoint ready to receive data

> [accordion] Webhook URL
>
> **URL endpoint:** Where to send the extracted data
>
> **Format:** Must be a valid URL
>
> **Example:** `https://automate.example.com/api/v1/webhooks/your-webhook-id`
>
> **Test functionality:** Built-in test feature sends sample data to verify connectivity

> [accordion] Delivery Options
>
> **Send webhook only on completed:**
>
> * **Yes (Default):** Only send data for completed calls
> * **No:** Send data for all calls regardless of completion status
>
> **Include recording in webhook:**
>
> * **Yes (Default):** Include recording URL in the webhook payload
> * **No:** Send only extracted variables without recording link

### Webhook Payload

The webhook will receive a comprehensive JSON payload containing call details, extracted variables, and transcript. For complete API documentation, see [Post-Call Webhook API](https://docs.comix-flow.com/api-reference/webhooks/post-call-webhook.md).

**Key payload fields:**

> [accordion] Call Information
>
> * **id:** Unique call identifier
> * **type:** Channel and direction of the call — `inbound`, `outbound`, `web`, `whatsapp_inbound`, or `whatsapp_outbound`
> * **assistant\_id:** UUID of the assistant that handled the call
> * **assistant\_name:** Name of the assistant, as shown in the dashboard
> * **customer\_phone:** Customer's phone number (E.164 format)
> * **assistant\_phone:** Assistant's phone number
> * **duration:** Call duration in seconds
> * **status:** Call status (initiated, ringing, busy, in-progress, ended, completed, ended\_by\_customer, ended\_by\_assistant, unanswered, failed)
> * **ended\_by:** Who hung up: `customer` (the caller), `assistant` (hang-up tool or voicemail), or `system` (max duration, silence, or a provider error). `null` on older calls
> * **created\_at/finished\_at:** ISO 8601 timestamps

> [accordion] Extracted Variables
>
> * **extracted\_variables:** AI-extracted data based on your post-call schema configuration (see [Post-call Variables](#post-call-variables) section above)
> * **input\_variables:** Variables passed before the call (see [Call Variables](https://docs.comix-flow.com/ai-assistants/settings/prompt-and-tools.md#call-variables))
> * Includes default variables (status, summary) plus your custom variables

> [accordion] Conversation Data
>
> * **transcript:** Detailed conversation transcript with timestamps
> * **formatted\_transcript:** Human-readable conversation format
> * **recording\_url:** Call recording URL (if enabled)

> [accordion] Campaign & Lead Data
>
> * **lead:** Lead information (for campaign calls)
> * **campaign:** Campaign details and settings
> * Only included for calls that are part of campaigns

**Example webhook payload:**

```json theme={null} theme={null}
{
  "id": 12345,
  "type": "outbound",
  "assistant_id": "9c1f8e2a-4d3b-4a17-9f6e-2b5c8d0a7e31",
  "assistant_name": "Sales Agent",
  "customer_phone": "+1234567890",
  "assistant_phone": "+1987654321",
  "duration": 125,
  "status": "completed",
  "ended_by": "customer",
  "extracted_variables": {
    "status": true,
    "summary": "Customer interested in product demo",
    "lead_quality": "high",
    "budget": 5000
  },
  "input_variables": {
    "customer_name": "John Doe",
    "product_interest": "Pro Plan"
  },
  "transcript": [
    {
      "text": "Hello! This is Sarah from ComixFlow.",
      "type": "transcript",
      "sender": "bot",
      "timestamp": 1756812511.315143
    },
    {
      "text": "Hi, I'm doing well, thanks.",
      "type": "transcript", 
      "sender": "human",
      "timestamp": 1756812514.104436
    }
  ],
  "formatted_transcript": "AI: Hello! This is Sarah from ComixFlow.\\nCustomer: Hi, I'm doing well, thanks.",
  "recording_url": "https://ai.comix-flow.com/storage/recordings/call-12345.mp4",
  "created_at": "2025-01-15T10:30:00.000000Z",
  "finished_at": "2025-01-15T10:32:05.000000Z"
}
```

### Testing Webhooks

> [!TIP]
>
> **Test before going live:** Use the "Make test request" button to send sample data to your webhook endpoint and verify it's working correctly.

**Test process:**

1. Configure your variables and webhook URL
2. Click **Save assistant**
3. Click "Make test request"
4. Check your webhook endpoint receives the test data
5. Verify the payload structure matches your expectations

### Inbound Webhook URL

> [!NOTE]
>
> Where to find it: **Webhooks & channels** → **Inbound call webhook**.

Loads details about the caller into the call before the assistant starts talking. When an inbound or web call starts, the platform sends a POST to this URL, and the values your endpoint returns become call variables for that call.

* **Which calls:** inbound and web calls only. Outbound and WhatsApp calls don't use it.
* **Request:** `{"customer_phone": "+1234567890", "assistant_phone": "+1987654321"}`. On web calls both values are empty.
* **Response:** a flat JSON object with string values, for example `{"customer_name": "Anna", "plan": "Premium"}`. If any value is not a string, the whole response is ignored.
* **Define them on the assistant:** add the same variables to the assistant with default values. Any value the webhook doesn't return keeps its default, so the prompt always gets a value.
* **Using the values:** reference them as `{customer_name}` in the prompt and the first message, and as `{{customer_name}}` in mid-call tools. They also come back in the post-call webhook under `input_variables`, so post-call automations can use them.
* **Your own endpoint or an automation flow:** both work the same way. They receive the same request and return the same kind of response.
* **Waiting time:** on phone calls the platform waits up to 20 seconds, then the call goes ahead with the assistant's default variables. Every second delays the greeting, so answer as fast as you can.
* **Automation flows:** when the URL points to one of your automation flows with an **Inbound Call** trigger, the field shows the flow's card instead of the URL. Click the card to open the flow, or remove it to enter a different URL.
* **Format:** a valid URL, up to 2048 characters. Leave it empty to turn it off.

You can also set it through the API with [Enable assistant inbound webhook](https://docs.comix-flow.com/api-reference/assistants/enable-inbound-webhook.md). For a step-by-step flow, see [Inbound Call Context Injection](https://docs.comix-flow.com/automation-platform/tutorials/inbound-context-injection.md).

## Integration Examples

### Our Automation Platform

**Primary integration:** Use our built-in no-code automation platform for seamless workflows:

* **Direct webhook processing:** No external setup required
* **250+ app integrations:** Connect to CRM, email, calendars, and more
* **Visual workflow builder:** Create complex automation without code
* **Real-time data sync:** Instant processing of extracted variables
* **Pre-built templates:** Ready-to-use workflows for common scenarios

**Common automation workflows:**

* **CRM updates:** Automatically update contact records in HubSpot, Salesforce, Pipedrive
* **Email follow-ups:** Send personalized emails based on call outcomes
* **Lead scoring:** Update lead scores based on extracted variables
* **Calendar booking:** Schedule follow-up meetings automatically
* **Team notifications:** Alert team members about important calls

### External Platforms

**Any platform with webhook support:**

* Receive webhook data from our platform
* Process extracted variables in your own systems
* Create custom automation workflows
* Integrate with any API or service that accepts webhooks

**Use cases:**

* Connect to any CRM, email platform, or business tool
* Send data to custom applications
* Trigger workflows in third-party automation platforms
* Store data in external databases or systems

### Custom Development

**API endpoints:** Build custom receivers for webhook data

**Database integration:** Store call data in your own systems

**Business logic:** Trigger complex workflows based on extracted variables

## Testing Your Assistant

Open **Test assistant** on your assistant to try it out: call your own phone, talk to it in the
browser, or use the free text chat. See [Testing your assistant](https://docs.comix-flow.com/ai-assistants/testing.md) for what
each one proves.

## Web Widget Integration

The widget has its own page: [Web Widget](https://docs.comix-flow.com/ai-assistants/web-widget.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.