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

# Pipeline Guides

> Step-by-step walkthroughs for building common automation pipelines: CRM-triggered outbound calls, post-call CRM sync, email follow-ups, conditional notifications, and webhook integrations.

## Guide 1: CRM-to-Call Pipeline (Webhook)

**Goal:** When a new lead is created in your CRM, automatically create a contact in Voxworks and place an outbound call.

**Trigger:** Inbound Webhook

### Steps

**Step 1 — Transform: Map incoming fields**

Map the webhook payload fields to contact fields:

| Source               | Target                 |
| -------------------- | ---------------------- |
| `trigger.phone`      | `contact.phone_number` |
| `trigger.first_name` | `contact.first_name`   |
| `trigger.last_name`  | `contact.last_name`    |
| `trigger.email`      | `contact.email`        |

**Step 2 — Upsert Contact**

* Match on: `phone_number`
* Uses the mapped fields from Step 1

If the contact already exists (same phone number), their details are updated. Otherwise, a new contact is created.

**Step 3 — Upsert Object** (optional)

Store the CRM identifier so you can reference it later for syncing results back:

* Object type: `monday_item` (or your CRM's type)
* Match on: `CRM_ID` = `trigger.crm_id`
* Link to contact: Yes

| Source             | Target     |
| ------------------ | ---------- |
| `trigger.crm_id`   | `CRM_ID`   |
| `trigger.board_id` | `board_id` |

**Step 4 — Create Call**

* Script: Your outbound sales Script
* Phone: `contact.phone_number`
* From number: Your outbound number (or leave blank for default)

### CRM Setup

In your CRM, configure an automation or webhook that fires when a new item is created (or when a status changes to "Ready to Call"). Point it at your Voxworks webhook URL with the required JSON fields.

***

## Guide 2: Post-Call CRM Sync

**Goal:** After every completed call on a specific Script, push the summary, status, and structured data back to your CRM.

**Trigger:** Call Completed

* Script filter: Select your Script
* Status filter: `completed` (or leave empty for all statuses)

### Steps

**Step 1 — Transform: Map call results to CRM fields**

| Source                         | Target        |
| ------------------------------ | ------------- |
| `call.call_summary`            | `long_text_7` |
| `call.status`                  | `status_1`    |
| `call.duration`                | `numbers_3`   |
| `call.structured_data.outcome` | `status_8`    |
| `objects.monday_item.CRM_ID`   | `item_id`     |
| `objects.monday_item.board_id` | `board_id`    |

The `objects.monday_item.*` fields reference the CRM identifiers stored on the contact's linked object (created by a previous automation or manually).

The target field names (e.g., `long_text_7`, `status_1`) correspond to column IDs in your CRM. Find these in your CRM's column settings.

**Step 2 — Destination: Integration Sync**

* Integration: Your connected CRM (e.g., Monday.com)
* Uses the mapped fields from Step 1

That's it. Every time a call completes on this Script, the results flow back to your CRM automatically.

***

## Guide 3: Post-Call Email to Contact

**Goal:** Send a personalized follow-up email to the contact after every completed call.

**Trigger:** Call Completed

* Script filter: Select your Script
* Status filter: `completed`

### Steps

**Step 1 — Destination: Email**

* To: `contact`
* Subject: `Your call summary - {{contact.full_name}}`
* Body:

```text theme={null}
Hi {{contact.first_name}},

Thank you for your time today. Here is a summary of our conversation:

{{call.call_summary}}

If you have any questions, feel free to reply to this email.

Best regards,
The Team
```

* From name: Your company name
* Reply to: Your support email address

***

## Guide 4: End-to-End Pipeline (Webhook to Call to CRM Sync + Email)

**Goal:** Receive a lead via webhook, create the contact, call them, then sync results to CRM and send a follow-up email.

**Trigger:** Inbound Webhook

### Steps

**Step 1 — Transform: Map webhook fields**

| Source               | Target                 |
| -------------------- | ---------------------- |
| `trigger.phone`      | `contact.phone_number` |
| `trigger.first_name` | `contact.first_name`   |
| `trigger.last_name`  | `contact.last_name`    |
| `trigger.email`      | `contact.email`        |

**Step 2 — Upsert Contact**

* Match on: `phone_number`

**Step 3 — Upsert Object**

* Object type: `monday_item`
* Match on: `CRM_ID` = `trigger.crm_id`
* Link to contact: Yes

| Source             | Target     |
| ------------------ | ---------- |
| `trigger.crm_id`   | `CRM_ID`   |
| `trigger.board_id` | `board_id` |

**Step 4 — Create Call**

* Script: Sales Outreach Script
* Phone: `contact.phone_number`

*--- after call completes ---*

**Step 5 — Transform: Map call results**

| Source                         | Target        |
| ------------------------------ | ------------- |
| `call.call_summary`            | `long_text_7` |
| `call.status`                  | `status_1`    |
| `call.duration`                | `numbers_3`   |
| `objects.monday_item.CRM_ID`   | `item_id`     |
| `objects.monday_item.board_id` | `board_id`    |

**Step 6 — Destination: Integration Sync**

* Integration: Monday.com

**Step 7 — Destination: Email to contact**

* Subject: `Thanks for chatting, {{contact.first_name}}`
* Body: Personalized follow-up with `{{call.call_summary}}`

**Step 8 — Condition: Low rating alert**

* Field: `call.structured_data.rating`
* Operator: `lt`
* Value: `3`
* On true:
  * **Destination: SMS to team** — `Low rating call with {{contact.full_name}}. Rating: {{call.structured_data.rating}}. Summary: {{call.call_summary}}`

This single automation handles the entire lifecycle: lead intake, outbound call, CRM sync, customer email, and team alerts.

***

## Guide 5: Conditional Notification Pipeline

**Goal:** After calls complete, send different notifications based on the call outcome.

**Trigger:** Call Completed

* Script filter: Select your Script

### Steps

**Step 1 — Condition: Check call status**

* Field: `call.status`
* Operator: `eq`
* Value: `completed`
* On true: (Steps 2-3)
* On false: (Step 4)

**Step 2 (on true) — Destination: Email to contact**

Send a thank-you email with the call summary.

**Step 3 (on true) — Destination: Integration Sync**

Sync the successful call results to your CRM.

**Step 4 (on false) — Destination: SMS to team**

Alert team members that a call didn't complete successfully:

```text theme={null}
Call to {{contact.full_name}} ended with status: {{call.status}}. End reason: {{call.end_reason}}.
```

***

## Guide 6: Outbound Webhook Notification

**Goal:** Send call results to an external system via HTTP webhook after every call.

**Trigger:** Call Completed

### Steps

**Step 1 — Destination: Webhook**

* URL: `https://your-api.example.com/voxworks-callback`
* Method: `POST`
* Headers: `{ "Authorization": "Bearer your-api-key", "Content-Type": "application/json" }`
* Body:

```json theme={null}
{
  "call_id": "{{call.id}}",
  "contact_phone": "{{contact.phone_number}}",
  "contact_name": "{{contact.full_name}}",
  "status": "{{call.status}}",
  "end_reason": "{{call.end_reason}}",
  "duration": "{{call.duration}}",
  "summary": "{{call.call_summary}}",
  "structured_data": "{{call.structured_data}}",
  "objectives": "{{call.objectives}}"
}
```

The receiving system can use the `X-Execution-Id` header (included automatically) to deduplicate in case of retries.

***

## Tips

* **Start simple.** Begin with a 2-3 step automation and add complexity once it's working.
* **Use Test Webhook** to verify your field mappings before enabling the automation.
* **Check the Execution Log** after each test run to see exactly what data flowed through each step.
* **Store CRM identifiers as objects.** This lets post-call automations reference the right CRM record without re-fetching.
* **Use conditions sparingly.** Most pipelines work fine as a straight sequence. Add conditions only when you need genuinely different behavior based on outcomes.
