> For the complete documentation index, see [llms.txt](https://docs.docbits.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.docbits.com/administration-and-setup/workflow/advanced-workflow-builder/variables.md).

# Variables

Use Text, Number, Yes/No and Document variables, including organization scope and immediate persistence.

## Video: Variables, tests and activation

{% embed url="<https://docbits-videos.fra1.cdn.digitaloceanspaces.com/settings-assistant/advanced_workflows_testing/v3/en.mp4>" %}

[Open video](https://docbits-videos.fra1.cdn.digitaloceanspaces.com/settings-assistant/advanced_workflows_testing/v3/en.mp4) · [Captions (WebVTT)](https://docbits-videos.fra1.cdn.digitaloceanspaces.com/settings-assistant/advanced_workflows_testing/v3/en.vtt) · 1:53

<details>

<summary>Transcript (English)</summary>

Open Variables with the braces icon. Choose Text, Number, Yes or No, or Document. Search finds variable names. A Document variable stores a reference set by a dedicated workflow action. This form does not accept document values.

Choose a unique name, type and initial value. Creating, editing and deleting variables persist immediately for the organization. Other workflows can share these values. Saving or discarding the canvas cannot undo variable changes.

Select Validate. Review errors and warnings above the canvas. Click a message to focus its node. Check actions, entry connections, handles, cycles and merges. Structural validation does not prove that runtime data is correct.

Toolbar play opens Select Test Document. Choose a document, Custom Data, or Test Without Document for independent cards. Start play runs directly. Tests use the current canvas, including unsaved edits, and simulate destructive actions.

Prepare separate tests above, below and exactly at one thousand, plus missing data. After running, inspect node messages and durations: green success, orange false, red error, gray skipped. Retest fixes; use Test Manager for repeatable scenarios.

Auto-save keeps a local browser draft about every thirty seconds after changes. Save explicitly to the server. The activation toggle is unavailable before the first save. Check the enabled state in Workflow List before expecting automatic execution.

</details>

[Watch all five chapters](/administration-and-setup/workflow/advanced-workflow-builder/videos.md)

Open **Variables** with the **{ }** toolbar icon. Compatible cards can read or update named values such as thresholds, labels, flags or document references. The panel groups variables by type; Search filters their names.

## All four types

| Type         | Holds                 | Configuration                                                                                   |
| ------------ | --------------------- | ----------------------------------------------------------------------------------------------- |
| **Text**     | A string.             | Enter an initial text value, such as a reusable label.                                          |
| **Number**   | A numeric value.      | Enter a number, such as an amount threshold, without a currency symbol.                         |
| **Yes/No**   | A Boolean flag.       | Set the initial Yes/No toggle.                                                                  |
| **Document** | A document reference. | Assigned by an appropriate workflow action. This form does not accept a typed document default. |

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-2bb76a24c36e7135bbb118bba4ba4b531dc22c68%2Fadvanced_workflows_variable_form_en.png?alt=media" alt="New Variable form showing Text, Number, Yes/No and Document"><figcaption><p>Select a type, enter a unique name and set the initial value where applicable.</p></figcaption></figure>

## Create and use

1. Open **Variables → New Variable**.
2. Choose the type.
3. Enter a non-empty name not already used in the organization.
4. Set the initial value where applicable.
5. Select **Save** or **Create Variable**, depending on your version.
6. Select the variable in a compatible card field.

A card must support that variable type. Variables do not replace every card field, and an organization variable is different from a value extracted from a document field.

## Scope and persistence

{% hint style="warning" %}
Variables are **organization-wide**. Creating, editing or deleting one is saved to the server immediately, independently of saving the canvas. Other workflows can reference the same variable. Discarding the workflow or restoring a local draft does not undo the variable change.
{% endhint %}

Use shared values deliberately. If each invoice needs a different value, choose the document field or document-scoped data supported by the card instead of assuming a shared variable is private to an execution.

## Edit and delete

The **pencil** opens a variable's name and value for editing. Its type is retained; select the right type when creating it. Save persists the edit.

The **delete** icon opens a confirmation. Check which workflows use the variable before confirming: a deleted reference can leave a card without its expected value. Re-test affected workflows after changing a shared value.

## Example: a shared amount threshold

Create a Number variable such as `approval_threshold`. Select it in a compatible comparison card and route the result to approval or normal processing. Before changing it, identify other workflows that use it. Test below, exactly at and above the threshold. The comparison operator still matters: changing a value does not change `>` into `>=`.

Continue with [Validation & Testing](/administration-and-setup/workflow/advanced-workflow-builder/validation-and-testing.md) and [Workflow Logs](/administration-and-setup/workflow/workflow-logs.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.docbits.com/administration-and-setup/workflow/advanced-workflow-builder/variables.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
