Skip to main content

Persist Data Component

Persist small amounts of data that will be available later in the execution or in subsequent executions of the Instance

Component key: persist-data

Description

The persist data component provides functionality to persist small amounts of data for use during an integration execution or in subsequent integration executions. This is helpful if you want to save a bit of data during an integration invocation for use in a later step, or in a subsequent execution.

For details on how to persist data between flow invocations, see the building integrations article.

Data can be persisted in three ways:

  • For just the duration of the execution. Data persists ephemerally for only as long as a flow runs. You might use the Execution - actions, for example, as an accumulator in a loop.
  • Between executions of a specific flow. Data persists between instance executions and is scoped for a specific flow. One flow cannot access another flow's data. The Flow - actions are handy for saving data from one flow's run, and referencing it in a subsequent run of that same flow.
  • Globally, for all flows in an instance. Data persists between instance executions and is scoped for the entire instance. The Cross Flow - actions let flows within an instance reference one another's persisted data.
Persisted data implementation

When an execution starts, it loads persisted data from storage. When the execution finishes, it writes out its state to storage if any state was changed.

Note that if two executions run at the same time and write out values for the same keys, the execution that finishes last will overwrite values for any of the same keys that the first execution wrote.

Viewing Persisted Data Usage

The Get Persist Data Usage Metrics action will yield the size of flow, cross-flow and integration-scoped persisted data in bytes. Empty persisted data will yield a size of 2 bytes, which represents an empy object {}. The maximum amount of data you can persist is 64 MB (or 67108864 bytes).

Actions

Cross Flow - Add Value To Set

Add a value to the set with the specified key, creating the set as needed | key: addCrossFlowValueToSet


Cross Flow - Append Value To List

Append a value to the list with the specified key, creating the list as needed | key: appendCrossFlowValueToList


Cross Flow - Clear All State

Delete all cross-flow state stored for this instance | key: removeCrossFlowState


Cross Flow - Decrement Value

Decrement the stored integer value with the specified key by the specified amount | key: decrementCrossFlowValue


Cross Flow - Get Value

Get the value with the specified key, returning the specified default value if key not present | key: getCrossFlowValue

Output Example Payload

{
"data": "Example Saved Value"
}

Cross Flow - Increment Value

Increment the stored integer value with the specified key by the specified amount | key: incrementCrossFlowValue


Cross Flow - List Keys

List all keys persisted at the cross-flow level | key: listCrossFlowKeys


Cross Flow - Remove Value

Remove the value with the specified key | key: removeCrossFlowValue


Cross Flow - Remove Value From List

Remove the value from the list with the specified key | key: removeCrossFlowValueFromList


Cross Flow - Remove Value From Set

Remove the value from the set with the specified key | key: removeCrossFlowValueFromSet


Cross Flow - Save Current Time

Save the current time in UTC using the specified key | key: saveCrossFlowCurrentTime


Cross Flow - Save Value

Save a value with the specified key for use at a later time | key: saveCrossFlowValue


Execution - Add Value To Set

Add a value to the set with the specified key, creating the set as needed | key: addExecutionValueToSet


Execution - Append Value To List

Append a value to the list with the specified key, creating the list as needed | key: appendExecutionValueToList


Execution - Clear All State

Delete all execution state | key: removeExecutionState


Execution - Decrement Value

Decrement the stored integer value with the specified key by the specified amount | key: decrementExecutionValue


Execution - Get Value

Get the value with the specified key, returning the specified default value if key not present | key: getExecutionValue

Output Example Payload

{
"data": "Example Saved Value"
}

Execution - Increment Value

Increment the stored integer value with the specified key by the specified amount | key: incrementExecutionValue


Execution - List Keys

List all keys persisted at the execution level | key: listExecutionKeys


Execution - Remove Value

Remove the value with the specified key | key: removeExecutionValue


Execution - Remove Value From List

Remove the value from the list with the specified key | key: removeExecutionValueFromList


Execution - Remove Value From Set

Remove the value from the set with the specified key | key: removeExecutionValueFromSet


Execution - Save Current Time

Save the current time in UTC using the specified key | key: saveExecutionCurrentTime


Execution - Save Value

Save a value with the specified key for use at a later time | key: saveExecutionValue


Flow - Add Value To Set

Add a value to the set with the specified key, creating the set as needed | key: addInstanceValueToSet


Flow - Append Value To List

Append a value to the list with the specified key, creating the list as needed | key: appendInstanceValueToList


Flow - Clear All State

Delete all flow state stored for this instance | key: removeInstanceState


Flow - Decrement Value

Decrement the stored integer value with the specified key by the specified amount | key: decrementInstanceValue


Flow - Get Value

Get the value with the specified key, returning the specified default value if key not present | key: getInstanceValue

Output Example Payload

{
"data": "Example Saved Value"
}

Flow - Increment Value

Increment the stored integer value with the specified key by the specified amount | key: incrementInstanceValue


Flow - List Keys

List all keys persisted at the flow level | key: listInstanceKeys


Flow - Remove Value

Remove the value with the specified key | key: removeInstanceValue


Flow - Remove Value From List

Remove the value from the list with the specified key | key: removeInstanceValueFromList


Flow - Remove Value From Set

Remove the value from the set with the specified key | key: removeInstanceValueFromSet


Flow - Save Current Time

Save the current time in UTC using the specified key | key: saveInstanceCurrentTime


Flow - Save Value

Save a value with the specified key for use at a later time | key: saveInstanceValue


Get Persist Data Usage Metrics

Get usage metrics for persisted data. Persisted data can total 64 MB. | key: getUsage

Output Example Payload

{
"data": {
"flowStateBytes": 100,
"crossFlowStateBytes": 2,
"integrationFlowStateBytes": 50,
"totalBytes": 152,
"maxAllowedBytes": 67108864
}
}

Integration - Add Value To Set

Add a value to the set with the specified key, creating the set as needed | key: addIntegrationValueToSet


Integration - Append Value To List

Append a value to the list with the specified key, creating the list as needed | key: appendIntegrationValueToList


Integration - Clear All State

Delete all integration state stored for all instances of this integration | key: removeIntegrationState


Integration - Decrement Value

Decrement the stored integer value with the specified key by the specified amount | key: decrementIntegrationValue


Integration - Get Value

Get the value with the specified key, returning the specified default value if key not present | key: getIntegrationValue

Output Example Payload

{
"data": "Example Saved Value"
}

Integration - Increment Value

Increment the stored integer value with the specified key by the specified amount | key: incrementIntegrationValue


Integration - List Keys

List all keys persisted at the integration level | key: listIntegrationKeys


Integration - Remove Value

Remove the value with the specified key | key: removeIntegrationValue


Integration - Remove Value From List

Remove the value from the list with the specified key | key: removeIntegrationValueFromList


Integration - Remove Value From Set

Remove the value from the set with the specified key | key: removeIntegrationValueFromSet


Integration - Save Current Time

Save the current time in UTC using the specified key | key: saveIntegrationCurrentTime


Integration - Save Value

Save a value with the specified key for use at a later time | key: saveIntegrationValue