# Set variables shape

## Introduction

The **set variables** shape is used to set values for flow variables and/or metadata variables at any point in a flow. &#x20;

## Need to know

When defining variable values you can use:

* static text (e.g. `blue-003`)
* [payload syntax](/product-documentation/process-flows/building-process-flows/dynamic-variables/payload-variables.md) (e.g. `[[payload.productColour]]`)
* [flow variable syntax](/product-documentation/process-flows/building-process-flows/dynamic-variables/flow-variables.md) (e.g..`{{flow.variables.productColour}}`)

{% hint style="info" %}
A single incoming payload for [any process flow shape](https://open.gitbook.com/~site/site_dIV1g/~/revisions/9dTvdvRJIRVZQXuBMMnJ/process-flows/building-process-flows/process-flow-shapes) should not exceed 500MB.

We recommend processing multiple, smaller payloads rather than one single payload (1000 x 0.5MB payloads are more efficient than 1 x 500MB payload!).

For payloads up to 500MB, consider adding a[ flow control shape](https://open.gitbook.com/~site/site_dIV1g/~/revisions/9dTvdvRJIRVZQXuBMMnJ/process-flows/building-process-flows/process-flow-shapes/standard-shapes/flow-control-shape) to batch data into multiple, smaller payloads. Payloads exceeding 500MB should be batched at source.
{% endhint %}

## Adding & configuring a set variables shape

**Step 1**\
In your process flow, add the **set variables** shape in the usual way:

<div align="left"><figure><img src="/files/4c527ulb0ssZzLKonNfk" alt="" width="375"><figcaption></figcaption></figure></div>

**Step 2**\
Access shape settings:

<div align="left"><figure><img src="/files/mbq4FKVmyuFkUwHrWQqd" alt="" width="375"><figcaption></figcaption></figure></div>

**Step 3**\
Click the add new variable option associated with the type of variable that you want to define - for example:

<div align="left"><figure><img src="/files/1sYyOX7kD1ebYg30jJaZ" alt="" width="375"><figcaption></figcaption></figure></div>

**Step 4**\
Options are displayed for you to define the required variables and their values. How these are displayed depends on the type of variable you've chosen to add:

<details>

<summary><img src="/files/mjTTZzyEQN7pfYDU3Ixl" alt="" data-size="line"> Variable (flow variables)</summary>

Choosing to add a **variable** displays a **flow variable** drop down field:

![](/files/AcrETEjeNRIiaIPyblBD)

From here you can select any [flow variable that's been defined for this process flow](/product-documentation/process-flows/building-process-flows/dynamic-variables/flow-variables.md) - for example:

![](/files/Rat7dxXpUdVIXrfCtERJ)

You then define the required values to be applied, and confirm with the **accept** button:

![](/files/Kh0v8o3bs2H3fIPLVRzB)

</details>

<details>

<summary><img src="/files/mjTTZzyEQN7pfYDU3Ixl" alt="" data-size="line"> Meta (payload metadata variables)</summary>

Choosing to add a meta variable displays **key** and **value** fields:

![](/files/3IxZlktYYqXPekNZQubj)

From here you define your variable name as the **key** and set the the required **value** to be applied - then confirm with the **accept** button:

![](/files/UUmw42WJhWQVz44cKpYC)

</details>

**Step 5**\
Once variables are accepted they're added to the settings panel (you can edit/delete as needed):

<div align="left"><figure><img src="/files/1TU92iLVJA3GiqwxmOq3" alt="" width="375"><figcaption></figcaption></figure></div>

**Step 6**\
Save the shape.


---

# 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/process-flow-shapes/standard-shapes/set-variables-shape.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.
