# Persist objects

The Persist objects action node saves objects in a [runtime-only data source](/reference/apps/data/data-sources.md#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](/reference/apps/data/data-sources.md#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="/spaces/-MiLU-xcHu0eLZiTxcmZ/pages/-MiR9GGOxcZeghNQPbzV">filter</a> to apply to the data source.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.appfarm.io/library/action-nodes/persist-objects.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
