# Adding & managing flow variables

## Introduction

Flow variables are added and managed for any process flow via [process flow settings](/product-documentation/process-flows/building-process-flows/process-flow-settings.md). Once variables are defined, they can be referenced throughout the system - for example, in [scripts](/product-documentation/process-flows/building-process-flows/dynamic-variables/flow-variables/referencing-flow-variables-in-custom-scripts.md), or as [variable values](/product-documentation/process-flows/building-process-flows/dynamic-variables/flow-variables/referencing-flow-variables-in-a-process-flow.md#introduction).

## Adding flow variables

**Step 1**\
[Access the required process flow](/product-documentation/process-flows/accessing-your-process-flows.md).

**Step 2**\
Select the 'settings' icon from the [actions bar](/product-documentation/process-flows/building-process-flows/the-process-flow-canvas.md#the-actions-bar):

<figure><img src="/files/5gJ7FmJsGrrnljDKSX91" alt=""><figcaption></figcaption></figure>

**Step 3**\
Scroll down the settings drawer to the **variables** section, then click the **add new flow variable** button:

<figure><img src="/files/kgSSKVPvy4JxqI7sXIRC" alt=""><figcaption></figcaption></figure>

**Step 4**\
Enter a name for this variable - the name you enter here should be specified whenever you are referencing this variable:

<figure><img src="/files/1LNgQ5X0inYbbDvVISjE" alt=""><figcaption></figcaption></figure>

**Step 5**\
Click the **select a type** field and choose the required type:

<figure><img src="/files/6x2CbQ3UQ3aQbP7P0GqJ" alt=""><figcaption></figcaption></figure>

The following options are available:

<table><thead><tr><th width="224">Variable type</th><th>Variable is defined and passed as...</th></tr></thead><tbody><tr><td>String</td><td>A string value.</td></tr><tr><td>Number</td><td>A numeric value.</td></tr><tr><td>Specific date</td><td>A selected date - choose the required date/time from a date picker.</td></tr><tr><td>Dynamic date</td><td>A <code>+</code>/<code>-</code> number of <code>seconds</code>, <code>minutes</code>, <code>hours</code>, <code>days</code>, <code>months</code>, <code>years</code> to be matched relative to the current date. You can also specify a time zone and the required date format.</td></tr><tr><td>Boolean</td><td>A true/false value.</td></tr></tbody></table>

**Step 6**\
Enter the required value for this variable and save settings:

<figure><img src="/files/hTCGD1vhxwNGkLUiiUZF" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
When a variable is marked as `secret`, it will never be displayed on this page. However, it may be shown in [run logs](/product-documentation/process-flows/error-reporting-and-exception-handling/run-logs-and-queue.md) and (if used as a [dynamic variable](/product-documentation/process-flows/building-process-flows/dynamic-variables.md)) in [cache keys](/product-documentation/process-flows/building-process-flows/process-flow-shapes/advanced-shapes/cache/add-to-cache-shape.md).
{% endhint %}

**Step 7**\
If you want to hide this value from being displayed after the variable is saved, toggle ON the `is this variable a secret?` option:

<figure><img src="/files/dNgt5LFOAcmekg2JXgHQ" alt=""><figcaption></figcaption></figure>

**Step 8**\
Save settings.

## Updating flow variables

**Step 1**\
Access settings for the required process flow, as detailed [above](#adding-flow-variables).

**Step 2**\
Click the 'edit' icon associated with the variable you want to change:

<figure><img src="/files/cH3uI0ywH21JEi7RrT9K" alt=""><figcaption></figcaption></figure>

**Step 3**\
Now you can either update existing settings and click the **update** button, or click the **delete** button to remove this variable:

<figure><img src="/files/vVbD3jbGe8alQMECfeob" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/dynamic-variables/flow-variables/adding-and-managing-flow-variables.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
