toWorkflow

@ApiStatus.Experimental
inline fun <SVC : Any> toWorkflow(key: String): KRequestBuilder<SVC>

Create a builder for invoking a Restate workflow from within a handler.

Example usage:

@Handler
suspend fun myHandler(): String {
val result = toWorkflow<MyWorkflow>("workflow-123")
.request { run("input") }
.call()
.await()
return result
}

Return

a builder for creating typed requests

Parameters

SVC

the workflow class annotated with @Workflow

key

the key identifying the specific workflow instance