# Metadata variables

## Introduction

Payload metadata variables (known as meta-variables) can be added by [custom scripts](https://doc.wearepatchworks.com/product-documentation/marketplace/marketplace-scripts) and the [set variables](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/set-variables-shape) shape.

There may be times when you need to define variables or parameters for a process flow step using values from the incoming payload metadata. This can be achieved using a specific payload syntax in the process flow connection shape.

## Need to know

* Payload metadata cannot exceed 10240 bytes. Exceeding this limit will cause the process flow to fail on the associated step.
* Meta-variable values are `string` values. &#x20;

## Referencing meta variables

Payload metadata can be accessed via a variable or parameter field using the syntax below:

```
[[meta.unique_key]]
```

For example:

```
[[meta.id]]
```

![](https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FVvQLuni4plWmFWhsEeks%2Fmeta%20variable%20example.png?alt=media\&token=a68eec25-badc-4aa8-a80c-991732260adb)

{% hint style="info" %}
When defining variables you can 'mix and match' [payload](#variables-and-parameters-from-payload-syntax), **metadata** and [flow](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/dynamic-variables/flow-variables) variables. For example:

![](https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FO9qBWPxzLHTy6QWjKprQ%2Fmix%20variables%20example.png?alt=media\&token=f3e960b3-9849-4237-9730-2e2fb9baff85)
{% endhint %}

{% hint style="info" %}
When a payload is passed to a 'child' process flow via the [run process flow shape](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/run-process-flow-shape), meta variables are included.&#x20;
{% endhint %}

## Related information

* [Payload variables](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/dynamic-variables/payload-variables)
* [Flow variables](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/dynamic-variables/flow-variables)
* [Generating dynamic cache keys with variables](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/advanced-shapes/cache/add-to-cache-shape/generating-dynamic-cache-keys-with-variables)
