# Stored Data Values

> Save and reuse values across steps and runs: read, write, delete, and count with stored values.

Built-in step · 4 steps. Web page: https://docs.lodol.com/docs/integrations/built-in/variables

To learn when to use these steps, with examples, read [Remember values between runs](https://docs.lodol.com/docs/guides/stored-values.md).

## Steps

### Delete a stored value

Remove a stored value, or, with a dotted name, just one field of it. Deleting something that was never set does nothing and is not an error, so it's safe to run every time. The value must be one workflows are allowed to edit (turn on "Let workflows edit this value" when you create it); a value the workflow creates itself is editable automatically.

**Inputs**

- Name (`name`, text, required): The name this value is stored under, for example cursor. To work with a single field inside a stored object, add a dotted path such as user.email. Letters, digits, and underscores only; each part can't start with a digit.
- Scope (`scope`, text, required): Where this value lives: the whole workspace (shared by every workflow), or just this workflow. One of: `workspace` (Whole workspace), `workflow` (This workflow). Default: `workspace`.

**Outputs**

- `deleted` (true/false): Whether a stored value was removed.
- `name` (text)
- `scope` (text)

**Example output**

```json
{
  "deleted": true,
  "name": "last_processed_id",
  "scope": "workspace"
}
```

### Get a stored value

Read a stored value so the workflow can pick up where it left off, for example the last record it processed. Returns the default you provide when nothing has been stored under this name yet. Reading is always allowed.

**Inputs**

- Name (`name`, text, required): The name this value is stored under, for example cursor. To work with a single field inside a stored object, add a dotted path such as user.email. Letters, digits, and underscores only; each part can't start with a digit.
- Scope (`scope`, text, required): Where this value lives: the whole workspace (shared by every workflow), or just this workflow. One of: `workspace` (Whole workspace), `workflow` (This workflow). Default: `workspace`.
- Default value (`default`, text): What to return when nothing has been stored under this name yet. Leave empty to get nothing back. The type selector controls how it's read: Auto infers it, so 0 comes back as a number.

**Outputs**

- `found` (true/false): Whether the stored value was already set.
- `name` (text)
- `scope` (text)
- `value`: The stored value, or the default when unset.

**Example output**

```json
{
  "found": true,
  "name": "last_processed_id",
  "scope": "workspace",
  "value": "42"
}
```

### Increment a stored value

Add a number to a counter and get the new total back. Starts the counter at zero the first time. The value must be a number; if it holds something else, like text, the step fails and nothing is added. Safe to run from many workflow runs at once: every increment is counted, with none lost. The value must be one workflows are allowed to edit (turn on "Let workflows edit this value" when you create it); a value the workflow creates itself is editable automatically.

**Inputs**

- Name (`name`, text, required): The name this value is stored under, for example cursor. To work with a single field inside a stored object, add a dotted path such as user.email. Letters, digits, and underscores only; each part can't start with a digit.
- Amount (`amount`, number): How much to add. Defaults to 1. Use a negative number to count down. Default: `1`.
- Scope (`scope`, text, required): Where this value lives: the whole workspace (shared by every workflow), or just this workflow. One of: `workspace` (Whole workspace), `workflow` (This workflow). Default: `workspace`.

**Outputs**

- `name` (text)
- `scope` (text)
- `value` (number): The counter's new total after adding.

**Example output**

```json
{
  "name": "processed_count",
  "scope": "workspace",
  "value": 1
}
```

### Set a stored value

Save a value under a name so a later step or a future run can read it back, for example a cursor marking how far the workflow has gotten. Overwrites whatever was stored there before; setting a dotted path fills in any missing objects along the way. The value must be one workflows are allowed to edit (turn on "Let workflows edit this value" when you create it); a value the workflow creates itself is editable automatically.

**Inputs**

- Name (`name`, text, required): The name this value is stored under, for example cursor. To work with a single field inside a stored object, add a dotted path such as user.email. Letters, digits, and underscores only; each part can't start with a digit.
- Value (`value`, text, required): What to store. The type selector controls how it's saved: Auto figures it out (123 becomes a number, true a yes/no, and text stays text), or pin it to Text or Number.
- Scope (`scope`, text, required): Where this value lives: the whole workspace (shared by every workflow), or just this workflow. One of: `workspace` (Whole workspace), `workflow` (This workflow). Default: `workspace`.

**Outputs**

- `name` (text)
- `scope` (text)
- `value`: The value that was stored.

**Example output**

```json
{
  "name": "last_processed_id",
  "scope": "workspace",
  "value": "42"
}
```
