# One run at a time

> Make other runs wait until this one has finished.

Source: https://docs.buildcord.dev/nodes/variables-and-data/one-run-at-a-time/

`data.lock` makes runs that name the same thing take turns, so two of them can't read and change the same data at once.

## Settings

| Setting | What it does |
| --- | --- |
| For | What's being protected, such as `shop:{server.id}`. Runs that name the same thing take turns. |

## Ways out

`out`. Turn on **If it fails** for a red way out.

## Notes

- Use it before reading rows you're about to change.
- A narrower name allows more runs at once. `shop:{server.id}` lets different servers run together.

## Example

Before checking a balance and then spending it, lock on `shop:{user.id}` so a double click can't spend it twice.

## Related

- [Change rows](https://docs.buildcord.dev/nodes/variables-and-data/change-rows)
- [Find rows](https://docs.buildcord.dev/nodes/variables-and-data/find-rows)
