Amba
Platform

Onboarding Flows

Define step-by-step onboarding experiences for new users.

Onboarding flows define step-by-step experiences for new users. Track completion rates and optimize your first-time user experience.

How it works

  1. Admin creates an onboarding flow with ordered steps
  2. The SDK fetches the active flow and the user's current position
  3. As users advance through steps, progress is tracked automatically
  4. Analytics show start, completion, and skip rates per flow

MCP tools

ToolDescription
amba_onboarding_createCreate an onboarding flow with steps
amba_onboarding_get_statsGet completion statistics

Example

Agent: "Create a welcome onboarding flow"

amba_onboarding_create({
  project_id: "proj_xxx",
  name: "Welcome Flow",
  steps: [
    { id: "welcome",       title: "Welcome",      description: "Welcome to the app!",           type: "welcome" },
    { id: "notifications", title: "Stay Updated",  description: "Enable push notifications",     type: "permission", config: { permission: "push" } },
    { id: "personalize",   title: "Personalize",   description: "Tell us about yourself",        type: "personalization" },
    { id: "tour",          title: "Quick Tour",    description: "See what you can do",           type: "feature_tour" }
  ]
})

SDK usage

The SDK talks to the active flow without requiring a flow ID. Amba resolves the primary flow automatically — the oldest active flow for the project.

const amba = new Amba(config);
 
// Get current status (pre-start, in-progress, or completed)
const status = await amba.onboarding.getStatus();
// {
//   flow_id: "...",
//   flow_name: "Welcome Flow",
//   current_step: "welcome",
//   completed_steps: [],
//   remaining_steps: ["welcome", "notifications", "personalize", "tour"],
//   completed: false,
//   status: "not_started"
// }
 
// Advance to the next step (auto-starts if not yet started)
// Optionally pass answers collected during the current step.
const next = await amba.onboarding.nextStep({ answers: { name: 'Alex' } });
 
// Skip the flow entirely
await amba.onboarding.skipStep();
 
// Mark the flow complete (optionally with a final payload)
await amba.onboarding.complete({ final_answers: { agreed_to_terms: true } });

nextStep() is safe to call before the user has explicitly started the flow — it creates the progress row and advances past the first step in one call. Calling it again after the flow is already completed is idempotent and returns the current status unchanged.

Client API reference

These are the paths the SDK calls. You only need them if you are building a custom integration or calling the API directly.

MethodPathDescription
GET/client/onboarding/statusGet status for the primary active flow
POST/client/onboarding/nextAdvance to the next step; body: { answers?: object }
POST/client/onboarding/skipSkip the flow
POST/client/onboarding/completeMark complete; body: { final_answers?: object }

Status shape

{
  "data": {
    "flow_id": "uuid",
    "flow_name": "Welcome Flow",
    "current_step": "notifications",
    "completed_steps": ["welcome"],
    "remaining_steps": ["notifications", "personalize", "tour"],
    "completed": false,
    "completed_at": null,
    "status": "in_progress"
  }
}

status is one of not_started, in_progress, completed, or skipped.

Error codes

CodeStatusMeaning
NO_ACTIVE_ONBOARDING_FLOW404No active flow configured for this project
NOT_STARTED404User has not started the flow (skip / complete)
FLOW_SKIPPED409Flow was skipped; cannot advance
INVALID_ANSWERS400answers or final_answers is not a plain object

Advanced — multiple flows

If your project has more than one active flow, the SDK always resolves the oldest active flow (by creation date) as the primary. To work with a specific flow, use the explicit flow ID routes:

MethodPathDescription
POST/client/onboarding/:flowId/startStart a specific flow
POST/client/onboarding/:flowId/advanceAdvance within a specific flow
POST/client/onboarding/:flowId/skipSkip a specific flow
POST/client/onboarding/:flowId/completeComplete a specific flow

On this page