# Return value for workflows

**URL:** <https://community.temporal.io/t/return-value-for-workflows/6965>\
**Category:** Community Support\
**Tags:** typescript-sdk\
**Created:** [January 18, 2023, 6:22pm UTC](https://community.temporal.io/t/return-value-for-workflows/6965 "2023-01-18T18:22:58Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![antonio.perez](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/antonio.perez/32/2417_2.png) [@antonio.perez](https://community.temporal.io/u/antonio.perez)\
**Post date:** [January 20, 2023, 4:59pm UTC](https://community.temporal.io/t/return-value-for-workflows/6965/3 "2023-01-20T16:59:07Z")

</div>

Hello @nareshbhatia

> Looking at the TypeScript examples, workflows are returning unstructured message strings, usually returned by activities.

You can return any type of object it has to be serializable. please see:

- [https://github.com/temporalio/samples-typescript/blob/main/ejson/src/client.ts#L32](https://github.com/temporalio/samples-typescript/blob/main/ejson/src/client.ts#L32)
- [Passing functions from activities to workflows - #3 by bergundy](https://community.temporal.io/t/passing-functions-from-activities-to-workflows/5998/3)

> 1. What are the best practices around determining the return value from a workflow?

I think this is closely related to your business. What do you need your workflow function to return?

> 1. Would it be a good pattern to at least return the current workflow state so that the client can enable the next set of valid actions. Currently my client is using `await workflow.query('workflowState')` to get the current state, but that seems like an unnecessary round trip. Of course, I realize that the workflow state can change anytime, but this approach might cover some use cases without a round trip.

To get the internal workflow state the recommendation is to use queries for running workflows. [Build durable applications with Temporal | Temporal Documentation](https://docs.temporal.io/application-development/features?lang=typescript/#queries), and as you have mentioned you can return it as part of the workflow result.

> 1. How does the client access the return value (in TypeScript)?

`const result: Result = await handle.result()`

Have a look at this example [https://github.com/temporalio/samples-typescript/blob/main/ejson/src/client.ts#L32](https://github.com/temporalio/samples-typescript/blob/main/ejson/src/client.ts#L32)

Just in case it helps, with `handle.describe()` you can get other useful information, like the workflow status (completed, running…) : `await handle.describe()).status`

Antonio

---

_[View the full topic](https://community.temporal.io/t/return-value-for-workflows/6965)._
