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

# Voice AI Workflows

> How workflows process voice conversations and push data to your systems

When a customer speaks with a Voice AI agent, the conversation is captured as a transcript—a single text string containing the entire exchange. Workflows parse this transcript, extract structured data, and push it to your claims system, AMS, or any API.

## How Voice Transcripts Work

During a call, Voice AI captures everything said by both the caller and the AI agent:

```
Assistant: Thank you for calling Acme Insurance. How can I help you today?
User: Yeah, I need to file a claim. My basement flooded.
Assistant: I'm sorry to hear that. I can help you file a claim right now. Can I get your policy number?
User: It's HO-12345678.
Assistant: Thank you. And what's your name?
User: John Smith.
Assistant: Got it, John. When did the flooding occur?
User: This morning, around 6 AM.
```

This transcript is passed to a workflow as **one big string**. The workflow's job is to:

1. **Parse** the transcript into structured data
2. **Transform** that data into the format your system expects
3. **Send** it to your claims platform, AMS, or API
4. **Return** a response so the AI can confirm with the caller

***

## Example: FNOL to Snapsheet

Let's walk through a real workflow that takes a First Notice of Loss conversation and creates a claim in Snapsheet (a claims management system).

```
Start → AI Prompt Node → Mapping Node → Task Node → End
```

**1. Receive the transcript**

The workflow receives the full conversation transcript from Voice AI

**2. Parse with AI**

An AI Prompt Node extracts structured data from the unstructured text

**3. Transform the data**

A Mapping Node formats the data for Snapsheet's API

**4. Create the claim**

A Task Node sends the data to Snapsheet and receives the claim number

**5. Return confirmation**

The response bubbles back to Voice AI: "Your claim number is CLM-98765"

***

## AI Prompt Node

The **AI Prompt Node** lets you interact with LLMs directly from your workflow. Use it to parse transcripts, extract entities, classify intent, or generate responses.

### Parsing a Transcript

Configure the AI Prompt Node to extract structured data:

> [tab] Prompt Configuration
>
> ```
> Parse the following transcript and extract all claim information 
> as a JSON object. Include:
> - claimType (e.g., water, fire, theft, auto)
> - claimDetails (description of what happened)
> - callerFirstName
> - callerLastName
> - policyNumber
> - dateOfLoss
> - timeOfLoss
> - propertyAddress (if mentioned)
> - contactPhone (if mentioned)
>
> Transcript:
> {{context.transcript}}
>
> Respond with only the JSON object, no additional text.
> ```

> [tab] Sample Output
>
> The AI returns structured data extracted from the conversation:
>
> ```json theme={null}
> {
>   "claimType": "water",
>   "claimDetails": "Basement flooded",
>   "callerFirstName": "John",
>   "callerLastName": "Smith",
>   "policyNumber": "HO-12345678",
>   "dateOfLoss": "2025-02-13",
>   "timeOfLoss": "06:00",
>   "propertyAddress": null,
>   "contactPhone": null
> }
> ```

> [!NOTE]
>
> The AI Prompt Node uses the same technology that powers Voice AI—you can configure LLM interactions for both real-time conversations and backend processing.

***

## Mapping Node

The **Mapping Node** transforms data using JSONata expressions. Use it to restructure the AI's output into the exact format your target system requires.

### Example: Format for Snapsheet API

> [tab] Input (from AI Prompt)
>
> ```json theme={null}
> {
>   "claimType": "water",
>   "claimDetails": "Basement flooded",
>   "callerFirstName": "John",
>   "callerLastName": "Smith",
>   "policyNumber": "HO-12345678",
>   "dateOfLoss": "2025-02-13",
>   "timeOfLoss": "06:00"
> }
> ```

> [tab] JSONata Expression
>
> ```jsonata theme={null}
> {
>   "claim": {
>     "type": claimType,
>     "description": claimDetails,
>     "loss_date": dateOfLoss & "T" & timeOfLoss & ":00Z",
>     "policy_id": policyNumber
>   },
>   "reporter": {
>     "full_name": callerFirstName & " " & callerLastName,
>     "relationship": "policyholder"
>   }
> }
> ```

> [tab] Output (for Snapsheet)
>
> ```json theme={null}
> {
>   "claim": {
>     "type": "water",
>     "description": "Basement flooded",
>     "loss_date": "2025-02-13T06:00:00Z",
>     "policy_id": "HO-12345678"
>   },
>   "reporter": {
>     "full_name": "John Smith",
>     "relationship": "policyholder"
>   }
> }
> ```

***

## Task Node

The **Task Node** calls external systems via HTTP. This is how you push data to Snapsheet, Guidewire, your AMS, or any API.

### Configuring a Connection

Before using a Task Node, create a **Connection** to your target system:

1. Navigate to **Connections** in the left sidebar
2. Click **Create a connection**
3. Configure authentication and endpoints for QA and Production

**Example: Snapsheet Connection**

