# Set journey attributes

Journey attributes help you temporarily store data that you want to use in your campaign—like properties from a webhook or data from a collection query.

Unlike customer attributes, journey attributes don’t persist on a person’s profile—they automatically expire when the person exits the campaign. This keeps your workspace data clean while still letting you use data for personalization, conditions, and branching within a workflow.

## How it works[](#how-it-works)

You can set journey attributes in three ways:

Method

Use case

Set journey attributes action

Set values directly based on profile attributes, trigger data, liquid, or JavaScript. For instance, you might do this to temporarily store a discount code while a person is actively in a campaign.

Webhook response

Store data returned from an external API. Learn more on [setting journey attributes in a webhook action](/journeys/webhooks-action/#response).

Collection query

Store results from a collection query. Learn more on [setting journey attributes in a collection query action](/journeys/collections/#decide-how-to-store-the-results).

After you set a journey attribute, you can use it to:

*   Personalize messages with this liquid syntax: `{{journey.<attribute_name>}}`
*   Create branch conditions to send people down different paths
*   Set action conditions on messages, delays, or other blocks

## Set journey attributes action[](#set-journey-attributes-action)

To set journey attributes in a campaign, follow these steps:

1.  Drag the **Set journey attributes** action into your workflow, and then configure the attributes you want to set.
2.  Click the action **Name** to add your own descriptor. You can also set [action conditions](/journeys/action-conditions/) if you don’t want everybody in your workflow to trigger this action.
3.  Click **Add details**.
4.  Click **Add attribute** to set your journey attribute.
    
    [![Set an attribute name, value type, and value.](https://docs.customer.io/images/set-journey-attributes-action.png)](#173c9f26411b9606c98ee8041a6ce101-lightbox)
    
    *   **Attribute** is the name of the journey attribute. Reference it later in liquid as `{{journey.<attribute_name>}}`. In the example above, you could use `{{journey.discount_code}}` in a subsequent message.
    *   **Value** is the type of data you want to set for your attribute—a profile attribute, trigger attribute, a static value, liquid, or JavaScript. [Learn more about setting attributes](/journeys/create-update-person/#what-values-can-i-use-to-set-attributes).
5.  Click **Save Changes** when you’re done.

 You don’t need a delay after this action

Your campaign workflow will automatically wait for the attribute update to finish before moving to the next step. You don’t need to add a delay after a *Set journey attributes* action—the workflow won’t proceed until the update finishes.

### Limits on journey attributes[](#limits-on-journey-attributes)

*   **Overall limit**: 100 journey attributes per journey. You can create or change up to 100 journey attributes during a single journey. Updates beyond this limit fail, and the person moves forward without the update.
*   **Attribute name limit**: 128 bytes
*   **Attribute value limit**: 100 KiB

## Use journey attributes in your workflow[](#use-journey-attributes-in-your-workflow)

You can reference journey attributes in messages and conditions for actions like branches and emails.

If the value of your journey attribute contains liquid syntax, make sure you add [{% render\_liquid %}](#how-to-reference-journey-attributes-with-nested-liquid) around your liquid object so it pulls in data dynamically. Otherwise, it will render as static text.

### Reference journey attributes in messages[](#reference-journey-attributes-in-messages)

Use the `journey` key in liquid to include journey attribute data in messages. If the attribute value is an object (not an array), access properties directly:

```text
{{ journey.promo_course.name }}
{{ journey.promo_course.description }}
```

If the data is an array, you can [loop through the data](/journeys/liquid-tag-list/?version=latest#for-loop-latest):

```text
{% for item in journey.course_recommendations %}
  {{ item.name }}
{% endfor %}
```

You can also use liquid filters like `first`, `last`, and `map` to access specific items in the array:

```text
{% assign first_course = journey.course_recommendations | first %}
{{ first_course.name }}
```

### How to reference journey attributes with nested liquid[](#how-to-reference-journey-attributes-with-nested-liquid)

Sometimes the data stored on an attribute includes liquid syntax, like when you store email content generated from an [LLM action](/journeys/llm-actions/) or webhook that personalizes the message based on a customer’s data.

For instance, let’s say you have a journey attribute named `body` with the following value:

```HTML
"body": "Hello {{customer.first_name}}!"
```

If you then referenced this journey attribute in a message with `{{journey.body}}`, the message would render as “Hello {{customer.first\_name}}!” instead of “Hello Alex!”. The liquid syntax would render as static text.

To render this dynamically, you need to wrap the liquid object in [`{% render_liquid %}`](/journeys/liquid-tag-list/?version=latest#render_liquid-latest), like `{% render_liquid journey.body %}`.

#### Preview journey attributes in messages[](#preview-journey-attributes-in-messages)

To preview journey attributes, you need to provide sample data. Otherwise, we won’t render anything in the preview:

1.  Open the **Sample data** panel in the message editor.
2.  Select the **Journey** tab.
3.  Enter test values under your attribute names.

In the message preview, you’ll see the sample value render.

Like with any other liquid variables, if we can’t retrieve a value for the journey attribute when we attempt to send the message, the message will fail to send.

### Reference journey attributes in conditions[](#reference-journey-attributes-in-conditions)

After you set a journey attribute, you can use it in any condition in your workflow—including branch conditions and action conditions. For example, you could send people down different paths in a multi-split branch based on a journey attribute value. You could also only send an email to people when their journey attribute contains a certain value.

[![Multi-split branch split by journey attribute discount_code](https://docs.customer.io/images/multi-split-branch-journey-attribute-2.png)](#e1992fac245164990c216fc4f2ec9fda-lightbox)