﻿# Flowise Flow State, configured variables and conversation memory have different scopes

Separate Flowise execution-local Flow State from configured static or environment variables and session conversation history when passing results between nodes.

Author: Retrivium editorial team
Updated: 2026-11-03
Canonical URL: https://retrivium.ai/journal/guide-flowise-flow-state-variable-scopes/
Language: en

## Choose the lifetime the value needs

A workflow extracts a document category and uses it in a later branch. That intermediate value needs to survive steps in the current execution, not become a permanent preference. Flowise provides several places that can look like variables. Identify the required lifetime before selecting a namespace, because a working reference in one run does not prove persistence into the next conversation.

## Declare execution state at the Start node

The [Agentflow V2 reference](https://docs.flowiseai.com/using-flowise/agentflowv2) defines `$flow.state` as an execution-local key/value store. Every key that later nodes update must be initialized at Start, including an empty default when appropriate. Operational nodes update pre-existing keys rather than creating an arbitrary new schema. Check both declaration and the node's explicit Update Flow State mapping when a later branch sees an empty value despite a successful model response.

## Keep configured variables separate

The [Variables guide](https://docs.flowiseai.com/using-flowise/variables) distinguishes saved static values from runtime values fetched from the environment. These use `$vars`, a different mechanism from `$flow.state`. A configured service label, an environment-derived setting, and an extracted category can have the same visible spelling while referring to different sources. Record the namespace in the design note rather than describing all of them as “the variable” when troubleshooting.

## Do not infer conversation memory from state

Flow State is destroyed when that execution ends, and concurrent executions have independent stores. The [Prediction guide](https://docs.flowiseai.com/using-flowise/prediction) separately documents session identity and supplied conversation history. Start's Ephemeral Memory option controls whether prior messages participate in the run; it does not turn execution state into a cross-session database. Decide whether the task needs previous conversation text, a current-run result, or a separately maintained durable record.

## Verify a branch and a new run

Use an intermediate result that differs clearly between sample inputs. Confirm its update before the consuming branch, then start an independent execution and inspect the initialization behavior. The [task-contract guide](/journal/learn-codex-task-contract/) helps define the intended lifetime; [tool observations](/journal/learn-codex-tool-observation/) distinguish a generated response from a stored state update. Keep these observations separate so a successful chat reply does not conceal a missing mapping.
