How to store a key:value so that it is accessible to workflow in it's next run and can retrieve and update the key's value in every run?

My use case is: In every run of the workflow it processes a file, it needs to check if the timestamp of the current file is greater than the timestamp of the file processed by the previous run. Our workflow was previously in AWS and we used parameter store, but now we want to use Temporal. It is just a timestamp value that we need to store during each run of the workflow. The current flow will retrieve the value stored, perform the comparison and update the timestamp with the current value. Since this is just a timestamp value, storing it in a database is not right I guess. What is the best way to do it?

Hi,

if you use schedules can return the the timestamp as part of the workflow result, and you should be able to access to the last completion result

Another option is creating a local activity that queries or get the workflow result of the previous run

Antonio

Thanks for your response. Since we want are not using schedules, I guess trying to get the workflow result by fecthing all the previous executions, and taking the job id of the last completed on and retrieving the result of that might work. I also wanted to ask does storing it as a search attribute would work or not ?

Search Attribute values can be eventually consistent, depending on the visibility store you use. I won’t rely on visibility API to implement business requirements that require strong consistency