Set
type: "io.kestra.plugin.core.state.Set"
Set a state in the state store.
Values will be merged:
- If you provide a new key, the new key will be added.
- If you provide an existing key, the previous key will be overwrite.
This method is not concurrency safe. If many executions for the same flow are concurrent, there is no guarantee on isolation on the value. The value can be overwritten by other executions.
Examples
Set the default state for the current flow.
id: set_state
type: io.kestra.plugin.core.state.Set
data:
'{{ inputs.store }}': '{{ outputs.download.md5 }}'
Set the
myState
state for the current flow.
id: set_state
type: io.kestra.plugin.core.state.Set
name: myState
data:
'{{ inputs.store }}': '{{ outputs.download.md5 }}'
Properties
name
- Type: string
- Dynamic: ✔️
- Required: ✔️
- Default:
default
The name of the state file.
data
- Type: object
- Dynamic: ✔️
- Required: ❌
The data to be stored in the state store.
namespace
- Type: boolean
- Dynamic: ✔️
- Required: ❌
- Default:
false
Share state for the current namespace.
By default, the state is isolated by namespace and flow, setting to
true
will allow to share the state between the same namespace
taskrunValue
- Type: boolean
- Dynamic: ✔️
- Required: ❌
- Default:
true
Isolate the state with taskrun.value
.
By default, the state will be isolated with
taskrun.value
(during iteration with each). Setting tofalse
will allow using the same state for every run of the iteration.
Outputs
count
- Type: integer
- Required: ❌
- Default:
0
The count of properties found in the state.
key
- Type: string
- Required: ❌
The key of the current state.
Definitions
Was this page helpful?