# Query completed workflow history during testing

**URL:** <https://community.temporal.io/t/query-completed-workflow-history-during-testing/3932>\
**Category:** Community Support\
**Tags:** go-sdk, testing\
**Created:** [February 8, 2022, 2:28pm UTC](https://community.temporal.io/t/query-completed-workflow-history-during-testing/3932 "2022-02-08T14:28:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ankit.9644](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@ankit.9644](https://community.temporal.io/u/ankit.9644)\
**Post date:** [February 8, 2022, 2:28pm UTC](https://community.temporal.io/t/query-completed-workflow-history-during-testing/3932/1 "2022-02-08T14:28:24Z")

</div>

I am writing tests. I want to verify completed workflows as in the expected workflows were successfully executed/failed etc

To complete a scenario (migration of data) in current use case, I want to assert completion/failure of workflows or may be complete history.

Is this possible? I was looking into documentation and found `QueryWorkflow` but it seems it is for running workflow and not completed workflows.

Thank you

---

<div class="post-metadata">

**Author:** ![Chad\_Retz](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/chad_retz/32/1396_2.png) [@Chad\_Retz](https://community.temporal.io/u/Chad_Retz)\
**Post date:** [February 8, 2022, 3:03pm UTC](https://community.temporal.io/t/query-completed-workflow-history-during-testing/3932/2 "2022-02-08T15:03:23Z")

</div>

> [@ankit.9644](#):
>
> To complete a scenario (migration of data) in current use case, I want to assert completion/failure of workflows or may be complete history.

A `client.GetWorkflow(...)` returns a future that, if you `Get(...)` on it, it will either unmarshal the result into the second param and return no error on success, or return an error if the workflow failed.

> [@ankit.9644](#):
>
> Is this possible? I was looking into documentation and found `QueryWorkflow` but it seems it is for running workflow and not completed workflows.

You can absolutely execute a query on a completed workflow (I can provide a brief explainer on how this works if desired). It is a normal thing to do. Usually you’d count on the workflow result or error to relay completion info, but you can use a query to relay status which is especially useful if you also want to call while the workflow is running.
