---
title: AI Preprocessor – Execution Order & _gpt Payload 
description: Comprehensive guide to the AI Preprocessor in Taalk, including execution order, _gpt payload structure, field confidence scoring, and a real-world auto insurance CRM extraction example. Learn how to reference extracted data in rules, templates, and webhooks while ensuring accuracy, security, and efficiency.
---

[Skip to content](https://knowledge.taalk.ai/ai-preprocessor-execution-order-gpt-payload-#main-content)

Open main navigation

Close main navigation

 How can we help you today?

- There are no suggestions because the search field is empty.

1. [Taalk Academy](https://knowledge.taalk.ai/?hsLang=en)
2. [AI Force](https://knowledge.taalk.ai/ai-force?hsLang=en)
3. [Agent Plugins](https://knowledge.taalk.ai/ai-force?hsLang=en#agent-plugins)

August 16, 2025

# AI Preprocessor – Execution Order & \_gpt Payload 

## The AI Preprocessor – Data Extraction runs before any Webhook actions or Lookup Table evaluations. It reads the selected Transcript Segment (e.g., Before Transfer, After Transfer, or Full Conversation), extracts structured fields, and writes a normalized object to params.\_gpt. Downstream rules, webhooks, and templates can then reference this data.

### **When it runs**

The **AI Preprocessor – Data Extraction** runs **before** any Webhook actions or Lookup Table evaluations. It reads the selected **Transcript Segment** (e.g., *Before Transfer*, *After Transfer*, or *Full Conversation*), extracts structured fields, and writes a normalized object to params.\_gpt. Downstream rules, webhooks, and templates can then reference this data.

---

### **Sample Example:**

OBJECTIVE:  
You are a data scribe tasked with extracting the agreed upon information from the conversation with the customer  
If there is only one item in the list pick the only one.  
If you don't known the answer, leave it empty.

- email, the email the caller provided.

Use the template below to organize your answer. 

TEMPLATE:  
\`\`\`json  
{  
  "email": string,  
}  
\`\`\`

This will produce \_gpt.email variable

---

### **How to reference it: <https://knowledge.taalk.ai/js-preprocessor-explained?hsLang=en>**<https://knowledge.taalk.ai/js-preprocessor-explained?hsLang=en>

### **[Reference](https://knowledge.taalk.ai/js-preprocessor-explained?hsLang=en) it in JS Preprocessor: (*params.\_gpt.email*)**

- **Rule conditions:**

```
when params._gpt.email != null
```

### Reference in the Webhooks: *(\_gpt)* 

```
Reference to the extracted email filed with: _gpt.email 
```

To check if the \_gpt exists, use \_gpt?.email

#### **More Complex Example — CRM Data Extraction for Auto Insurance Calls**

```
Objective:You are a data scribe for a CRM tool reading the transcript between an auto insurance company agent and a customer. Your goal is to summarize why the call was made and determine the disposition of the call.Disposition reason list:NewBillable TransferNo Contact – Working LeadContacted, Call BackContacted, Not InterestedBad Lead / DeadQuoted – Awaiting DecisionQuoted – More ExpensiveQuoted – Does Not QualifyPolicy SoldNon-Billable TransferDNC / Opt-OutLead SoldQuestions:Taalk_Call_Disposition — What’s the call disposition? (string)Taalk_Call_xFer_Status — Was the call transferred? (boolean)Taalk_Outcome — Did the call lead to a successful sale? (boolean)Format response using template. Don't include the field if it already exists or if value didn't change. ## TEMPLATE```json{ "Taalk_Call_Disposition": "string", "Taalk_Call_xFer_Status": "boolean", "Taalk_Outcome": "boolean"}```
```

---

**Pre-call data:**

| **Field Name** | **Current Value** |
| --- | --- |
| Taalk\_Call\_Disposition | {Taalk\_Call\_Disposition} |
| Taalk\_Call\_xFer\_Status | {Taalk\_Call\_xFer\_Status} |
| Taalk\_Outcome | <Taalk\_Outcome> |

**Response template:**

Only include fields if they **don’t already exist** or if the value has **changed**.

```
{  "Taalk_Call_Disposition": "string",  "Taalk_Call_xFer_Status": true,  "Taalk_Outcome": false}
```

---

### **Priority & merge behavior**

- If your workflow also maps values to params via Lookup Table or Webhook, existing keys in params.\_gpt.fields are **not overwritten** unless explicitly done in a later step.
  
    1. Read from params.\_gpt.fields.\*.value
    2. Validate/normalize
    3. Promote to canonical keys in params only

---

### **Error handling**

If extraction fails, \_gpt is still present but with empty fields and an error:

```
{ "fields": {}, "error": { "code": "model_timeout", "message": "LLM timeout after 8s" } }
```

Always check params.\_gpt.error before relying on values.

---

### **Security & PII**

- Avoid logging the full params object.
- Redact before sending to 3rd-party webhooks unless required.
- Use confidence thresholds to reduce false positives.

---

### **Size limits**

The transcript slice sent to the preprocessor is capped by model context limits. If truncated, \_gpt.meta.truncated=true is set. Consider **Full Conversation** or a **Summarize-then-Extract** step for long calls.

---

 

- [Getting Started](https://knowledge.taalk.ai/getting-started?hsLang=en#main-content)
  
  
  
  
  
    - [Platform 101](https://knowledge.taalk.ai/getting-started?hsLang=en#platform-101)
    - [Campaign 101](https://knowledge.taalk.ai/getting-started?hsLang=en#campaign-101)
    - [AI Workforce](https://knowledge.taalk.ai/getting-started?hsLang=en#ai-workforce)
    - [Operator Force](https://knowledge.taalk.ai/getting-started?hsLang=en#operator-force)
    - [Billing 101](https://knowledge.taalk.ai/getting-started?hsLang=en#billing-101)
    - [Compliance 101](https://knowledge.taalk.ai/getting-started?hsLang=en#compliance-101)
- [AI Force](https://knowledge.taalk.ai/ai-force?hsLang=en#main-content)
  
  
  
  
  
    - [Agent Behavior](https://knowledge.taalk.ai/ai-force?hsLang=en#agent-behavior)
    - [Objective and Scripts](https://knowledge.taalk.ai/ai-force?hsLang=en#objective-and-scripts)
    - [Agent Call Flow and Transfers](https://knowledge.taalk.ai/ai-force?hsLang=en#agent-call-flow-and-transfers)
    - [Agent Knowledge](https://knowledge.taalk.ai/ai-force?hsLang=en#agent-knowledge)
    - [Agent Multichannel Playbooks](https://knowledge.taalk.ai/ai-force?hsLang=en#agent-multichannel-playbooks)
    - [Agent Plugins](https://knowledge.taalk.ai/ai-force?hsLang=en#agent-plugins)
    - [Best Practices](https://knowledge.taalk.ai/ai-force?hsLang=en#best-practices)
    - [Templates](https://knowledge.taalk.ai/ai-force?hsLang=en#templates)
- [Operator Force](https://knowledge.taalk.ai/operator-force?hsLang=en#main-content)
  
  
  
  
  
    - [Operator](https://knowledge.taalk.ai/operator-force?hsLang=en#operator)
    - [Admin](https://knowledge.taalk.ai/operator-force?hsLang=en#admin)
- [Contact Center](https://knowledge.taalk.ai/contact-center?hsLang=en#main-content)
  
  
  
  
  
    - [Campaign](https://knowledge.taalk.ai/contact-center?hsLang=en#campaign)
    - [Taalk Dialer](https://knowledge.taalk.ai/contact-center?hsLang=en#taalk-dialer)
    - [Metrics & Reporting](https://knowledge.taalk.ai/contact-center?hsLang=en#metrics-reporting)
    - [Templates](https://knowledge.taalk.ai/contact-center?hsLang=en#templates)
    - [Best Practices](https://knowledge.taalk.ai/contact-center?hsLang=en#best-practices)
- [Automation](https://knowledge.taalk.ai/automation?hsLang=en#main-content)
  
  
  
  
  
    - [OpenAPI](https://knowledge.taalk.ai/automation?hsLang=en#openapi)
    - [Native Integration](https://knowledge.taalk.ai/automation?hsLang=en#native-integration)
- [Compliances](https://knowledge.taalk.ai/compliances?hsLang=en#main-content)
  
  
  
  
  
    - [Company DNC](https://knowledge.taalk.ai/compliances?hsLang=en#company-dnc)
    - [TCPA](https://knowledge.taalk.ai/compliances?hsLang=en#tcpa)
    - [Best Practices](https://knowledge.taalk.ai/compliances?hsLang=en#best-practices)
    - [Teleco Trust](https://knowledge.taalk.ai/compliances?hsLang=en#teleco-trust)
- [Product Updates](https://knowledge.taalk.ai/product-updates?hsLang=en#main-content)
  
  
  
  
  
    - [W9-2025](https://knowledge.taalk.ai/product-updates?hsLang=en#w9-2025)
    - [W8-2025](https://knowledge.taalk.ai/product-updates?hsLang=en#w8-2025)
    - [W10-2025](https://knowledge.taalk.ai/product-updates?hsLang=en#w10-2025)
    - [W11-2025](https://knowledge.taalk.ai/product-updates?hsLang=en#w11-2025)
    - [W12-2025](https://knowledge.taalk.ai/product-updates?hsLang=en#w12-2025)
    - [W13-2025](https://knowledge.taalk.ai/product-updates?hsLang=en#w13-2025)
    - [W14-2025](https://knowledge.taalk.ai/product-updates?hsLang=en#w14-2025)
    - [W15-2025](https://knowledge.taalk.ai/product-updates?hsLang=en#w15-2025)
    - [W16-2025](https://knowledge.taalk.ai/product-updates?hsLang=en#w16-2025)

[![Taalk](https://knowledge.taalk.ai/hs-fs/hubfs/logo%20taalk.png?width=60&height=60&name=logo%20taalk.png "Taalk")](https://knowledge.taalk.ai/?hsLang=en)

[mailto:success@taalk.ai](mailto:success@taalk.ai) <https://www.linkedin.com/company/taalkai>

Copyright © 2025 Taalk LLC