---
title: VersionMetadata annotation
description: Use the VersionMetadata annotation to create a versioned node. If you omit this annotation, the node defaults to version 1.
component: pingam
version: 8.1
page_id: pingam:auth-nodes:versionmetadata
canonical_url: https://docs.pingidentity.com/pingam/8.1/auth-nodes/versionmetadata.html
keywords: ["Extensibility", "Nodes &amp; Trees", "Scripts"]
section_ids:
  name: Name
  version: Version
  upgrader: Upgrader
---

# VersionMetadata annotation

Use the `VersionMetadata` annotation to create a [versioned node](create-versioned-nodes.html). If you omit this annotation, the node defaults to version 1.

This annotation specifies two required attributes: the `name` and `version`. You can also specify the optional `upgrader` class name.

For example, the following is the `@Node.VersionMetadata` annotation for the [Username Collector node](https://docs.pingidentity.com/auth-node-ref/8.1/am-only/username-collector.html) version 2:

```java
@Node.VersionMetadata(name = "UsernameCollectorNode", version = 2)
```

## Name

The `name` attribute specifies the name (if defined) or class name of the original version 1 node. This creates the link between all versions of the same node to group them together.

## Version

The `version` attribute sets the version of this node.

The version specified must be:

* Greater than the node's current version.

* A positive integer.

## Upgrader

The optional `upgrader` class name specifies the class that defines how the node's configuration is updated from one version to another. If the `upgrader` class name is omitted, the node's configuration stays the same during an upgrade.

For example, the following is the `@Node.VersionMetadata` annotation for a Custom node with an `upgrader` class specified:

```java
@Node.VersionMetadata(name = "CustomAuthNode",
        version = 2,
        upgrader = CustomAuthNodeV2.CustomAuthNodeV2Upgrader.class)
```

Where the `CustomAuthNodeV2.CustomAuthNodeV2Upgrader.class` provides code to transform the node's configuration from version 1 to version 2.

Learn more in the [Upgrader class](upgrader-class.html).

|   |                                                                                                                                                                                                                                   |
| - | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|   | If you specify an `upgrader` class name, you must also include the [NodeVersionUpgrader.UpgraderMetadata annotation](nodeversionupgrader.html) on the `upgrader` class. The new node won't install if this annotation is missing. |
