Claude API Customer Onboarding Chatbot Example
What an onboarding chatbot needs to do differently
A customer onboarding chatbot has a narrower job than a general support bot: get a new user from signup to their first successful outcome as fast as possible. That means asking qualifying questions, explaining the product in context, calling tools to check account state (plan, integrations, completed steps), and nudging the user toward specific next actions instead of just answering open-ended questions.
This article walks through a concrete Claude API customer onboarding chatbot example you can adapt: a system prompt tuned for onboarding, a tool the model can call to check onboarding progress, and a minimal backend using Claude's Messages API. If you're building this on top of your existing Claude access, you can route the whole thing through a SubToAPI key instead of managing raw Anthropic billing — the integration code below works either way, you just swap the base URL and key.
Designing the onboarding flow
Before writing code, define the onboarding states explicitly. A chatbot without a clear state model will ramble; one with a state model feels like a guided tour.
A typical SaaS onboarding has steps like:
- Account created, no plan selected
- Plan selected, no integration connected
- Integration connected, no first project created
- First project created — onboarding complete
The chatbot's job is to detect which step the user is on, explain that step, and confirm completion before moving to the next one. This is where tool use matters: the model shouldn't guess the user's state from the conversation alone — it should call a function that returns real account data.
System prompt for an onboarding bot
You are the onboarding assistant for [Product]. Your only goal is to help
the user complete setup. Always check their current onboarding step using
the get_onboarding_status tool before giving instructions — never assume.
Rules:
- Keep responses under 4 sentences unless the user asks for detail.
- After explaining a step, ask a direct yes/no question to confirm they
completed it before suggesting the next step.
- If the user seems stuck, offer to show a concrete example instead of
re-explaining the same text.
- Never discuss billing, refunds, or cancellations — direct those to
support@[product].com.
- If the user has completed all steps, congratulate them briefly and stop
giving onboarding instructions.
Scoping the prompt this tightly matters more for onboarding than for general support, because an onboarding bot that wanders into unrelated product questions wastes the narrow window you have before a new user gets bored and churns.
Defining the onboarding status tool
Claude's tool use lets the model call a function mid-conversation and use the result to decide what to say next. For onboarding, the tool is almost always a read from your own user/account database.
{
"name": "get_onboarding_status",
"description": "Returns the current onboarding step and completed steps for a user account.",
"input_schema": {
"type": "object",
"properties": {
"user_id": {
"type": "string",
"description": "Internal user ID from the session"
}
},
"required": ["user_id"]
}
}
Your backend resolves this call against your actual database and returns something like:
{
"current_step": "integration_pending",
"completed_steps": ["account_created", "plan_selected"],
"plan": "Team"
}
See /docs/tools for the full tool-calling contract if you haven't wired one up before.
Minimal backend example
Here's a stripped-down Node.js handler that ties the system prompt, tool definition, and tool execution together using the SubToAPI endpoint, which mirrors Claude's Messages API shape:
const ONBOARDING_TOOL = {
name: "get_onboarding_status",
description: "Returns the current onboarding step for a user account.",
input_schema: {
type: "object",
properties: { user_id: { type: "string" } },
required: ["user_id"]
}
};
async function callClaude(messages) {
const res = await fetch("https://api.subtoapi.app/v1/messages", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.SUBTOAPI_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "claude-sonnet-4-5",
max_tokens: 400,
system: ONBOARDING_SYSTEM_PROMPT,
tools: [ONBOARDING_TOOL],
messages
})
});
return res.json();
}
async function handleOnboardingMessage(userId, userText, history) {
const messages = [...history, { role: "user", content: userText }];
let response = await callClaude(messages);
// Handle a tool call if Claude asked for one
const toolUse = response.content?.find(c => c.type === "tool_use");
if (toolUse) {
const status = await lookupOnboardingStatus(userId); // your DB query
messages.push({ role: "assistant", content: response.content });
messages.push({
role: "user",
content: [{
type: "tool_result",
tool_use_id: toolUse.id,
content: JSON.stringify(status)
}]
});
response = await callClaude(messages);
}
return response.content.find(c => c.type === "text")?.text;
}
This pattern — check status, explain, confirm, advance — is the core loop for almost any onboarding bot regardless of what you're onboarding users into. Swap get_onboarding_status for get_integration_health, get_profile_completeness, or whatever maps to your product's real setup steps.
Streaming the first response
New users are impatient. Streaming the model's reply instead of waiting for the full response makes the first interaction feel instant, which matters more during onboarding than almost anywhere else in your product. See /docs/streaming for the server-sent events format; the same tool-call loop above works with streaming responses, you just accumulate text chunks before checking for a tool_use block.
Getting this running quickly
If you already have Claude access through your organization but don't want to build API key management, rate limiting, and usage dashboards from scratch just to ship an onboarding bot, SubToAPI gives you a sub_live_... key, request logging, and per-key usage metadata out of the box. The Messages API shape is the same as above — see /docs/messages for the full request/response reference, or /docs/quickstart to get a key running in a few minutes. Plans start at Solo (€9) for solo builders, with Team (€19/seat) and Scale (€49/seat) for shared dashboards and higher limits; every plan starts with a free trial at /signup.
FAQ
Does the onboarding bot need tool use, or can it just follow a script? A scripted flow works for very simple onboarding, but tool use lets the bot check real account state instead of relying on what the user claims. This avoids the bot telling an already-connected user to "connect your integration" because it lost track of context.
Should the onboarding bot and the support bot be the same assistant? Keep them separate, even if they share infrastructure. Onboarding prompts are intentionally narrow and directive; support prompts need to handle a much wider range of questions. Mixing them makes both worse.
How do I stop the bot from giving outdated product instructions? Keep step descriptions and UI references in a small config object outside the system prompt, and have your tool results include links or labels the model quotes rather than generates from memory. Update that config when your product UI changes instead of editing the prompt text itself.