Create an onboarding session and dispatch the Trigger.dev task that crawls the user’s company website and populates company, market, and ICP context.
onboarding_sessions row and kicks off the onboarding-scrape Trigger.dev task. The task:
website and crawls up to 10 pages with Firecrawlcompany_context, market_context, and an Ideal Customer Profileuser_profiles row and flips the session status to completedsessionId and runId. Actual context population is asynchronous — poll GET /api/onboarding/status until status === "completed".
GET /api/onboarding/status should already return completed.The one legitimate agent use case is re-bootstrapping a workspace that has session: null — and even then, only after the human has explicitly asked the agent to run onboarding on their behalf. If you see session: null, the safer default is to stop and escalate. Do not guess a website URL.If the agent wants to refresh context on an already-onboarded workspace (e.g. company rebranded, URL changed), use regenerate-context instead — it is rate-limited and safer.Polling cadence after dispatch: every 3 to 5 seconds against GET /api/onboarding/status?sessionId=.... Typical completion: 30 to 90 seconds. On status === "failed", report errorMessage and errorStep to the human; do not retry.Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Minimum required input is a website URL. Everything else is optional and falls back to auth session values.
Company website URL. Required. The scrape task Firecrawl-crawls up to 10 pages of this domain to build company_context, market_context, and the ICP.
1Email of the person signing up. Defaults to the authenticated user's email when omitted. Used to seed first_name when firstName isn't provided.
^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$First name for the user_profile row. If omitted, derived from the email local-part (e.g. [email protected] → sid).
Last name for the user_profile row. Optional.
Session created and background task dispatched. Poll the status endpoint.
Dispatched. Session is pending; a Trigger.dev task will transition it through looking_up → gathering_info → generating_context → completed (or failed).
ID of the newly-created onboarding session. Pass this to GET /api/onboarding/status?sessionId=... to poll the scrape progress.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Trigger.dev run identifier for the background onboarding-scrape task. Keep for support — uniquely identifies this scrape across Vercel logs and the Trigger dashboard.