Describes how to pass user or application metadata between login and post-login Actions.
Actions Transaction Metadata is currently in Early Access. To learn more, read Product Release Stages.
Actions Transaction Metadata stores, accesses, and/or shares, custom metadata within a post-login Action for the duration of a transaction.Previously, each Action operated independently, making it difficult to pass information between them. With Actions Transaction Metadata, now it’s possible to:
Share data across Actions, such as API responses or intermediate calculations.
Eliminate the need to re-fetch or re-calculate the same information in different Actions.
Before using transaction metadata in development, we recommend reviewing the limitations. To learn more, read Actions Limitations.
Use the post-login API objectapi.transaction.setMetadata to set the key/value pair in order to store transaction metadata.Use the post-login Event objectevent.transaction.metadata to access stored key/value pair in the same Action or subsequent Actions on the post-login trigger for a single execution.The API and Event objects accept the following parameters:
Value
Type
Description
Key
String
The key of the metadata property to be set.
Value
String, Number, Boolean
The value of the metadata property. Set to null removes the property.
Using Actions Transaction Metadata could cause a nominal additional latency. Any latency would be proportional to the metadata payload size and would be relevant when Action suspensions happen. For example, triggering , redirecting from Actions, or rendering Forms, could cause latency issues due to the need of reloading data from storage.Still, the potential latency should be minimal than the redundant outgoing HTTP requests to retrieve data the sequence of Actions needs.
Action 2Log the key as custom_tx_id and the value as xyz123. Then, set custom_tx_id to abc456 to log again with the latest value for custom_tx_id in the transaction metadata.
Preserve transaction metadata during redirects. Values are available when users continue the authentication flow.Action 1Sets a custom_tx_id in the transaction metadata.
Action 2Redirects to an external site sending a token with the custom_tx_id from the transaction metadata. Then it compares the custom_tx_id value at the transaction metadata with the one passed to the external site that has been sent back in the payload of another token.
Render Forms using Actions and transaction metadata values would be preserved and available when users continue the authentication flow.To learn more about using Forms with Actions, read Render Forms using Actions.Action 1Sets a custom_tx_id in the transaction metadata.
Action 2Renders a Form passing the custom_tx_id from the transaction metadata as vars parameter. Then it compares the custom_tx_id value at the transaction metadata with the one passed to the Form, when continuing the Actions execution.