How to Use Account Store, Flow Store, and Memory Store

WebMethods.io Integration allows you to store key-value pairs and fetch them when required during a workflow execution. WebMethods.io Integration provides this functionality with three data store actions, namely, Account Store, Flow Store, and Memory Store. Though all the three data store actions seem to perform the same task, there are certain key differences in their features that make them ideal for different scenarios. Let’s now know exactly what each of these actions do and understand how to use them.

How to use Account Store

The Account Store action lets you store one or more key-value pairs with a global scope and retrieve them during any workflow execution. This means that, each key-value pair you store using the Account Store action can be retrieved while working with any workflow of any project in your tenant. Let’s understand this with the help of an example:

Let’s say we have two different projects: Default and Recipes. In Default, we will create a workflow to set a key-value pair. Next, we will retrieve the value of this key using the workflow created in the Recipe project.

Setting Key-Value Pairs

Step 1 - Add action to canvas

Add Account Store action on canvas and connect it to the Start and Stop icons as shown below:

Step 2 - Configure the Account Store action

Double-click the Account Store action icon, optionally provide a suitable name for this action, and then click Next. This will take you to the Account Store action configuration screen. Configure this action as per the instructions given below:

Account Store: Since we want to set a key-value pair, select Set from the drop down field.

Key (mandatory) - Provide a suitable name for the key you want to set.

Value - Enter the value you want to assign to the specified key.

You can set as many key-value pairs as you want by clicking on the + button. Once you have entered all the required details, click on Next, optionally Test the action (click here to know how), and then click on Done to return to the canvas.

Note: If you add a new key with a name that already exists but with a different value, webMethods.io Integration will overwrite the previously stored value of the key. If you want to delete the value of an existing key, keep the corresponding value field empty. Once you do that, Save and Run the workflow to delete the data in the value field permanently.

With this, you have successfully created and stored the key-value pairs. Once you add the key-value pairs, you can fetch them anytime in the future. Let’s now understand how to retrieve values of the stored keys.

Retrieving Values of Stored Keys

We will now understand how to retrieve the value of stored keys with Account Store action. For this, we will create a workflow in the project named Recipes with Account Store action to retrieve value of a stored key and then post its details on a Slack channel.

Step 1 - Add actions/connectors to canvas

Add Account Store action and Slack connector to canvas and connect them as shown below:

Now that the actions are added to the canvas, the next step is to configure these actions.

Step 2 - Configure Account Store action

Double-click the Account Store action icon, optionally provide a suitable name for this action, and then click Next. This will take you to the Account Store action configuration screen. Configure this action as per the instructions given below:

Account Store: Since we want to get the value for a stored key, select Get from the drop down field.

Key (mandatory) - Provide the name of the stored key of which value you want to retrieve. You can fetch values of multiple keys by clicking on the + button.

Once you have entered all the required details, click on Next, optionally Test the action (click here to know how), and then click on Done to return to the canvas.

Next, configure the Slack - Post New Message action as you would normally do to post what we retrieved earlier on the specified Slack channel.

Once this is done, Save the workflow. Now when you Run the workflow, webMethods.io Integration will automatically fetch the value of the key and post it on the specified Slack channel.

How to use Flow Store

The Flow Store action lets you store one or more key-value pairs and retrieve them when required within the same workflow of the project. Each key-value pair you set using the Flow Store has local scope by default. This means the keys stored inside a workflow can be retrieved from within the same workflow only.

Let’s understand how to set key-value pairs and retrieve their values using the Flow Store action with the help of an example.

Setting Key-Value Pairs

Step 1 - Add action to canvas

Add Flow Store action on the canvas and connect to the Start and Stop icons as shown below:

Now that the action is added to the canvas, the next step is to configure the Flow Store action.

Step 2 - Configure the Flow Store action

Double-click the Flow Store action icon, optionally provide a suitable name for this action, and then click Next. This will take you to the Flow Store action configuration screen. Configure this action as per the instructions given below:

Flow Store: Since we want to set a key-value pair, select Set from the drop down field.

Key (mandatory) - Provide a suitable name for the key you want to set.

Value - Enter the value you want to assign to the specified key. You can set as many key-value pairs as you want by clicking on the + button.

