> For the complete documentation index, see [llms.txt](https://docs.ninox.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ninox.com/ninox-scripting/automate-your-workflows/automations/understand-transactions-in-ninox.md).

# Understand transactions in Ninox

Learn how Ninox executes read and write transactions.

Ninox runs database actions as transactions. A transaction groups one or more operations into a single execution step.\
In practice, this means Ninox handles reading data and changing data in different ways.

## **Read transactions**

A read transaction looks up data without changing it.

Typical examples are:

* filtering records in a table
* running a query to find matching records
* reading values to display them in the app

When Ninox starts a read transaction, it works with the data state that was current at that moment. Changes saved by other users during that same query are not part of that result.

Ninox can process many read transactions at the same time. One user reading data does not usually block another user from reading data.

## **Write transactions**

A write transaction changes data.

Typical examples are:

* creating a record
* editing a field value
* deleting a record
* clicking a button that updates data
* running logic that writes values back to the database

Only one write transaction runs at a time. Other write transactions wait until the current one finishes. This is usually not a problem because most write transactions finish very quickly.

{% hint style="info" %}
Automations such as **On create** and **On update** run inside the same write transaction that caused them.
{% endhint %}

## Use your knowledge of transactions to design a high-performance app

Good Ninox logic does more than return the right result. It should also run predictably, avoid blocking other users, and stay easy to maintain.

If Ninox seems slow or briefly unresponsive, a longer write transaction may be blocking the queue.

This happens when one action takes much longer than usual, and later write actions must wait.\
Common causes are:

* calls to external services, for example with `http(...)`
* large data evaluations combined with `select`
* complex logic inside buttons or automations that updates many records

Avoid these causes by keeping the write logic focused and short.

Follow these rules of thumb:

* read and prepare data first when possible
* keep API calls out of critical write flows when possible
* avoid repeated `select` queries inside loops
* test buttons and automations with realistic data volumes
* split large updates into smaller steps when possible

A practical way to think about it:

* Use read transactions to inspect data.
* Use write transactions only when you need to save a change.
* The less work a write transaction has to do, the smoother the app feels for everyone.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ninox.com/ninox-scripting/automate-your-workflows/automations/understand-transactions-in-ninox.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
