# 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)


---

# 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/metadata-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.
