Working with the Datastore of a Workflow
In this guide you will learn how to create a datastore and use it to configure your workflow.
|This guide will build upon this guide.
To complete this guide you will need:
Roughly 10 minutes
The PAK Editor (Download here)
The Datastore can be seen as the Workflows main data storage component. At runtime, it is filled with all values that are created during Workflow execution. We can use these values as parameters for the Commands within.
In the PAK Editor, the Datastore acts as a global storage for constant values.
You should use the Datastore when…
you have a constant value which does not change and is consumed by multiple commands.
you want to use the same workflow with a different parameterization .
Values of the Datastore can either be added via the PAK Editor or by manually editing the resulting .json file.
After we opened a new workflow in the editor, we will see a Datastore tab right next to Dataflow Analysis. Once clicking on it, we have the option to add a new entry by clicking on the „+“-button (2). We can now give our entry a name, for example „Testkey“ (3). Our value will be „Testvalue“ (4). After that click on Save (5) on the bottom of the tab.
|Do not forget to also save the Workflow after editing your Datastore
|Whenever we save a Workflow whose Datastore is not empty, a new .json file with the same name as the Workflow will be created in the same directory
Let’s have a look into the .json file. It is located in the same directory as the Workflow. Navigate to said directory and open the .json file with a text editor of your choosing. You should now see the following JSON.
When we for example change the value of Testkey to „Hello World“, we simply edit our file to include
"value": "Hello World"
After saving the File and switching back to the PAK Editor, we have to reload the changes. In order to do that, we click on the Load button and select our .json file. Now we can see the changes in the datastore tab.