workflowHandle

abstract fun <Res> workflowHandle(workflowName: String, workflowId: String, resTypeTag: TypeTag<Res>): Client.WorkflowHandle<Res>

Create a new WorkflowHandle for the provided workflow name and identifier.

Return

the workflow handle

Parameters

workflowName

the workflow name

workflowId

the workflow identifier

resTypeTag

type tag used to deserialize the invocation result


open fun <Res> workflowHandle(workflowName: String, workflowId: String, clazz: Class<Res>): Client.WorkflowHandle<Res>

Create a new WorkflowHandle for the provided workflow name and identifier.

Return

the workflow handle

Parameters

workflowName

the workflow name

workflowId

the workflow identifier

clazz

used to deserialize the workflow result


@ApiStatus.Experimental
open fun <SVC> workflowHandle(clazz: Class<SVC>, key: String): ClientServiceHandle<SVC>

EXPERIMENTAL API: Advanced API to invoke a Restate Workflow from the ingress with full control.

Create a handle that provides advanced invocation capabilities including:

  • Async request handling with CompletableFuture
  • Invocation options such as idempotency keys
  • Fire-and-forget requests via send()
  • Access to full Response metadata

Client client = Client.connect("http://localhost:8080");

// Use call() with method reference and wait for the result
Response<OrderResult> response = client.workflowHandle(OrderWorkflow.class, "order-123")
  .call(OrderWorkflow::start, new OrderRequest(...));

// Use send() for one-way invocation without waiting
SendResponse<OrderResult> sendResponse = client.workflowHandle(OrderWorkflow.class, "order-123")
  .send(OrderWorkflow::start, new OrderRequest(...));

For simple synchronous request-response interactions, consider using workflow instead.

Return

a handle to invoke the workflow with advanced options

Parameters

clazz

the workflow class annotated with Workflow

key

the key identifying the specific workflow instance