Query completed workflow history during testing

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

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.

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.