View Categories

Variables & Prompt Structure in AI Calling Assistants

AI variables allow your assistant to dynamically personalise conversations, summaries, and structured data. By defining and passing values correctly, you can make every call feel tailored and professional.

What is a variable? #

A variable is a placeholder written {{variable_name}} inside your AI Assistant prompt. When a call runs, the variable is merged with real data from your company profile or GoHighLevel (GHL).

Example:

Prompt: “Hello, {{contact_first_name}}, this is {{ai_bot_name}} from {{company_name}}.”
Call: “Hello, Sarah, this is Clara AI from Affordable Care Solutions.”

Types of Variables #

1. Core Variables (System & Company Information) #

Auto-available from your account and always ready to use.

Examples:

{{company_name}}
{{company_email}}
{{company_phone}}
{{company_hours_of_operation}}
{{company_description}}

You also get core contact variables auto-filled from the dialed record:

{{contact_first_name}}, {{contact_last_name}}
{{contact_email}}, {{contact_phone}}
{{contact_address}}, {{contact_city}}, {{contact_state}}

These core variables can be used anywhere: system prompts, messages, summaries, structured data, tools, etc.

2. Custom Variables (Up to 50) #

  • Defined by you.
  • Passed inside customData from GHL via webhook/API.
  • Used in prompts as {{custom_variable_name}}.
  • Whitespace inside curly brackets is ignored ({{agent_name}} = {{ agent_name }}).

Example payload:

{
“first_name”: “Sophia”,
“phone”: “+15551234567”,
“customData”: {
“campaign_id”: “JPTdTwMSCynA9V01dh6ARxvQEJe0azUvu”,
“agent_name”: “Mike Anderson”,
“ai_call_first_message”: “Hi {{contact_first_name}}, this is {{ai_bot_name}} with {{company_name}}.”,
“ai_followup_questions”: “What slows you down in ACA renewals? How do you track follow-ups?”
}
}

3. Default Variables (Date/Time & Customer Context) #

Always available, no need to define:

{{now}}, {{date}}, {{time}}, {{month}}, {{day}}, {{year}}
{{customer.number}} (recipient’s number)
Any {{customer.X}} property passed in API

Supports LiquidJS formatting:

{{“now” | date: “%A, %B %d, %Y, %I:%M %p”, “America/Chicago”}}
→ Monday, January 01, 2024, 03:45 PM

What If a Variable Is Missing (Null)? #

  • If no value is provided, the AI simply skips it.
  • The assistant does not hang up.
  • Conversation continues normally.

Example:
If it {{contact_email}} is missing, the assistant won’t mention email—it won’t break the call.

Where Can Variables Be Used? #

Variables can be used anywhere in the system:

  • System Prompt
  • Messages (first message, follow-up, confirmations)
  • Summaries
  • Structured Data
  • Tool Triggers or Responses

Outgoing vs Incoming Assistants #

  • Core Variables → work in both receptionist (incoming call) and outgoing caller.
  • Custom Variables (customData) → only work with outgoing callers (since data comes from GHL campaigns/webhooks).

Best Practice:

  • If you want to define and use your own variables from GHL, always create a separate AI Assistant for outgoing calls.
  • For incoming calls where you only need core variables, one AI receptionist assistant is enough.

Side-by-Side Example (JSON → Prompt Mapping) #

GHL Webhook Payload #

{
“first_name”: “Sophia”,
“phone”: “+15551234567”,
“customData”: {
“campaign_id”: “JPTdTwMSCynA9V01dh6ARxvQEJe0azUvu”,
“agent_name”: “Mike Anderson”,
“ai_call_first_message”: “Hi {{contact_first_name}}, this is {{ai_bot_name}} with {{company_name}}.”,
“ai_followup_questions”: “What slows you down in ACA renewals? How do you track follow-ups?”,
“preferred_timezone”: “America/Chicago”
}
}

Prompt Snippet #

First Message
{{ai_call_first_message}}

## Identity & Purpose
You are {{ai_bot_name}}, representing {{company_name}}.
You’re calling ACA agents to discuss ACA Flow benefits.

## Objectives
1. Greet {{contact_first_name}}.
2. Ask {{ai_followup_questions}}.
3. If interested, book with {{agent_name}}.

## Notes
Current Time: {{now}} ({{preferred_timezone}})

Live Call Output #

  • “Hi Sophia, this is Clara AI with Affordable Care Solutions.”
  • “Can I ask, what slows you down in ACA renewals? How do you track follow-ups?”
  • “If you’re interested, I’ll book a call with Mike Anderson.”
  • “Right now it’s Tuesday, February 4, 2025, 3:45 PM in your timezone.”

Best Practices for Prompt Writing with Variables #

  • Always define clear ## sections (Identity, Objectives, Tools, Guidelines).
  • Use variables in tools & summaries (e.g., structured data: “appointment_time”: “{{last_appointment_date}}”).
  • Define up to 50 custom variables in customData when calling from GHL.
  • Keep sentences short and ask one question at a time.
  • Don’t worry if some variables are null—the AI will gracefully skip.
  • Use separate assistants for outgoing campaigns that rely on custom data.

Quick Recap #

  • Core Variables (company/contact info) → auto available in all calls.
  • Custom Variables (defined in customData) → up to 50, work in outgoing callers only.
  • Default Variables (time/date) → always available.
  • Null-safe → AI skips missing variables gracefully.
  • Outgoing vs Incoming → Use separate assistants if you need custom variables from GHL.

With variables, your AI Assistant doesn’t just “talk”—it becomes data-aware, using company, contact, and campaign information to create natural, intelligent conversations.

Scroll to Top