Note: If you add a new key with a name that already exists but with a different value, webMethods.io Integration will overwrite the previously stored value of the key.

Once you have entered all the required details, click on Next, optionally Test the action (click here to know how), and then click on Done to return to the canvas.

With this, you have successfully created and stored the key-value pair(s). Once you have created and stored the key-value pairs, you can retrieve them from the same workflow. Let’s now understand how to get or retrieve values of the stored keys.

Retrieving Values of Stored Keys

To get or retrieve values of the stored keys, we will have to add the Flow Store action in the same workflow where we had stored and then post its details on a Slack channel.

Step 1 - Add actions/connectors to the canvas

Add Flow Store and Slack action on the canvas and connect to the Start and Stop icons as shown below:

Now that the actions are added, the next step is to configure these actions.

Step 2 - Configure the Flow Store action

Double-click the Flow store action icon, optionally provide a suitable name for this action, and then click Next. This will take you to the Flow Store action configuration screen. Configure this action as per the instructions given below:

Flow Store: Since we want to get the value for a stored key, select Get from the drop down field.

Key (mandatory) - Provide the name of the stored key of which value you want to retrieve. You can fetch the value of multiple stored keys by clicking on the + button.

Once you have entered all the required details, click on Next, optionally Test the action (click here to know how), and then click on Done to return to the canvas.

Next, configure the Slack - Post New Message action as you would normally do to post the key value details we retrieved earlier on the specified Slack channel.

Once this is done, Save the workflow. Now when you Run the workflow, webMethods.io Integration will automatically fetch the value of the key and post it on the specified Slack channel.

Note: If you store value for a particular key in a workflow within a project and try to retrieve its value in another workflow within the same project, the workflow will not successfully execute.

How to use Memory Store

The Memory Store action lets you store and retrieve one or more key-value pairs which is limited to only one workflow run. This means that one Memory Store action can be executed only once. With a single Memory Store action, you can either set key-value pairs or retrieve values of stored keys. So, if want to Set key-value pairs and Get the values of stored keys in the same workflow, you will have to add two Memory Store actions in the same workflow.

Let’s now understand how to set key-value pairs and retrieve the values using the Memory Store action with the help of an example. Let’s say, we have a workflow that sets a key-value pair, get the values for the stored key, and post the value details on the specified Slack channel.

Setting Key-Value Pairs and Retrieving Values of Stored Keys

Step 1 - Add actions/connectors to canvas

Add two Memory Store actions, one for setting key-value pairs and another one for retrieving values of stored keys, to the canvas, along with the Slack connector. Connect these actions and connector to the Start and Stop icons as shown below:

Step 2 - Configure Memory Store action for Setting Key-Value Pairs

Double-click the first Memory store action icon to Set key-value pairs. Optionally provide a suitable name for this action, and then click Next. This will take you to the Memory Store action configuration screen. Configure this action as per the instructions given below:

Memory Store: Since we want to set a key-value pair, select Set from the drop down field.

Key (mandatory) - Provide a suitable name for the key you want to set.

Value - Enter the value you want to assign to the specified key. You can set as many key-value pairs as you want by clicking on the + button.



Once you have entered all the required details, click on Next, optionally Test the action (click here to know how), and then click on Done to return to the canvas.

With this, you have successfully created and stored the key-value pairs.

Step 3 - Configure the Memory Store action for retrieving values for stored keys

Double-click the second Memory store action icon to Get value details of the stored key. Optionally provide a suitable name for this action, and then click Next. This will take you to the Memory Store action configuration screen. Configure this action as per the instructions given below:

Memory Store: Since we want to get the value for a stored key, select Get from the drop down field.

Key (mandatory) - Provide a suitable name of the stored key of which value you want to retrieve. You can retrieve the value of multiple stored keys by clicking the + button.

Once this is done, click Next, optionally Test the action (click here to know how), and then click on Done to return to the canvas.

Next, configure the Slack - Post New Message action as you would normally do to post the key value details we retrieved earlier on the specified Slack channel.

Once this is done, Save the workflow. Now, when you Run the workflow, you will get the value details on the specified Slack channel. If you try to execute this workflow again however, you will not get the desired result, as each Memory Store action is limited to one workflow run only.