Companion funnel
1. Dataset Name
companion_funnel
2. Description
A stage-level funnel dataset that tracks each AI Companion session's progress through four milestones: Scheduled to Join, Joined, Recorded, and Feedback Generated. Each row represents one companion session at one stage it reached, including the stage timestamp, the next stage reached, and the time spent at the current stage. A session only appears at a stage once all prior stages have been reached. This dataset powers the AI Companion Funnel visualization, showing where sessions progress, stall, or drop off.
3. Source Tables
- customer_views.companion_session (sole source table — all four stages sourced from different column conditions on the same table)
4. Grain
One row per companion_session_id per funnel stage reached. A session that progressed through all four stages will have four rows. The LEAD/LAG window functions provide next-stage context on each row so the full transition path is visible without self-joining.
5. Dashboards Supported
- AI Companion Dashboard
6. Metrics Supported
| Metric | Supported Breakdowns |
| AI Companion Funnel | No drilldowns |
7. Known Exclusions / Filters Applied
- Stage 1 (Scheduled to Join): latest_bot_status IS NOT NULL AND latest_bot_status != 'deleted' AND companion_scheduled_to_join_at IS NOT NULL — sessions with a deleted bot status are excluded entirely.
- Stage 2 (Joined): was_companion_dispatched_to_join = TRUE.
- Stage 3 (Recorded): has_companion_recorded = TRUE.
- Stage 4 (Feedback Generated): status = 'feedback_generated'.
- Sequential gate rule: a row is only included in the final output when stage_group_index = 1 (the first stage) OR prev_stage_group_index = stage_group_index - 1, ensuring strict step-by-step progression — a session cannot appear at Recorded without first appearing at Joined.
- scheduled_at is computed as MAX(stage_ts WHERE event_name = 'companion_scheduled') windowed per companion_session_id, so every stage row for a given session carries the same scheduled timestamp.
8. Schema
| Column Name | Data Type | Notes |
| companion_session_id | bigint | Unique companion session identifier; sourced from companion_session.id |
| event_name | varchar | Raw event driving the stage: companion_scheduled, companion_joined, companion_recorded, companion_feedback_generated |
| stage_name | varchar | Display label: Scheduled to Join (1), Joined (2), Recorded (3), Feedback Generated (4) |
| stage_ts | datetime | Timestamp of the stage event, sourced from companion_session column per stage (companion_scheduled_to_join_at, updated_at, updated_at, updated_at) |
| scheduled_at | datetime | Derived: MAX(stage_ts) WHERE event_name = 'companion_scheduled', windowed per companion_session_id. Carries the scheduled timestamp on every stage row. |
| next_stage_name | varchar | Derived: LEAD(stage_display_name) windowed per companion_session_id ordered by stage_group_index |
| next_stage_ts | datetime | Derived: LEAD(stage_ts) windowed per companion_session_id ordered by stage_group_index |
| minutes_in_stage | bigint | Derived: TIMESTAMPDIFF(MINUTE, stage_ts, next_stage_ts) — time in the current stage before advancing. NULL for the last stage reached. |
| stage_group_index | bigint | Numeric funnel sequence: 1 = Scheduled to Join, 2 = Joined, 3 = Recorded, 4 = Feedback Generated |