
Redis Set
CertifiedWrite a string value to Redis
Redis Set
Write a string value to Redis
Runs SET on the rendered key using the selected serde (STRING or JSON), supports NX/XX guards, TTL options, keep-ttl, and can return the previous value.
type: io.kestra.plugin.redis.string.SetExamples
Set a string value.
id: redis_set
namespace: company.team
inputs:
- id: key_name
type: STRING
displayName: Key Name
- id: key_value
type: STRING
displayName: Key Value
tasks:
- id: set
type: io.kestra.plugin.redis.string.Set
url: redis://:redis@localhost:6379/0
key: "{{ inputs.key_name }}"
value: "{{ inputs.key_value }}"
serdeType: STRING
get: true
options:
mustExist: true
keepTtl: true
Set a JSON value.
id: redis_set_json
namespace: company.team
tasks:
- id: set
type: io.kestra.plugin.redis.string.Set
url: "{{ secret('REDIS_URI') }}"
key: "key_json_{{ execution.id }}"
value: |
{{ {
"flow": flow.id,
"namespace": flow.namespace
} | toJson }}
serdeType: JSON
- id: get
type: io.kestra.plugin.redis.string.Get
url: "{{ secret('REDIS_URI') }}"
serdeType: JSON
key: "key_json_{{ execution.id }}"
Properties
key *string
Redis key to set
Rendered before calling SET.
serdeType *string
STRINGSTRINGJSONSerialization format
Defaults to STRING; set to JSON to serialize/deserialize structured values.
url *string
Redis connection string
value *object
Value to store
Rendered then serialized with the chosen serde; STRING expects plain text, JSON accepts object or JSON string.
assets
Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset failure behavior
Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150get booleanstring
falseReturn existing value
Defaults to false; when true, uses SETGET to return the prior value (not supported on Redis 5.x).
options
{
"mustNotExist": "false",
"mustExist": "false",
"keepTtl": "false"
}Set options
TTL, NX/XX, and keepTtl flags; see Redis documentation.
io.kestra.plugin.redis.string.Set-Options
Expiration date
Absolute timestamp; cannot be combined with expirationDuration when keepTtl is true.
Expiration duration
Relative TTL; cannot be combined with expirationDate when keepTtl is true.
falseKeep existing TTL
Keeps current TTL instead of resetting; cannot be used with expirationDuration or expirationDate.
falseSet only when key exists
Applies XX behavior; do not combine with mustNotExist.
falseSet only when key is absent
Applies NX behavior; do not combine with mustExist.
Outputs
oldValue string
Previous value
Returned only when get is true.