Onboarding has five steps, listed in ob_steps (step_no, step_name): 1 signed_up, 2 email_verified, 3 profile_completed, 4 first_project, 5 invited_teammate.
ob_users (user_id, signed_up_at) lists every user; signing up is step 1, so every user has reached it. ob_events (event_id, user_id, step_name, event_at) logs steps 2–5. Users can repeat a step, skip one, or do them out of order.
A user reaches the steps in order:
- •step 2 at their first
email_verified event after signed_up_at; - •step 3, 4 and 5 each at the user's first event of that step that is later than the moment they reached the step before.
An event that comes before the previous step was reached doesn't count (a later repeat of it can). A user's furthest step is the highest step reached this way.
For each step, return reached (users whose furthest step is this step or beyond) and stopped_here (users whose furthest step is exactly this one; for step 5 that's everyone who reached it).
Columns: step_no, step_name, reached, stopped_here. Sort by step_no.