Store Variable Action
The store_variable action persists a value to the Datastore during the automation chain. Stored values are scoped to your organization and can be read by future webhook requests via template interpolation using $store.<key>$.
Configuration
{
"type": "store_variable",
"name": "Save last order ID",
"config": {
"key": "last_order_id",
"namespace": "default",
"value": "$request.body.order.id$",
"ttl_seconds": 3600
}
}
Fields
| Field | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Datastore entry key (pattern: [a-zA-Z0-9_.\-:\/]+) |
value | string | Yes | Value to store (supports interpolation) |
namespace | string | No | Datastore namespace (default: "default") |
ttl_seconds | integer | No | Time-to-live in seconds — entry expires after this duration |
Behavior
- The value is written to the Datastore immediately when the action executes
- If a key already exists, its value is overwritten
- Errors are non-fatal — if the write fails, the chain continues
- Stored values are available in subsequent actions (and future requests) via
$store.<key>$or$store.<namespace>.<key>$
Examples
Store with expiration
{
"key": "rate_limit_counter",
"value": "$request.body.count$",
"ttl_seconds": 60
}
Store in a named namespace
{
"key": "last_event",
"namespace": "webhooks",
"value": "$request.body.type$"
}
Store a composite value
{
"key": "customer_$variable.customer_id$",
"value": "$variable.customer_email$"
}
Related
- Datastore Overview — how the key-value store works
- Datastore Namespaces & TTL — organizing entries and expiration
- Template Interpolation — using
$store.*$to read stored values