Workflows can be started both synchronously and asynchronously. You can use typed or untyped workflows stubs available
Temporal\Client\WorkflowClient. To create workflow client:
A Synchronous start initiates a Workflow and then waits for its completion. The started Workflow will not rely on the invocation process and will continue executing even if the waiting process crashes or stops.
Make sure to acquire workflow interface or class name you want to start. For example:
To start such workflow in sync mode:
An asynchronous start initiates a Workflow execution and immediately returns to the caller without waiting for a result. This is the most common way to start Workflows in a live environment.
To start a Workflow asynchronously pass workflow stub instance and start parameters into
Once started you can receive workflow ID and run ID via
WorkflowRun object returned by start method:
Connect to Running Workflows
If you need to wait for the completion of a Workflow after an asynchronous start, make a blocking call to
You can always connect to existing workflow and wait for its completion from another process using workflow id. Use
newUntypedRunningWorkflowStub for such purposes.