# Can I persist retrievable data in a workflow that shared by activities?

**URL:** <https://community.temporal.io/t/can-i-persist-retrievable-data-in-a-workflow-that-shared-by-activities/1515>\
**Category:** Community Support\
**Tags:** go-sdk\
**Created:** [February 16, 2021, 1:49am UTC](https://community.temporal.io/t/can-i-persist-retrievable-data-in-a-workflow-that-shared-by-activities/1515 "2021-02-16T01:49:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yu\_Pan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/yu_pan/32/735_2.png) [@Yu\_Pan](https://community.temporal.io/u/Yu_Pan)\
**Post date:** [February 16, 2021, 1:49am UTC](https://community.temporal.io/t/can-i-persist-retrievable-data-in-a-workflow-that-shared-by-activities/1515/1 "2021-02-16T01:49:39Z")

</div>

I’m new to Temporal. I was wondering, is it possible to store some data structure in a running workflow, I want the data can be shared between activities and retrievable from outside by using some SDK method. If it’s possible, would you please direct me to the SDK method that I should use.

btw. I read through all the examples you provide, none of them is related to persist retrievable data in workflows.

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [February 16, 2021, 1:52am UTC](https://community.temporal.io/t/can-i-persist-retrievable-data-in-a-workflow-that-shared-by-activities/1515/2 "2021-02-16T01:52:01Z")

</div>

All the data inside the workflow is always persisted. So you don’t need to talk to persistence or use special data structures. Just use whatever data structure you want and it will be durable.

To retrieve data from workflow use [query](https://docs.temporal.io/docs/java-quick-start/#query) feature.

---

<div class="post-metadata">

**Author:** ![Yu\_Pan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/yu_pan/32/735_2.png) [@Yu\_Pan](https://community.temporal.io/u/Yu_Pan)\
**Post date:** [February 16, 2021, 2:06am UTC](https://community.temporal.io/t/can-i-persist-retrievable-data-in-a-workflow-that-shared-by-activities/1515/3 "2021-02-16T02:06:47Z")

</div>

Thanks for your quick reply.

For example, I have 1 workflow with 5 activities. Each activity will take 1 day to process and the outcome will be stored in a data structure shared across all 5 activities. I know this is very normal situation that Temporal can 100% handle.  
When I say “outside”, actually we want to have a RESTful API which is able to query the running workflow and retrieve the “shared data structure”. Would you please point me to a Temporal Go SDK method for this feature?

TIA

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [February 16, 2021, 2:44am UTC](https://community.temporal.io/t/can-i-persist-retrievable-data-in-a-workflow-that-shared-by-activities/1515/4 "2021-02-16T02:44:55Z")

</div>

Sure, [here is the Go query sample.](https://github.com/temporalio/samples-go/blob/master/query/query_workflow.go)

---

<div class="post-metadata">

**Author:** ![Yu\_Pan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/yu_pan/32/735_2.png) [@Yu\_Pan](https://community.temporal.io/u/Yu_Pan)\
**Post date:** [February 16, 2021, 5:23am UTC](https://community.temporal.io/t/can-i-persist-retrievable-data-in-a-workflow-that-shared-by-activities/1515/5 "2021-02-16T05:23:43Z")

</div>

Thanks a lot.
