---
title: Set State node
description: Configure the Set State node to set or overwrite attribute values in the shared state during an PingAM authentication journey.
component: auth-node-ref
version: 8
page_id: auth-node-ref::set-state
canonical_url: https://docs.pingidentity.com/auth-node-ref/latest/set-state.html
llms_txt: https://docs.pingidentity.com/auth-node-ref/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
keywords: ["Nodes &amp; Trees", "Journeys", "Authentication", "Shared State"]
superseded_by: https://docs.pingidentity.com/auth-node-ref/latest/set-state.html
section_ids:
  availability: Availability
  inputs: Inputs
  dependencies: Dependencies
  configuration: Configuration
  outputs: Outputs
  outcomes: Outcomes
  errors: Errors
  example: Example
---

# Set State node

The Set State node lets you set the values of any configured attributes in the shared state. The node removes any previous values of the specified attributes from all states (transient, secure, and shared) and resets them to the configured values in the shared state.

|   |                                                                                    |
| - | ---------------------------------------------------------------------------------- |
|   | Don't use this node to add sensitive data, such as passwords, to the shared state. |

## Availability

| Product                               | Available? |
| ------------------------------------- | ---------- |
| PingOne Advanced Identity Cloud       | Yes        |
| PingAM (self-managed)                 | Yes        |
| Ping Identity Platform (self-managed) | Yes        |

## Inputs

This node reads any attributes stored in the shared state by previous nodes in the journey.

## Dependencies

This node has no dependencies.

## Configuration

| Property   | Usage                                                                                                                                                                                                                                                                      |
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Attributes | Add the attributes you want to set in the shared state. For each attribute:1) Click [icon: plus, set=fa].

2) In the Key field, enter the attribute name.

3) In the Value field, enter the value of the attribute you want to set.

4) Click Save when you have finished. |

## Outputs

This node writes any configured attributes and their values to the shared state.

## Outcomes

None

## Errors

This node doesn't log any errors or warnings.

## Example

The following sample journey assumes that an organization wants to overwrite the `costCenter` of specific employees when they authenticate.

* If an employee doesn't have a `costCenter` attribute in their profile, the journey proceeds without changing the user object.

* If the user does have a `costCenter` attribute, the journey uses the Set State node to overwrite the value of that attribute.

![journey set state](_images/journey-set-state.png)

The user has already authenticated before beginning this journey:

* The [Get Session Data node](get-session-data.html) gets the `userName` from the session.

* The [Attribute Present Decision node](attribute-present-decision.html) checks the user object to determine whether the user has a `costCentre` attribute.

  * If the user doesn't have a `costCentre` attribute, the journey proceeds to the success outcome.

  * If the user does have a `costCentre` attribute, the [Attribute Present Decision node](attribute-present-decision.html) stores its value in the shared state.

* The Set State node overwrites the value of the `costCentre` attribute with the value set in the node configuration.

* The [Patch Object node](patch-object.html) node updates the user object with the new `costCentre`.

* If the patch of the user object is successful, the journey proceeds to the success outcome; otherwise, the journey follows the failure outcome.
