> ## 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.

# Variable Assigner

> Manage persistent conversation variables in chatflow applications

The Variable Assigner node manages persistent data in chatflow applications by writing to conversation variables (Understand the different types of variables [here](/en/use-dify/getting-started/key-concepts#variables)). Unlike regular workflow variables that reset with each execution, conversation variables persist throughout an entire chat session.

<Frame caption="Variable Assigner Node Configuration">
  ![Variable Assigner Node Configuration](https://assets-docs.dify.ai/2024/11/83d0b9ef4c1fad947b124398d472d656.png)
</Frame>

## Conversation Variables vs Workflow Variables

**Workflow Variables** exist only during a single workflow execution and reset when the workflow completes.

**Conversation Variables** persist across multiple conversation turns within the same chat session, enabling stateful interactions and contextual memory.

This persistence enables contextual conversations, user personalization, stateful workflows, and progress tracking across multiple user interactions.

## Configuration

Configure which conversation variables to update and specify their source data. You can assign multiple variables in a single node.

<Frame caption="Variable Assignment Configuration Interface">
  ![Variable Assignment Configuration Interface](https://assets-docs.dify.ai/2024/11/ee15dee864107ba5a93b459ebdfc32cf.png)
</Frame>

**Variable** - Select the conversation variable to write to

**Set Variable** - Choose the source data from upstream workflow nodes

**Operation Mode** - Determine how to update the variable (overwrite, append, clear, etc.)

## Operation Modes

Different variable types support different operations based on their data structure:

<Tabs>
  <Tab title="String">
    * **Overwrite** - Replace with another string variable

    * **Clear** - Remove the current value

    * **Set** - Manually assign a fixed value
  </Tab>

  <Tab title="Number">
    * **Overwrite** - Replace with another number variable

    * **Clear** - Remove the current value

    * **Set** - Manually assign a fixed value

    * **Arithmetic** - Add, subtract, multiply, or divide the current value by another number
  </Tab>

  <Tab title="Boolean">
    * **Overwrite** - Replace with another boolean variable

    * **Clear** - Remove the current value

    * **Set** - Manually assign a fixed value
  </Tab>

  <Tab title="Object">
    * **Overwrite** - Replace with another object variable

    * **Clear** - Remove the current value

    * **Set** - Manually define the object structure and values
  </Tab>

  <Tab title="Array">
    * **Overwrite** - Replace with another array variable of the same type

    * **Clear** - Remove all elements from the array

    * **Append** - Add a single element to the end of the array

    * **Extend** - Add all elements from another array of the same type

    * **Remove First/Last** - Remove the first or last element from the array

    <Tip>
      Array operations are particularly powerful for building memory systems, checklists, and conversation histories that grow over time.
    </Tip>
  </Tab>
</Tabs>

## Common Implementation Patterns

### Smart Memory System

Build chatbots that automatically detect and store important information from conversations:

<Frame caption="Smart Memory System Workflow">
  ![Smart Memory System Workflow](https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/node/8d0492814b1515f50e87b2900ff400db.png)
</Frame>

The system analyzes user input for memorable facts, extracts structured information, and appends it to a persistent memories array for future reference in conversations.

### User Preferences Storage

Store user preferences like language settings, notification preferences, or display options:

<Frame caption="User Preferences Management">
  ![User Preferences Management](https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/node/1867d608a7d009431b73377ed65b427b.png)
</Frame>

Use **Overwrite** mode to capture initial preferences from user input, then reference them in all subsequent LLM responses for personalized interactions.

### Progressive Checklists

Build guided workflows that track completion status across multiple conversation turns:

<Frame caption="Progressive Checklist Implementation">
  ![Progressive Checklist Implementation](https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/node/c4362b01298b12e7d6fcd9e798f3165a.png)
</Frame>

Use array conversation variables to track completed items. The Variable Assigner updates the checklist each turn, while the LLM references it to guide users through remaining tasks.
