> ## Documentation Index
> Fetch the complete documentation index at: https://help.nextmatter.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Metadata fields

> Add metadata fields to a workflow to give every instance the same set of values, like a client name or a contract value. Set them when the instance starts, update them later, and reuse them across the workflow.

Metadata fields are values that belong to the whole instance, not to a single step. You define them once on the workflow, and every instance of that workflow carries them. For example, a client onboarding workflow can have a **Client name**, a **Contract value**, and a **Region** on every instance.

You can:

* fill the values in when the instance starts, from the start form, the API, or a webhook
* change the values later, by hand or with an **Update metadata** step
* reuse the values as data references, in step conditions, and in the instance name
* show the values as columns in the workflow's instance table

> [!NOTE]
>
> Metadata fields are different from [public form URL parameters](https://help.nextmatter.com/docs/pass-meta-information.md). URL parameters pass extra values to an instance through a public form link. Metadata fields are part of the workflow itself.

## Add metadata fields to a workflow

1. In your left-hand navigation, click the **Workflows** icon.
2. Hover over the workflow, click the menu icon, and click **Edit workflow**.
3. Click the start step in the left-hand panel.
4. Under **Workflow start options**, click **Metadata fields**.
5. Click **+ Add metadata field** and select the type of field.
6. Enter a name and adjust the settings, then click **Save**.

![Image of the Metadata fields list with the fields Client name, Contract value, and Region](https://mintcdn.com/nextmatter/ghJVmjn9euAiaICN/images/docs/metadata-fields-list.png?fit=max\&auto=format\&n=ghJVmjn9euAiaICN\&q=85\&s=9f17a64f89284f37ba158762de1f77dd)

You can choose from these field types: short text, long text, number, email, URL, date, address, radio buttons, single-select dropdown, and multi-select dropdown. Each field works like the form field of the same type, so options such as **Make field optional**, placeholders, validation, and prefilled data are available.

> [!NOTE]
>
> Dropdown metadata fields can use a dataset as a source of options, but only with fixed filter values. Options that depend on other data in the instance aren't available. Date rules can't refer to other fields either.

### Mapping key

Each field has a **Mapping key**, for example `clientName`. The API and webhooks use this key to refer to the field. Next Matter fills it in from the field name, and you can edit it until you publish the workflow. After that, the key can't change. If you need a different key, add a new field.

### Don't ask at start

Select **Don't ask at start** if the person starting the instance shouldn't fill the field in. The field then isn't on the start form, and the API and webhooks can't set it. The instance starts with the field's default value, or empty if there isn't one. You can fill the field in later.

![Image of the Mapping key and Don't ask at start settings of a metadata field](https://mintcdn.com/nextmatter/ghJVmjn9euAiaICN/images/docs/metadata-field-settings.png?fit=max\&auto=format\&n=ghJVmjn9euAiaICN\&q=85\&s=4afc186a05bad2fe2b538f6d87755560)

> [!WARNING]
>
> A field that can't be left empty needs a default value if it isn't asked at start. You can't publish the workflow without one.

## Fill in metadata when an instance starts

### Start form

When you start an instance manually, the start form shows every metadata field that's asked at start. Fill them in and click **Start instance**.

![Image of the start form with the fields Client name, Contract value, and Region filled in](https://mintcdn.com/nextmatter/ghJVmjn9euAiaICN/images/docs/metadata-fields-start-form.png?fit=max\&auto=format\&n=ghJVmjn9euAiaICN\&q=85\&s=0b9ae966bc4ce63a07b005048e8e8b44)

### API

When you start an instance through the API, send a `metadata` object with the values, keyed by each field's mapping key. Send a value for every field that must be filled in at start. Fields without a value get their default. Keys that don't exist, and fields that aren't asked at start, are rejected.

```json theme={null}
{
  "metadata": {
    "clientName": "Northwind Traders",
    "contractValue": 48000,
    "region": "EMEA"
  }
}
```

Send text and dates as strings (dates as `YYYY-MM-DD`), numbers as numbers, and a choice as the text of the option. For multiple choices, send a list. For an address, send `street`, `city`, and `zipCode`.

To see which fields a workflow expects, get the workflow through the API and check its start details. For details on the start call, see [API reference](https://help.nextmatter.com/reference/instance/create-instance.md).

### Webhook

When a webhook starts an instance, you tell Next Matter where in the incoming message each value is. For details on setting up the webhook, see [Webhook triggers](https://help.nextmatter.com/docs/webhook-triggers.md#fill-in-metadata-from-a-webhook).

### Other ways to start

Recurring starts, public forms, and file imports can't send metadata values. Instances started this way get each field's default value. Because of that, you can't publish a workflow that has a recurring start or a public form if it has a field that can't be left empty and has no default. File imports are blocked for the same reason.

> [!NOTE]
>
> The first step of a workflow with a public form can't use metadata fields, in its references or in its conditions.

## View and change metadata on an instance

Open an instance. In the left-hand panel, the **Metadata** card shows how many fields the instance has. Click it to see the values.

![Image of the Metadata view of an instance with the values Northwind Traders, 48.000 euros, and EMEA](https://mintcdn.com/nextmatter/ghJVmjn9euAiaICN/images/docs/metadata-fields-run-view.png?fit=max\&auto=format\&n=ghJVmjn9euAiaICN\&q=85\&s=69f37ba40a3ad1e3771857689e9cca17)

You can edit the values, and the changes are tracked in the instance history. You can also change them automatically in the workflow with the **Update metadata** operation in the Automations Library. For each field, choose the new value, and decide what happens when the new value is empty: overwrite the current value or ignore it.

> [!NOTE]
>
> If you can see only some of an instance's steps, you don't see its metadata.

## Reuse metadata in a workflow

### Data references

In any step where you can add a data reference, click the braces icon and select a field from the **Metadata** group. For details, see [Data references](https://help.nextmatter.com/docs/use-data-references.md#reference-metadata-fields).

### Step conditions

You can use a metadata field when you [set a condition on a step](https://help.nextmatter.com/docs/set-conditions-to-a-step.md).

### Instance name

Add metadata references to the instance name when you let Next Matter name instances automatically. For example, name each instance after the **Client name**.

## Show metadata in the instance table

As an admin, you can add metadata fields as columns to the table of a workflow. For details on customizing the table, see [Instance overview table](https://help.nextmatter.com/docs/work-with-process-overview.md#customize-overview).

1. Click the workflow to open its instance table.
2. Click **Customize** and select **Select columns**.
3. Find the field in the **Metadata** group and add it to the active columns.
4. Click **Apply changes**.

![Image of an instance table with the columns Instance name, Started time, Client name, Contract value, and Region](https://mintcdn.com/nextmatter/ghJVmjn9euAiaICN/images/docs/metadata-fields-table-columns.png?fit=max\&auto=format\&n=ghJVmjn9euAiaICN\&q=85\&s=54444f608b6c7cc1a73182f5787d101e)

To show the table with these columns to everyone, publish it for everyone.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.