> ## Documentation Index
> Fetch the complete documentation index at: https://help.treble.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# fact_treble_session_nodes

> The node-by-node journey of every conversation through its flow.

# fact\_treble\_session\_nodes

Each row is one **interactive step** of one conversation through its flow: a question asked, an AI step, a WhatsApp Flow, an integration call — with the option the user chose or the free text they typed, and whether they timed out instead of answering. This is the table for **funnels** — it did not exist in the previous warehouse.

<Note>
  Steps that only send a message and move on (no interaction) don't generate a row here — the full message stream, including those, is in [`fact_treble_session_messages`](/en/docs/data-warehouse-v2/fact-treble-session-messages). The complete structure of every flow, all nodes included, is in [`dim_poll_nodes`](/en/docs/data-warehouse-v2/dimensions#dim_poll_nodes).
</Note>

## What questions does it answer?

* What is the step-by-step funnel of a flow — how many users reach each node, and where do they drop off?
* Which answer options do users choose at each question?
* Which questions time out most often?
* Which conversations went through AI nodes (join with `dim_poll_nodes.node_type`)?
* How long do users take to answer each question?

## Columns

| Column               | Type       | Description                                                                                                                                                                                         |
| -------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `node_record_id`     | Int64      | Unique identifier of this node visit                                                                                                                                                                |
| `company_id`         | Int32      | Your company (filtered automatically)                                                                                                                                                               |
| `session_id`         | Int64      | The conversation flow this visit belongs to                                                                                                                                                         |
| `poll_id`            | Int32      | Flow identifier                                                                                                                                                                                     |
| `poll_name`          | String     | Flow name                                                                                                                                                                                           |
| `cellphone`          | String     | User's phone number                                                                                                                                                                                 |
| `treble_id`          | String     | Contact identity (country code + cellphone)                                                                                                                                                         |
| `node_id`            | Int32      | The flow node visited (join with `dim_poll_nodes`)                                                                                                                                                  |
| `node_type`          | String     | Step type: `QUESTION`, `AI_TASK_AUTOMATOR`, `AI_AGENT`, `AI_LEAD_QUALIFICATION`, `AI_OBJECTIVE_AGENT`, `WHATSAPP_FLOW`, `META_EVENTS`, `HELPDESK_INTEGRATION`; empty when the node no longer exists |
| `hsm_id`             | Int32      | HSM template sent at this step, if any; `0` otherwise                                                                                                                                               |
| `answer_option_id`   | Int32      | The predefined option the user's reply matched; `0` for open answers                                                                                                                                |
| `answer_option_text` | String     | Label of that predefined option                                                                                                                                                                     |
| `response_text`      | String     | The user's actual reply text                                                                                                                                                                        |
| `is_timeout`         | Bool       | `true` if the user never answered and the step timed out                                                                                                                                            |
| `entered_at`         | DateTime64 | When this step was sent to the user                                                                                                                                                                 |
| `responded_at`       | DateTime64 | When the user answered; `NULL` if they didn't                                                                                                                                                       |
| `question_msg_id`    | Int64      | The message that carried the question (`fact_treble_session_messages.message_id`)                                                                                                                   |
| `synced_at`          | DateTime64 | When this row was last written/corrected                                                                                                                                                            |

## Example queries

### Funnel of a flow — reach per node

```sql theme={null}
SELECT
    node_id,
    any(node_type)            AS node_type,
    uniqExact(session_id)     AS conversations_reached,
    countIf(is_timeout)       AS timeouts
FROM fact_treble_session_nodes
WHERE poll_id = {your_poll_id}
  AND entered_at >= today() - 30
GROUP BY node_id
ORDER BY conversations_reached DESC
```

### Answer distribution of one question

```sql theme={null}
SELECT answer_option_text, count() AS answers
FROM fact_treble_session_nodes
WHERE node_id = {your_node_id}
  AND entered_at >= today() - 30
  AND responded_at IS NOT NULL
GROUP BY answer_option_text
ORDER BY answers DESC
```

### Conversations that used AI

```sql theme={null}
SELECT uniqExact(session_id) AS ai_conversations
FROM fact_treble_session_nodes
WHERE node_type LIKE 'AI_%'
  AND entered_at >= today() - 7
```
