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

# Overview

In Voiceflow, a dialog state is assigned to a unique `userID`.
This `userID` can be any string and is typically something unique that easily references the person on the session - such as an username, email, device ID, or phone number. (e.g. `user54646`, `user@gmail.com`, `1-647-424-4242`, etc.).
If you're not sure what to call it just for testing purposes, you can just pick a random `userID`.

The response schema consists of two main properties:

1. Stack
2. Variables

We will cover each property below, as well as an overview of the Voiceflow context model.

## Stack

The stack is an array of flows that are currently active in the conversation. Each flow contains:

* `programID`: the ID of the flow, which can be found in the URL of the address bar `https://creator.voiceflow.com/project/{versionID}/canvas/{programID}`
* `nodeID`: current block this flow is on
* `variables`: flow-scoped variables
* `storage`: internal flow parameters for runtime
* `commands`

In the example below, you can see that there are three flows available on the stack (`620e669eac2f70001cf9d85a`, `620e669eac2f70001cf9d85b` and `620e669eac2f70001cf9d85c`) and we are currently sitting on flow `620e669eac2f70001cf9d85c`, as denoted by the `nodeID` pointing to a block within this flow.

Note: the `programID` of the first flow in the stack is always the `versionID` of the Agent.

Example stack:

```json theme={null}
{
  "stack": [
    {
      "nodeID": null,
      "programID": "620e669eac2f70001cf9d85a", //<-- versionID of the agent
      "storage": {},
      "commands": [],
      "variables": {}
    },
    {
      "nodeID": null,
      "programID": "620e669eac2f70001cf9d85b", //<-- starting flow
      "storage": {
          "output": [
              {
                  "children": [
                      {
                          "text": "What size?"
                      }
                  ]
              }
          ]
      },
      "commands": [],
      "variables": {}
    },
    {
      "nodeID": "61f40992f0e4e70a1f2328d1",
      "programID": "620e669eac2f70001cf9d85c",//<-- top-level flow
      "storage": {
          "outputMap": null,
          "output": [
              {
                  "children": [
                      {
                          "text": "You can get an additional pizza for half the price today. Would you like to do that?"
                      }
                  ]
              }
          ]
      },
      "commands": [],
      "variables": {
            "discount_code": "DEAL4TWO"
      }
    }
  ]
}
```

## Variables

The two ways you can create variable keys in your Interaction Model is through:

1. Entities
2. Variables

The difference between Entities and Variables is how they are assigned values at runtime.
An entity value is assigned through a user interaction (e.g. utterance) whereas a variable is dynamically assigned a value from the design itself based on a user action (e.g. through an API call or custom code).

Variable examples

```json theme={null}
{
  "variables": {
    "type": "pepperoni",
    "size": "large",
    "amount": 6,
    "sessions": 0,
    "user_id": "1234",
    "timestamp": 1645112935,
    "platform": 0,
    "locale": 0,
    "side": 0,
    "intent_confidence": 100,
    "last_utterance": "large"
  }
}
```

## Voiceflow Context Model

In this video, we'll explain Voiceflow's entire Context Model in more detail.

<iframe id="player" frameborder="0" allowfullscreen="" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" title="Voiceflow Context Model - Intents, Commands, and Flows" width="640" height="360" src="https://www.youtube.com/embed/IUp1Kz-2xVY?wmode=opaque&widget_referrer=https%3A%2F%2Fdocs.voiceflow.com%2F&enablejsapi=1&origin=https%3A%2F%2Fcdn.embedly.com&widgetid=1&forigin=https%3A%2F%2Fcdn.embedly.com%2Fwidgets%2Fmedia.html%3Fsrc%3Dhttps%253A%252F%252Fwww.youtube.com%252Fembed%252FIUp1Kz-2xVY%253Ffeature%253Doembed%26display_name%3DYouTube%26url%3Dhttps%253A%252F%252Fwww.youtube.com%252Fwatch%253Fv%253DIUp1Kz-2xVY%26image%3Dhttps%253A%252F%252Fi.ytimg.com%252Fvi%252FIUp1Kz-2xVY%252Fhqdefault.jpg%26key%3Df2aa6fc3595946d0afc3d76cbbd25dc3%26type%3Dtext%252Fhtml%26schema%3Dyoutube&aoriginsup=1&aorigins=https%3A%2F%2Fdocs.voiceflow.com&gporigin=https%3A%2F%2Fdocs.voiceflow.com%2F&vf=6" data-dashlane-frameid="1024" />
