Docs
Flows

Variables and Data Flow

Understand how data moves between nodes in your workflow.

Variables and Data Flow

Every workflow in FormWise is a chain of nodes, and data flows through them from top to bottom. Understanding how variables work - where they come from, how to reference them, and how they pass between nodes - is key to building effective Flows.

How data flows

When someone uses your Flow, here is what happens:

  1. The user submits a form or sends a chat message. This creates the input data.
  2. The Start node receives that input and passes it to the next node.
  3. Each node processes the data it receives and produces an output.
  4. Downstream nodes can read from any upstream node's output, the original input, or any state variables that have been set along the way.

Data always flows top-to-bottom through your workflow. A node can only read data from nodes that came before it - never from nodes that come after it.

Types of variables

Input variables

Input variables come from the user. They are defined on the Start node and correspond to the fields in your form or the message in your chatbot.

Each input variable has a type that describes what kind of data it holds:

  • String - Text input (names, descriptions, messages).
  • Number - Numeric values (ages, quantities, prices).
  • Boolean - True or false values (yes/no toggles, checkboxes).
  • Object - A group of related values bundled together.
  • List - A collection of multiple values.

For example, if your form has a "Name" field and a "Topic" field, you will have two input variables: one for the name and one for the topic.

State variables

State variables are created by Set State nodes. They let you store intermediate results as your workflow runs - like a notepad the workflow uses to remember things between steps.

For example, you might have one Agent node summarize a document, store that summary in a state variable, and then have a second Agent node use that summary to generate follow-up questions.

Node outputs

Every Agent node produces an output when it runs. That output is automatically available to any node that comes after it in the workflow. You give each output a name in the Agent node's configuration panel, which makes it easy to reference later.

Referencing variables

When you are writing a system instruction, custom input, or any text field that supports variables, you can pull in data from earlier in the workflow.

Using the variable picker

The easiest way to reference a variable is with the variable picker:

  1. Click into a text field that supports variables (like a system instruction or custom input).
  2. Look for the variable insert button or type the variable syntax to trigger the picker.
  3. Browse the available variables grouped by source.
  4. Click the one you want to insert it.

Variable sources

Variables are organized by where they come from:

  • Input - Data from the user's form submission or chat message. For example, input.name or input.topic.
  • State - Values stored by Set State nodes. For example, state.summary or state.userCategory.
  • Predecessor - The output from a previous node in the workflow. For example, the output of an Agent node named draft.
  • Parallel - Outputs from nodes running in parallel branches. When you use a Parallel node, each branch produces its own output that you can reference after the branches merge.
  • Classify - The result of a classification node, telling you which category the input was sorted into.

Practical examples

Here are a few common patterns to help you see how variables work in practice.

Using input in a prompt

If your form has a Name field and a Topic field, you can write a system instruction like:

Write a short blog post about {{input.topic}} for a reader named {{input.name}}. Keep the tone friendly and conversational.

The AI will receive the actual values the user typed in place of those references.

Chaining node outputs

Say your workflow has two Agent nodes. The first one generates a rough draft, and you named its output draft. In the second Agent node, you could set the input source to Custom and write:

Here is a rough draft of an article. Please edit it for grammar, clarity, and tone:

{{draft}}

The second node receives the full output of the first node and refines it.

Using state to store intermediate results

  1. Add a Set State node after your first Agent node.
  2. Name the state variable summary and set its value to the output of the previous node.
  3. Later in the workflow, reference state.summary in any downstream node that needs it.

This is especially useful in workflows with branches, where you want to carry a result across different paths.

Tips for working with variables

  • Name your outputs clearly. Use descriptive names like draft, analysis, or userCategory instead of generic names. This makes your workflow much easier to read and maintain.
  • Use state variables when you need to share data across branches. If two parallel branches both need the same value, store it in state before the branches split.
  • Check variable types. If a downstream node expects text but receives a number, you might get unexpected results. Make sure the types line up.
  • Keep your data flow simple. The more straightforward your variable references are, the easier your workflow is to debug and update.

Next steps

Ready to make sure your Flow works as expected? Head over to Testing and Quality to learn how to test your workflows and evaluate output quality.

On this page