How it works

WAGHL exposes a webhook that bridges your GHL workflows with the ChatGPT API. When a customer sends a WhatsApp message, GHL triggers a workflow that calls our webhook with your bot's instructions (its personality and rules), the model to use, and your OpenAI API key. ChatGPT generates a reply — WAGHL delivers it on WhatsApp and remembers the conversation so the bot has context next time.

Customer
"What are your business hours?"
ChatGPT reply
"We're open Mon–Fri, 9am–6pm EST. Need to schedule something?"
Customer message → Workflow webhook → ChatGPT API → WhatsApp reply

Customer messages trigger a GHL workflow that calls the WAGHL webhook with your bot's instructions, model and API key. The AI generates a reply, WAGHL sends it back on WhatsApp.

Setup steps

The video above walks through the complete setup. Here's the summary:

1

Create a new workflow in GHL

Open Automation → Workflows → Create Workflow, choose From Scratch.

2

Add the trigger

Add a Customer Replied trigger. Set the filter Reply Channel to SMS (since WAGHL routes WhatsApp through SMS). Save the trigger and enable Re-entry in workflow settings — that lets the same contact trigger the workflow on every reply.

3

Add a Webhook action

Add an action of type Webhook. Set the method to POST. Use the URL from the table below based on your gateway.

4

Add your bot's settings

In the webhook action's Custom Data section, add the two required keys: chat_gpt_instructions (what the bot should do — its personality, rules and knowledge) and chat_gpt_model (the OpenAI model to use, e.g. a current model ID from your OpenAI account). Add your chat_gpt_api_key too if it isn't already saved on your WAGHL account. See the full list of keys below.

5

Save, name, publish

Save the action. Name the workflow (e.g. "ChatGPT Bot"). Publish it.

6

Test the bot

Send a WhatsApp message to your connected number. ChatGPT should reply within seconds.

Webhook URL by gateway

Webhook URLs differ based on your sub-account's WhatsApp Gateway. To find yours: Settings → Phone Numbers → Advanced Settings.

Provider Name Webhook URL
WhatsApp Gateway
https://trigger.apimerger.com/chatgpt-assistant
WhatsApp Gateway 1
https://trigger1.apimerger.com/chatgpt-assistant
WA1 Connector
https://wa1.apimerger.com/chatgpt-assistant
WA2 Connector
https://wa2.apimerger.com/chatgpt-assistant

Custom data keys

Your bot is configured entirely from the webhook's Custom Data — nothing is set up in the OpenAI dashboard and there's no assistant to create. Two keys are required; the rest are optional.

💡
Required keys

chat_gpt_instructions — the bot's system prompt: who it is, what it should and shouldn't do, and any facts it needs. Tip: keep long instructions in a GHL Custom Value and reference it with {{custom_values.xxx}}.

chat_gpt_model — the OpenAI model ID to use (for example a current model from your OpenAI account's model list). There's no default on purpose — OpenAI retires models periodically, so you choose the one your bot runs on.

Optional keys

  • chat_gpt_api_key — your OpenAI API key. If you've already saved it on your WAGHL account, you can leave this out and it'll be used automatically.
  • vector_store_id — one or more OpenAI vs_… vector store IDs (comma-separate several). This turns on file search, so the bot can answer from documents you've uploaded to that vector store in the OpenAI dashboard (Storage → Vector stores).
  • bot_name — a label (e.g. sales) that keeps separate memory when one number runs more than one bot. Each bot_name remembers its own conversation with the same contact.
  • thread_duration — how many days the bot remembers a contact's conversation before it resets. Default is 7, counted from when the conversation was first created.
  • additional_instructions — extra directives applied to this one message only. They aren't stored in the ongoing conversation.
  • custom_message — used only when the customer's message body is empty (for example a workflow that fires without inbound text).
🧠
The bot remembers the conversation

WAGHL keeps each contact's chat history, so the bot has context across messages — you don't pass previous messages yourself. Memory resets after thread_duration days (default 7). To start a contact fresh sooner, your team can message us to clear it.

Capture ChatGPT's last response

If you want to store ChatGPT's reply in the GHL contact for later workflows, create a custom field:

1

Open Settings → Custom Fields → Add Field

In your GHL sub-account, navigate to the custom fields settings.

2

Configure the field

Type: Multiline text. Field name: Chat Gpt Last Response (this exact name). Group: Contact. Save.

From now on, every ChatGPT response will be stored in this custom field on the contact, ready for use in other workflows or as a merge field.

⚠️
Common pitfalls

The two most common causes of a bot that doesn't reply: a missing or misspelled chat_gpt_model, or a model ID that OpenAI has retired — set a current model from your OpenAI account. A wrong or out-of-credit API key will also fail. When a run fails, GHL's workflow execution log shows the exact reason returned by the webhook, so check there first. Also verify you're using the webhook URL that matches your sub-account's gateway.

Tips for efficiency

  • Keep chat_gpt_instructions in a GHL Custom Value and reference it in the webhook — then you can tweak the bot's behaviour in one place without editing the workflow
  • Use a current OpenAI model ID in chat_gpt_model, and update it when OpenAI retires a model
  • Always create the Chat Gpt Last Response custom field if you want to track replies in GHL
  • Use bot_name when one number runs more than one bot, so their memories don't mix
  • Test with multiple message types — short questions, long explanations — to make sure your bot handles both well

What's next?

Need help with this? WhatsApp us at +1 347 308 7143 — quick replies guaranteed.
💬 Message us