---
title: "start storage transaction · RUAL Documentation"
description: "Opens a storage transaction: every document create, update, remove and restore this flow performs until the end block is journaled so the whole group ca…"
canonical: https://docs.rual.nl/block-types/storage/function_transaction_start
language: en
---

[Cluster](https://docs.rual.nl/cluster)

[Blocks](https://docs.rual.nl/block-types)

[Interfaces](https://docs.rual.nl/interfaces)

[Blueprints](https://docs.rual.nl/blueprints)

[Blueprint Language](https://docs.rual.nl/engine)

[Tutorials](https://docs.rual.nl/tutorials)

[Home automation](https://docs.rual.nl/home-automation)

[Examples](https://docs.rual.nl/examples)

[Reference](https://docs.rual.nl/reference)

[Architecture](https://docs.rual.nl/architecture)

[Troubleshooting](https://docs.rual.nl/troubleshooting)

Other

# start storage transaction

This block is part of the [`storage`](https://docs.rual.nl/block-types/storage) group and was last modified in core [`v15.0.1`](https://docs.rual.nl/core-versions/150001).

Opens a storage transaction: every document create, update, remove and restore this flow performs until the end block is journaled so the whole group can be reverted as one.

- flow `flow`

- transaction id `value` Stable identity of this operation (e.g. an order number). Leave empty for a random id : usable for rollback, not for idempotent retry.

- name `value` Human label stored on the transaction record.

- retention (sec.) `number` How long the journal is kept after the transaction ends. Default 604800 (7 days).

Default `604800`

- lease (sec.) `number` How long an opener that stopped renewing (crashed) is still considered alive before a retry may revert its attempt. Default 60.

Default `60`

- revert abandoned attempt `condition` When a previous attempt under the same id is open with an expired lease, revert it before starting fresh (default on). Off fails with TRANSACTION_ABANDONED instead.

Default `true`

- flow `flow`

- success `condition`

- transaction id `value`

- transaction reference `value` Qualified `bp: : ` form of the id. A transaction belongs to the blueprint that started it; hand this to an end or revert block in ANOTHER blueprint (an operator's repair flow) to address it there.

- already committed `condition` True when this id already committed earlier; `result` then carries what the end block stored.

- stored result `value`

- status `value` started, already_committed, in_progress, abandoned, revert_conflict or simulated.

- attempt `number`

- abandoned revert report `object`

- error `value`

Opens a storage transaction for the rest of this flow (and every function it calls). While it is open, every store write : function_create_*, function_update_*, function_remove_*, function_restore_*, function_delete_document, upserts : records the document's state BEFORE the write into a Redis journal, and created documents carry _meta.transaction_id. function_transaction_revert then undoes the journal newest-first, refusing any document whose update_hash moved since; function_transaction_end commits it and stores `result`. NOT an ACID transaction: writes are visible immediately, and bulk ES operations (update by query, reindex, bulk delete) fail with TRANSACTION_UNSUPPORTED_WRITE while one is open. A transaction is identified by the id AND the blueprint that started it (the `transaction_ref` out-pin is the qualified form), so another blueprint cannot read or revert it by guessing the id. With a stable `id` (an order number, account+season) it is also an idempotent-retry gate: a second start of an id that already committed answers already_committed=true with the stored result and does not reopen; one whose previous attempt is still running (its lease is alive) fails with TRANSACTION_IN_PROGRESS; one whose previous attempt died (lease expired) is reverted first when revert_abandoned is on (default) : status revert_conflict and TRANSACTION_REVERT_CONFLICT when that revert could not complete : or fails with TRANSACTION_ABANDONED when it is off. status is one of started, already_committed, in_progress, abandoned, revert_conflict; success is true only for started and already_committed. The journal is kept for `retention` seconds (default 7 days); `lease` seconds (default 60) is how long a crashed opener is still considered alive. In simulation nothing is written and status is simulated.

A typical wiring for [start storage transaction](https://docs.rual.nl/block-types/storage/function_transaction_start): a [function trigger](https://docs.rual.nl/block-types/globals/trigger_custom_function) starts the flow; the `flow` out pin feeds [debug](https://docs.rual.nl/block-types/state%2520ui/state_debug).

[![Studio canvas example for the start storage transaction block: typical wiring for start storage transaction.](https://docs.rual.nl/canvas-examples/function_transaction_start.png)](https://docs.rual.nl/canvas-examples/function_transaction_start.png?v=3)

## Version history

Introduced in [`v15.0.1`](https://docs.rual.nl/core-versions/150001).

- [Back to `storage`](https://docs.rual.nl/block-types/storage): Return to the main group to view all sub-groups

- [Back to `storage`](https://docs.rual.nl/block-types/storage?group=storage): Return to the group to view all blocks within this group

Was this page helpful? [Tell us what to improve](https://docs.rual.nl/support) · RUAL Docs is an integral component of the [RUAL ecosystem](https://rual.nl)
