Skip to content
  • There are no suggestions because the search field is empty.

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:

Reference 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:
New
Billable Transfer
No Contact – Working Lead
Contacted, Call Back
Contacted, Not Interested
Bad Lead / Dead
Quoted – Awaiting Decision
Quoted – More Expensive
Quoted – Does Not Qualify
Policy Sold
Non-Billable Transfer
DNC / Opt-Out
Lead Sold

Questions:
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.