Worker KV (Mutate)
Worker KV (Mutate) (worker-kv)
Mutate the deployments-managed Worker KV store.
Storage json raw
Minimal example
actions: - worker-kv: namespace: ~ operation: set: {}JSON
{ "actions": [ { "worker-kv": { "namespace": null, "operation": { "set": {} } } } ]}Contents
Connection
Connection
| Field | Type | Required | Description |
|---|---|---|---|
namespace | string | ✅ | Fully-qualified Worker KV namespace (format: tenant:namespace). |
General
General
| Field | Type | Required | Description |
|---|---|---|---|
description | string | Describe this step. | |
condition | lua-expression (string) | Only run this action if the specified condition is met. Examples: 2 * count() |
Operation
Operation
| Field | Type | Required | Description |
|---|---|---|---|
operation | Worker KV Action Operation | ✅ | Mutation operation to perform. Allowed values: set, set-if-absent, delete, add-to-set, remove-from-set, ack-batch |
Schema
- Worker KV Action Operation Options
- Worker KV Action Operation - Set Fields
- Worker KV Action Operation - Set If Absent Fields
- Worker KV Action Operation - Delete Fields
- Worker KV Action Operation - Add To Set Fields
- Worker KV Action Operation - Remove From Set Fields
- Worker KV Action Operation - Ack Batch Fields
Worker KV Action Operation Options
| Option | Name | Type | Description |
|---|---|---|---|
set | Set | object | |
set-if-absent | Set If Absent | object | |
delete | Delete | object | |
add-to-set | Add To Set | object | |
remove-from-set | Remove From Set | object | |
ack-batch | Ack Batch | object |
Worker KV Action Operation - Set Fields
| Field | Type | Required | Description |
|---|---|---|---|
key | string | Static key to set within the namespace. | |
key-field | field (string) | Event field selector (json pointer / dotted path / jsonpath) that yields a string key. Examples: data_field | |
warn-on-missing-key ✓ | boolean (bool) | Emit a warning when key_field is missing/non-string/blank.Default: false | |
value-field | field (string) | Event field selector used as the stored value (defaults to entire event). Examples: data_field | |
ttl-ms ✓ | number (integer) | Optional TTL in milliseconds. Examples: 42, 1.2e-10 |
Worker KV Action Operation - Set If Absent Fields
| Field | Type | Required | Description |
|---|---|---|---|
key | string | Static key to set within the namespace. | |
key-field | field (string) | Event field selector (json pointer / dotted path / jsonpath) that yields a string key. Examples: data_field | |
warn-on-missing-key ✓ | boolean (bool) | Emit a warning when key_field is missing/non-string/blank.Default: false | |
value-field | field (string) | Event field selector used as the stored value (defaults to entire event). Examples: data_field | |
ttl-ms ✓ | number (integer) | Optional TTL in milliseconds. Examples: 42, 1.2e-10 |
Worker KV Action Operation - Delete Fields
| Field | Type | Required | Description |
|---|---|---|---|
key | string | Static key to delete within the namespace. | |
key-field | field (string) | Event field selector (json pointer / dotted path / jsonpath) that yields a string key. Examples: data_field | |
warn-on-missing-key ✓ | boolean (bool) | Emit a warning when key_field is missing/non-string/blank.Default: false |
Worker KV Action Operation - Add To Set Fields
| Field | Type | Required | Description |
|---|---|---|---|
set | string | ✅ | Workset name to add members to. |
member-field | field (string) | Selector used as the member identifier (defaults to full event). Examples: data_field | |
value-field | field (string) | Selector used as the member payload (defaults to full event). Examples: data_field | |
lease-ttl-ms ✓ | number (integer) | Optional lease TTL in milliseconds (currently unused for add-to-set). Examples: 42, 1.2e-10 |
Worker KV Action Operation - Remove From Set Fields
| Field | Type | Required | Description |
|---|---|---|---|
set | string | ✅ | Workset name to remove members from. |
member-field | field (string) | Selector used as the member identifier (defaults to full event). Examples: data_field |
Worker KV Action Operation - Ack Batch Fields
| Field | Type | Required | Description |
|---|---|---|---|
set | string | ✅ | Workset name associated with the batch handle. |
batch-handle-field | field (string) | ✅ | Selector used as the batch handle token emitted by worker-kv inputs.Examples: data_field |