Skip to content

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
FieldTypeRequiredDescription
namespacestringFully-qualified Worker KV namespace (format: tenant:namespace).

General

General
FieldTypeRequiredDescription
descriptionstringDescribe this step.
conditionlua-expression (string)Only run this action if the specified condition is met.
Examples: 2 * count()

Operation

Operation
FieldTypeRequiredDescription
operationWorker KV Action OperationMutation operation to perform.
Allowed values: set, set-if-absent, delete, add-to-set, remove-from-set, ack-batch

Schema

Worker KV Action Operation Options

OptionNameTypeDescription
setSetobject
set-if-absentSet If Absentobject
deleteDeleteobject
add-to-setAdd To Setobject
remove-from-setRemove From Setobject
ack-batchAck Batchobject

Worker KV Action Operation - Set Fields

FieldTypeRequiredDescription
keystringStatic key to set within the namespace.
key-fieldfield (string)Event field selector (json pointer / dotted path / jsonpath) that yields a string key.
Examples: data_field
warn-on-missing-keyboolean (bool)Emit a warning when key_field is missing/non-string/blank.
Default: false
value-fieldfield (string)Event field selector used as the stored value (defaults to entire event).
Examples: data_field
ttl-msnumber (integer)Optional TTL in milliseconds.
Examples: 42, 1.2e-10

Worker KV Action Operation - Set If Absent Fields

FieldTypeRequiredDescription
keystringStatic key to set within the namespace.
key-fieldfield (string)Event field selector (json pointer / dotted path / jsonpath) that yields a string key.
Examples: data_field
warn-on-missing-keyboolean (bool)Emit a warning when key_field is missing/non-string/blank.
Default: false
value-fieldfield (string)Event field selector used as the stored value (defaults to entire event).
Examples: data_field
ttl-msnumber (integer)Optional TTL in milliseconds.
Examples: 42, 1.2e-10

Worker KV Action Operation - Delete Fields

FieldTypeRequiredDescription
keystringStatic key to delete within the namespace.
key-fieldfield (string)Event field selector (json pointer / dotted path / jsonpath) that yields a string key.
Examples: data_field
warn-on-missing-keyboolean (bool)Emit a warning when key_field is missing/non-string/blank.
Default: false

Worker KV Action Operation - Add To Set Fields

FieldTypeRequiredDescription
setstringWorkset name to add members to.
member-fieldfield (string)Selector used as the member identifier (defaults to full event).
Examples: data_field
value-fieldfield (string)Selector used as the member payload (defaults to full event).
Examples: data_field
lease-ttl-msnumber (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

FieldTypeRequiredDescription
setstringWorkset name to remove members from.
member-fieldfield (string)Selector used as the member identifier (defaults to full event).
Examples: data_field

Worker KV Action Operation - Ack Batch Fields

FieldTypeRequiredDescription
setstringWorkset name associated with the batch handle.
batch-handle-fieldfield (string)Selector used as the batch handle token emitted by worker-kv inputs.
Examples: data_field