Prefer to watch? This 10-minute video walks through every step below, from an empty workspace to a live chatbot with a knowledge base, memory, guardrails and a Gmail hand-over to your team.
Not in the video: the extra setup for HMAC signed chats (see Using HMAC signed? in step 5), opening the shared chat page and the React / Next.js option (step 10), and building your own chat UI (step 11).
/chat-triggers/in/:chatId/message{{payload.message}}The same Chat Trigger can power a shared link, a website widget, an npm component and direct API calls at the same time.
Open the Chat Trigger in Flows
Sign in to hostwebhook.com and click Flows in the left sidebar. A Chat Trigger always comes with an AI node already connected, and both start paused. Click the Chat Trigger node to open its settings.
- Marker 1: The Chat Trigger receives each visitor message through its webhook.
- Marker 2: The AI node writes the reply. You configure it in step 6.
Starting from scratch? Add a Chat Trigger from the canvas (Nodes → build on the canvas). It arrives already connected to an AI node, just like this one.
Name and style the chat
The Set up your Chat Trigger window has three tabs. On Configuration, set what visitors see at the top of the chat. Changes save automatically; look for Saved in the top-right corner.
- Marker 1: Configuration, Advanced and Share & Activity hold every setting.
- Marker 2: Title and Subtitle appear in the chat header. This example uses “Support Assistant”.
- Marker 3: Don't click Activate yet. Turn it on after the AI node is ready (step 8).
Add a greeting and a persona
Scroll down the same tab. Set your brand color, add a greeting with + Add under Initial messages, and optionally give this chat its own persona.
- Marker 1: Primary color and Mode (dark, light or auto) style the widget.
- Marker 2: The greeting shows before the visitor types. It is display-only and is never sent to the AI.
- Marker 3: System prompt override replaces the AI node's system prompt for this chat only. Use it to run several bots with different personalities from one AI node.
Seeing “Not saved”?
An empty greeting row blocks saving. Type the greeting text, or click Remove on the empty row.
Set session and rate limits
Open the Advanced tab. Every message a visitor sends is a paid AI call, so these limits control your costs.
- Marker 1: The Advanced tab. Leave Session ID strategy on
autowhen you use the hosted link or widget. - Marker 2: Messages per minute defaults to 60 (range 1–600). For a public chat, a lower value such as 10–20 limits abuse.
- Marker 3: Per session is the recommended throttle bucket. Visitors behind the same office network don't share a limit.
Usage caps (further down) add hard daily and monthly limits on messages, tokens and dollars, and can email you at 75%, 90% and 100% of the monthly caps.
Choose who can use the chat
Scroll to the bottom of Advanced.
- Marker 1: Allowed origins lists the sites that may embed the chat, one per line, such as
https://yoursite.com. Leave it empty on a public chat to allow any site. - Marker 2: Public lets anyone with the link chat. HMAC signed only accepts requests signed by your own backend. Use it for logged-in users or paid tools.
Using HMAC signed?
- Allowed origins becomes required. If you also want the shared chat link to work, include the origin shown in your Share URL (step 10) along with your own site. Otherwise the link fails with a 403 error.
- Every request must be signed. Send an
Authorization: Bearer <sig>:<ts>header, wheresigis HMAC-SHA256 ofsessionId:tsusing the trigger's secret. The signature is valid for 5 minutes. - Keep the secret on your server and never put it in the browser. The widget gets signatures from a small signing endpoint you host. See the HostWebhook docs for examples in Node, Python and PHP.
Open the AI node
Click Done, then click the AI node in Flows (“Answers the chat …”) to open Set up your AI. This window has 8 tabs. You'll go through all of them in the next step.
- Marker 1: This warning disappears once you turn on guardrails in the Guardrails tab (step 7).
- Marker 2: The provider is the first setting on the Config tab (step 7).
Configure every AI node tab
The AI node decides how your chatbot thinks, what it knows, what it remembers and what it is allowed to do. Those settings are spread across 8 tabs, and the defaults are not enough for a chatbot that works well.
Go through all 8 tabs before you test the chatbot.
Click each tab below in order, or use Next tab at the bottom. Every tab you have opened gets a ✓. In HostWebhook, the tabs are in the same order at the top of the Set up your AI window. Changes save automatically: look for Saved in the top-right corner.
What it does: chooses the AI model, what kind of job the node does, and the instructions it follows.
- Marker 1: The 8 tabs. Work through every one of them.
- Marker 2: Provider: Anthropic, OpenAI, Google, Groq, OpenRouter or a self-hosted Ollama. This example uses OpenAI.
- Marker 3: Credential: click + Add … API Key and paste your key. A green box means it's connected. The model is chosen on the credential, in Settings → Credentials.
- Marker 1: What this node does: choose Agent. Only Agent can use tools and memory, which a chatbot needs.
- Marker 2: System prompt: who the bot is, what it may answer, and which tool to search first. Example below.
- Marker 3: User message: type
{{payload.message}}, the text the visitor typed. It turns into a Message chip when you click away.
You are the support assistant for Brightloop Coffee Co., a coffee subscription company. Before answering any question about plans, prices, shipping, subscriptions, refunds, payments or contact details, search the FAQ with the query_brightloop_faq tool and answer only with what it returns. If the FAQ does not cover the question, say so and suggest emailing hello@brightloop.example. Keep answers short, friendly and in the customer's language.
Not sure what to write? Ask an AI assistant such as Claude or ChatGPT to draft the system prompt for you, then paste its answer into the System prompt box. Describe your business, who the visitors are, what the bot should and shouldn't answer, and the name of your knowledge base tool. Test the result in the preview widget (step 9) and adjust it.
Write a system prompt for a customer support chatbot. Business: [your company name and what it sells] Visitors: [who will use the chat, e.g. customers asking about orders] The bot should: answer questions about [topics], using the knowledge base tool [query_your_store_name] before every answer. The bot should not: [topics it must refuse, e.g. legal advice, discounts] If it doesn't know: [what to do, e.g. suggest emailing support@yourcompany.com] Tone: [e.g. short, friendly, in the visitor's language] Keep the prompt under 200 words and write it as direct instructions to the bot.
Using a System prompt override on the Chat Trigger (step 3)? It replaces this prompt completely. Leave the override empty if you write your instructions here.
What it does: sets the format of the AI's reply.
- Marker 1: Choose JSON (no schema), the format marked RECOMMENDED. HostWebhook cleans up the reply and the chat widget shows the answer text to the visitor.
What it does: gives the AI abilities beyond chatting, such as searching your own documents. For a support chatbot, the most important tool is a Vector Store: a knowledge base the AI searches before answering, so it replies with your real policies instead of guessing.
Create the Vector Store first.
Go to Settings → Vector Store → + New store, give it a name and your API key, then paste or upload your content on its Ingest tab. For a quick test, use our sample FAQ for a fictional coffee company (PDF).
Step-by-step guide: Create a Vector Store for your chatbot.
- Marker 1: Click + Add Tool.
- Marker 2: Choose From Vector Store. The other options connect apps, other flows, MCP servers or any HTTP API.
- Marker 1: Tick your store. Each store becomes a search tool named
query_plus the store name. A store that's already attached shows ADDED. - Marker 2: Click Add tools.
- Marker 1: Open the tool and click Edit. The Name and Description are all the AI reads to decide when to search, so describe what the store contains.
- Marker 2: Default topK: how many passages each search returns. 5 is a good start.
- Marker 3: Optional. Min score: passages below it never reach the AI. You can leave it empty; around 0.5 removes weak matches.
Optional: let the bot email your support team (Gmail AI Toolkit)
When the bot can't solve a problem, it can hand the conversation to a person. With a Gmail AI Toolkit node attached, the bot can email your support inbox with the customer's email address and a summary of the chat, so your team can continue by email.
You need a Gmail action node in AI toolkit mode first.
On the canvas, add a Gmail action node in the same workspace as your chatbot. Connect the Google account that should send the emails, and set Mode to AI toolkit. The AI node can only use toolkit nodes that already exist in its own workspace.
The screens below look different. Once a workspace has more than one action, nodes open in a full-screen editor instead of the setup window. The settings are the same.
- Marker 1: The Google account the emails are sent from.
- Marker 2: Mode: AI toolkit. The AI node decides when to use it.
- Marker 3: The node offers 16 Gmail tools to the AI node.
Now attach the toolkit to the AI node. Open the AI node, go to the Tools tab and:
- Marker 1: Click + Add Tool.
- Marker 2: Choose From Workspace.
- Marker 1: Click your Gmail node (marked AI TOOLKIT · PICK OPS).
Give the bot only the Send message operation.
Your chatbot is public. If this AI node could read, list or delete emails, any visitor could ask it to show what's in your inbox. Choose the operations here, per AI node: you don't need to block anything on the Gmail node itself, so other flows that use the same toolkit keep all their operations.
- Marker 1: Tick only Send message.
- Marker 2: Leave every other operation unticked, so this bot can't read, list or delete emails.
- Marker 3: Click Add 1 tool.
- Marker 1: The Gmail toolkit now gives the bot one tool:
send_email. - Marker 2: Your FAQ knowledge base stays attached.
Finally, tell the bot when to send the email. Add this to the end of the system prompt on the Config tab, with your own support address:
If the customer is not satisfied with your answers or asks to talk to a person: 1. Ask for their email address if you don't have it yet. 2. Use the send_email tool to send ONE email to support@yourcompany.com with the subject "Chat escalation" and a body that includes the customer's email address, a short summary of their problem, and the conversation so far. 3. Tell the customer that a person will reply by email within one business day. Never send emails to any other address.
- Marker 1: The escalation instructions at the end of the system prompt.
Test it in the preview widget: say you aren't happy with the answer and give an email address. With the Confirm destructive actions guardrail on, the bot asks before sending. Then check your support inbox, and the Security tab, where the call shows as send_email.
What it does: adds ready-made safety rules to the system prompt. A public chatbot should use all of them.
- Marker 1: Click Select all.
- Marker 2: The counter should read 12 / 12.
- Marker 3: Scope rules keep the bot on topic: no trivia, no code, no medical, legal or financial advice.
- Marker 1: Safety: refuses personal data like card numbers, ignores jailbreak attempts and never reveals its instructions.
- Marker 2: Honesty: answers only from tool results, and asks one question when something is unclear.
- Marker 3: Style: short replies, in the same language the visitor writes in.
What it does: lets the bot remember earlier messages, so a follow-up like “Can I pause it instead?” makes sense.
- Marker 1: Turn Memory on. It is off by default.
- Marker 2: Choose Built-in Vector Memory. Nothing to set up.
- Marker 3: Session ID: type
{{payload.sessionId}}so every visitor gets their own memory. Left empty, all visitors would share one memory.
- Marker 1: Keep Recall (read past messages) and Ingest (save new ones) both on.
- Marker 2: Recall Limit 5 and Max Records per Session 100 suit a support chat.
- Marker 3: Ingest Mode: Paired turns saves each question and answer together. It's fast and cheap.
What it does: shows every call the AI made, what it cost, and any errors. Nothing to set here; this is where you look when the chat misbehaves.
- Marker 1: Total cost, tokens used and average response time.
- Marker 2: A red error means the visitor got no answer. Click the row for details.
- Marker 1: The message the visitor sent.
- Marker 2: The exact error from the AI provider. Here, the chosen model couldn't use tools. Switching the credential's model fixed it (see Troubleshooting).
What it does: records every tool the AI used. Nothing to set here either; check it to confirm the bot really searched your knowledge base.
- Marker 1: Each search of the FAQ appears as
query_brightloop_faqwith status ok. - Marker 2: Filter by Errors or Destructive to spot problems or misuse.
What it does: safety switches and fine-tuning for the model.
- Marker 1: Block destructive tool calls: turn it on. The bot then can't delete or overwrite anything on its own.
- Marker 2: Show tool calls in chat (debug): leave it off. When on, visitors can see which tools your bot uses.
- Marker 1: Max Tokens: leave it empty, so long answers aren't cut off.
- Marker 2: Temperature: a low value such as 0.2 keeps answers factual and consistent.
Activate both nodes
Click Activate at the top of the AI node, then reopen the Chat Trigger node and click Activate there too. Both badges should change from Paused to Active. A paused node ignores incoming messages.
- Marker 1: AI node: Active.
- Marker 2: Credential connected.
- Marker 1: Chat Trigger: Active.
- Marker 2: Preview widget opens a test chat (next step).
Test it in the preview
On the Chat Trigger's Configuration tab, click Preview widget. The real widget opens on the right. Send a message and watch the reply stream in.
- Marker 1: The live chat widget, using your title, subtitle and theme.
- Marker 2: Your greeting message.
- Marker 1: Your test message.
- Marker 2: The AI's reply, streamed back from the webhook.
A working preview doesn't prove the shared link works.
The dashboard preview skips the origin check. Always test the shared link too (next step), especially in HMAC signed mode.
Build your own customized chat UI
Optional · AdvancedMost people can stop at step 10. This step is only for developers who want their own chat interface, a mobile app or a backend integration instead of the ready-made widget.
Show how to call the webhook directly
Post to the Ingest endpoint from step 10. Send the visitor's message and a session ID you choose. Reuse the same session ID to continue a conversation.
curl -N -X POST \
https://api.hostwebhook.com/api/chat-triggers/in/YOUR_CHAT_ID/message \
-H "Content-Type: application/json" \
-d '{"message": "What are your opening hours?", "sessionId": "visitor-123"}'The reply streams back as Server-Sent Events:
event: session
data: {"sessionId":"visitor-123","hwsSessionId":"visitor-123"}
event: token
data: {"text":"We're open"}
event: token
data: {"text":" 9am to 5pm."}
event: done
data: {"response":"We're open 9am to 5pm.","conversationId":"…"}Signed trigger? Add the Authorization header described in step 5.
Troubleshooting
| What you see | Cause | Fix |
|---|---|---|
| No reply at all | A node is paused, or the AI node has no credential. | Check that both nodes show Active and that the Credential box is green (steps 7–8). |
| Logs show “Function tools … are not supported” | The credential's model can't use tools such as a Vector Store. | Pick another model on the credential in Settings → Credentials (for example gpt-5.5), then test again. |
| “Not saved” | An empty greeting row. | Fill it in or click Remove. |
| 429 Too many messages | The rate limit was reached. | Wait for the Retry-After time, or raise Messages per minute (step 4). |
| 401 Invalid or missing signature | Signed trigger without a valid HMAC. | Sign sessionId:ts with the trigger secret; sign the session ID you send. |
| 403 on the shared link | Signed mode with an empty or incomplete Allowed origins list. | Add your site and the Share URL's origin to Allowed origins (step 5). |
| Chat stops for a visitor | A usage cap was reached. | Raise or clear the cap under Usage caps. Daily caps reset at UTC midnight. |