| Setting | QA Environment | Production Environment |
| - | - | - |
| **Name** | Snapsheet Claims API | Snapsheet Claims API |
| **Type** | REST - Bearer Token | REST - Bearer Token |
| **Base URL** | `https://api.staging.snapsheet.com/v1` | `https://api.snapsheet.com/v1` |
| **Token** | `sk_test_xxxxx` | `sk_live_xxxxx` |

### Task Node Configuration

| Setting | Value | Description |
| - | - | - |
| **Connection** | Snapsheet Claims API | Select your pre-configured connection |
| **Method** | POST | HTTP method for creating a claim |
| **URL** | `/claims` | Appended to base URL |
| **Request Body** | `{{context.claim}}` | Data from the Mapping Node |

### Handling the Response

Configure where to store the API response:

| Outcome | Property | Usage |
| - | - | - |
| **On Success** | `snapsheetResponse` | Stores claim ID, confirmation number |
| **On Error** | `snapsheetError` | Stores error message, validation details |

The response is added to your workflow context, making it available to subsequent nodes or to return to Voice AI.

***

## Returning Data to Voice AI

After the Task Node succeeds, the claim number is in your context:

```json theme={null}
{
  "snapsheetResponse": {
    "claim_id": "CLM-98765",
    "status": "created",
    "message": "Claim successfully submitted"
  }
}
```

The workflow returns this to Voice AI, which can then say:

> "Great news, John. Your claim has been submitted successfully. Your claim number is **CLM-98765**. Is there anything else I can help you with?"

***

## Error Handling

Every node has **success** and **error** paths. Hover over a node to see the `+` (success) and `⚠` (error) connectors.

### Branching on Errors

```
Task Node (Snapsheet)
    ├── Success → End Node (return claim number)
    └── Error → Error Handler → End Node (return error message)
```

### Common Error Scenarios

| Error Type | Cause | Response to Caller |
| - | - | - |
| **Validation Error** | Missing or invalid data | "I'm missing some information. Could you repeat your policy number?" |
| **API Error (500)** | Snapsheet system issue | "I'm having trouble submitting your claim right now. Let me transfer you to an agent." |
| **Auth Error (401)** | Invalid credentials | Escalate to human agent |
| **Timeout** | API not responding | Retry or escalate |

> [!TIP]
>
> Configure **retry strategies** on Task Nodes for transient errors (500, 502, 503). Use exponential backoff for production resilience.

***

## Additional Node Types

Beyond the core nodes, Liberate offers specialized nodes for complex logic:

### Code Node

Write and execute custom **JavaScript** or **Python** code when JSONata isn't enough:

```javascript theme={null}
// Example: Calculate days since loss
const lossDate = new Date(context.dateOfLoss);
const today = new Date();
const daysSinceLoss = Math.floor((today - lossDate) / (1000 * 60 * 60 * 24));

return {
  ...context,
  daysSinceLoss: daysSinceLoss,
  isUrgent: daysSinceLoss <= 1
};
```

### Decision Table Node

Quickly map inputs to outputs using a visual table—no code required:

| Claim Type | Amount | Priority | Assignment |
| - | - | - | - |
| water | greater than 50000 | high | senior\_adjuster |
| water | 50000 or less | medium | auto\_adjuster |
| fire | any | high | senior\_adjuster |
| theft | any | medium | auto\_adjuster |

### Entity Table Node

Maintain a static CSV for reference data lookups:

```csv theme={null}
state_code,state_name,timezone
CA,California,America/Los_Angeles
TX,Texas,America/Chicago
FL,Florida,America/New_York
```

Use for mapping codes to names, looking up regional settings, or maintaining reference data that doesn't change often.

***

## Platform Architecture

Understanding how the pieces connect:

```
Organization (Your Company)
    └── Project (Claims Automation)
            └── Agent (Claims Voice AI)
                    └── Tool (FNOL Workflow)
                            └── Workflow (slug: fnol-to-snapsheet)
```

| Concept | Description |
| - | - |
| **Organization** | Your company's Liberate instance |
| **Project** | Container for related agents and workflows |
| **Agent** | A configured Voice/Email/SMS AI |
| **Tool** | Links an agent to a workflow |
| **Workflow Slug** | Unique ID in the URL that identifies the workflow |

When you create a workflow, a unique **slug** is generated in the URL (e.g., `fnol-to-snapsheet-a1b2c3`). This slug tells the AI which workflow to execute when a tool is invoked.

***

## Next Steps

> [card] [Workflow Quickstart](https://docs.liberate.ai/workflows/quickstart.md)
>
> Build your first workflow step-by-step

> [card] [Node Reference](https://docs.liberate.ai/workflows/nodes/mapping-node.md)
>
> Detailed docs for each node type

> [card] [Connections Guide](https://docs.liberate.ai/workflows/concepts/connections.md)
>
> Set up integrations with your systems

> [card] [FNOL Example](https://docs.liberate.ai/workflows/examples/fnol-workflow.md)
>
> Complete claims intake workflow


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