Kotlin Coroutines to start workflows

We are currently initiating a temporal workflow using a kotlin coroutine, which uses a pool of threads. In Kotlin, multiple coroutines can use a single thread. I understand temporal requires a dedicated thread for each execution of workflow. Just want to validate if our approach is ok. Thank you!

Starting and executing workflows are not related. Are you asking about starting them or how they are executed?

I meant starting i.e. calling @WorkflowMethod using a kotlin coroutine

We might expose an async API to start a workflow which would allow mapping it to a coroutine. But this is not yet available. Please file an issue.

Interesting… Filed an issue - Expose an async API to start a workflow which would allow mapping it to a Kotlin coroutine · Issue #1849 · temporalio/sdk-java · GitHub

We have a production system which does that so would like to understand the impact & any possible side effects.

Also would like to understand why existing async API would not suffice?

 // Start Workflow asynchronously and call its "yourWFMethod" Workflow method
 WorkflowClient.start(workflow::yourWFMethod);

The existing API is a synchronous call to start a workflow, which can take hundreds of milliseconds or even more in some failure scenarios. We plan to expose a fully async API for this operation.