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

# Key Concepts

> Quick overview of essential Dify concepts

## Dify App

Dify is made for agentic app building. In **Studio**, you can quickly build agentic workflows via a drag & drop interface and publish them as apps. You can access published apps via API, the web, or as an [MCP server](https://docs.dify.ai/en/cloud/use-dify/publish/publish-mcp.md). Dify offers two main app types: Workflow and Chatflow. You will need to choose an app type when creating a new app.

> [!NOTE]
>
> We recommend choosing Workflow or Chatflow your app type. But in addition to these, Dify also offers 3 more basic app types: Chatbot, Agent, and Text Generator.
>
> ![App Type Selector](https://mintcdn.com/dify-6c0370d8/Z6MqdkI3dck9_1H6/images/use-dify/get-started/app-type-selector.png?fit=max\&auto=format\&n=Z6MqdkI3dck9_1H6\&q=85\&s=e7af94989732d91e398c1fdebff70a9b)
>
> These app types run on the same workflow engine underneath, but comes with simpler legacy interfaces:
>
> ![Chatbot Interface](https://mintcdn.com/dify-6c0370d8/Z6MqdkI3dck9_1H6/images/use-dify/get-started/chatbot-interface.png?fit=max\&auto=format\&n=Z6MqdkI3dck9_1H6\&q=85\&s=f26c014de4497ae56252de0dccacef9f)

## Workflow

Build Workflow apps to handle single-turn tasks. The webapp interface and API provides easy access to batch execute many tasks at once.

> [!NOTE]
>
> Underneath it all, workflow forms the basis for all other app types in Dify.

Every workflow begins with a [start node](https://docs.dify.ai/en/cloud/use-dify/nodes/start): either User Input (on-demand, triggered by a user or API call) or a Trigger (automatic, on a schedule or in response to external events).

## Chatflow

Chatflow is a special type of workflow app that gets triggered at every turn of a conversation. Other than workflow features, Chatflow comes with the ability to store and update custom conversation-specific variables, enable memory in LLM nodes, and stream formatted text, images, and files at different points throughout the Chatflow run.

Chatflows always start with User Input.

## Dify DSL

Dify DSL (Domain-Specific Language) is the YAML format Dify uses to describe an app. It covers how the app is built and configured, from its nodes and prompts to its variables and settings, but not data such as its logs or knowledge bases.

Exporting an app writes its DSL, and importing it builds the app again. That's how apps are shared, published as templates, and moved between workspaces or Dify instances.

In Dify 1.18.0 and later, exporting an app gives you an *app package* (`.ifpkg`), which holds the DSL file together with the files the app needs, such as uploaded icons and the skills and files of [Agents](https://docs.dify.ai/en/cloud/use-dify/build/new-agent/overview.md). Earlier versions export the DSL file (`.yml`) on its own.

## Variables

A variable is a labeled container to store information, so you can find and use that information later by referencing its name. You'll come across different types of variables when building a Dify app.

### Inputs

You can specify any number of input variables at the [User Input](https://docs.dify.ai/en/cloud/use-dify/nodes/user-input.md) node for your app's end users to fill in.

![User Input Node Variables](https://mintcdn.com/dify-6c0370d8/Z6MqdkI3dck9_1H6/images/use-dify/get-started/user-input-node-variables.png?fit=max\&auto=format\&n=Z6MqdkI3dck9_1H6\&q=85\&s=3c3c6bbb49310f2e9bbf64a2c7d2c49c)

Additionally, the User Input node comes with a set of input variables that you can reference later in the flow. Depending on the app type (Workflow or Chatflow), different variables are provided.

> [tab] Workflow
>
> | Variable Name | Data Type | Description | Notes |
> | :- | :- | :- | :- |
> | `sys.user_id` | String | User ID: A unique identifier automatically assigned by the system to each user when they use a Workflow application. It is used to distinguish different users. | |
> | `sys.app_id` | String | App ID: A unique identifier automatically assigned by the system to each App. This parameter is used to record the basic information of the current application. | This parameter is used to differentiate and locate distinct Workflow applications for users with development capabilities. |
> | `sys.workflow_id` | String | Workflow ID: This parameter records information about all nodes information in the current Workflow application. | This parameter can be used by users with development capabilities to track and record information about the nodes contained within a workflow. |
> | `sys.workflow_run_id` | String | Workflow Run ID: Used to record the runtime status and execution logs of a Workflow application. | This parameter can be used by users with development capabilities to track the application's historical execution records. |
> | `sys.timestamp` | Number | The start time of each workflow execution. | |

> [tab] Chatflow
>
> | Variable Name | Data Type | Description | Notes |
> | :- | :- | :- | :- |
> | `sys.conversation_id` | String | A unique ID for the chatting box interaction session, grouping all related messages into the same conversation, ensuring that the LLM continues the chatting on the same topic and context. | |
> | `sys.dialogue_count` | Number | The number of conversations turns during the user's interaction with a Chatflow application. The count automatically increases by one after each chat round and can be combined with if-else nodes to create rich branching logic. For example, LLM will review the conversation history at the X conversation turn and automatically provide an analysis. | |
> | `sys.user_id` | String | A unique ID is assigned for each application user to distinguish different conversation users. | The Service API does not share conversations created by the web app. This means users with the same ID will have separate conversation histories between API and web app interfaces. |
> | `sys.app_id` | String | App ID: A unique identifier automatically assigned by the system to each App. This parameter is used to record the basic information of the current application. | This parameter is used to differentiate and locate distinct applications for users with development capabilities. |
> | `sys.workflow_id` | String | Workflow ID: This parameter records information about all nodes information in the current application. | This parameter can be used by users with development capabilities to track and record information about the nodes contained within a workflow. |
> | `sys.workflow_run_id` | String | Workflow Run ID: Used to record the runtime status and execution logs of an application. | This parameter can be used by users with development capabilities to track the application's historical execution records. |

User inputs are set at the start of each workflow run and cannot be updated.

### Outputs

Each node produces one or more outputs that can be referenced in subsequent nodes. For instance, the LLM node has outputs:

![LLM Node Output Variables](https://mintcdn.com/dify-6c0370d8/Z6MqdkI3dck9_1H6/images/use-dify/get-started/llm-node-output-variables.png?fit=max\&auto=format\&n=Z6MqdkI3dck9_1H6\&q=85\&s=fb72c1dad8930b365a424b743ce673b6)

Like inputs, node outputs cannot be updated either.

### Environment Variables

The environment variables you add while building a Workflow or Chatflow hold values for the whole app.

Use one for a value that several nodes share, or that should differ between copies of the app, such as the API endpoint of a test or production system. For secrets like API keys, use the Secret type: their values stay out of an export unless you choose to include them.

### Conversation Variables

Conversation variables exist in Chatflow only. They keep their values across the turns of one conversation, so you can store information that changes as it goes, like a to-do list or token cost. You can update the value of a conversation variable via the [Variable Assigner](https://docs.dify.ai/en/cloud/use-dify/nodes/variable-assigner.md) node:

![Conversation Variables Panel](https://mintcdn.com/dify-6c0370d8/Z6MqdkI3dck9_1H6/images/use-dify/get-started/conversation-variables-panel.png?fit=max\&auto=format\&n=Z6MqdkI3dck9_1H6\&q=85\&s=c8d4d02401c33c486ad491a5175612e7)

### Variable Referencing

You can easily pass variables to any node when configuring its input field by selecting from a dropdown:

![Variable Picker Dropdown](https://mintcdn.com/dify-6c0370d8/Z6MqdkI3dck9_1H6/images/use-dify/get-started/variable-picker-dropdown.png?fit=max\&auto=format\&n=Z6MqdkI3dck9_1H6\&q=85\&s=4ea771de8f9ec2b40dfe027e8bc22a5c)

You can also insert variable values into complex text inputs by typing `/` slash, and selecting the desired variable from the dropdown.

![Variable Slash Insert](https://mintcdn.com/dify-6c0370d8/Z6MqdkI3dck9_1H6/images/use-dify/get-started/variable-slash-insert.png?fit=max\&auto=format\&n=Z6MqdkI3dck9_1H6\&q=85\&s=62daf956fcf2ba7234c1b047c249da87)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.