# Persist objects

The Persist objects action node saves objects in a [runtime-only data source](https://docs.appfarm.io/reference/apps/data/data-sources#database-connected-and-runtime-only-data-sources) to the database.

## Usage

This action node is used when either a new object has been created or an existing object has been updated in a runtime-only data source and that data should be stored in the database.

The persist state of an object in a runtime-only data source can be tracked using the **Object State** [object property](https://docs.appfarm.io/reference/apps/data/data-sources#data-source-object-properties).

When an object is newly created, it will have the state `New`. If an object is read in from the database and edited, it will have the state `Updated`. When storing the objects the action node will check if the object is new or if it already exists in the database and will perform a create or update operation towards the database as necessary.

When the persist operation is complete, the runtime-only data source will still contain the object(s) persisted. Their state will change to `Synchronized`.

{% hint style="info" %}
**Good to know**

The **ID** property of an object will never change. New objects created in a runtime-only data source will be assigned an ID immediately and this ID will follow with the object into the database on persist.
{% endhint %}

## Properties

<table><thead><tr><th width="173">Property</th><th>Description</th></tr></thead><tbody><tr><td><strong>Data Source</strong></td><td>Select the data source containing the object(s) to persist.</td></tr><tr><td><strong>Selection</strong></td><td><p><em>Available if the selected</em> <strong>Data Source</strong> <em>is a many-cardinality data source.</em><br><br>Define the objects to persist.</p><ul><li><code>All objects</code></li><li><code>Selected object(s)</code></li><li><code>Object in context</code></li><li><code>Filtered selection</code></li></ul></td></tr><tr><td><strong>Filter</strong></td><td><em>Available when</em> <strong>Selection</strong> <em>is Filtered selection.</em><br><br>Define the <a href="../../reference/platform-concepts/filters">filter</a> to apply to the data source.</td></tr></tbody></table>
