Temporal Client - Ruby SDK
This page shows how to do the following:
Create a Temporal Client
How to create a Temporal Client using the Temporal Ruby SDK
A Temporal Client enables you to communicate with the Temporal Service. Communication with a Temporal Service includes, but isn't limited to, the following:
- Starting Workflow Executions.
- Sending Signals to Workflow Executions.
- Sending Queries to Workflow Executions.
- Getting the results of a Workflow Execution.
- Providing an Activity Task Token.
A Temporal Client cannot be initialized and used inside a Workflow. However, it is acceptable and common to use a Temporal Client inside an Activity to communicate with a Temporal Service.
When running a Temporal Service locally (such as via Temporal CLI), the number of connection options required is minimal.
Most SDKs default to localhost or a standard port (127.0.0.1:7233
).
Connect to Temporal Cloud
How to connect to Temporal Cloud using the Temporal Ruby SDK
When connecting to Temporal Cloud, you must provide:
- The Temporal Cloud Namespace Id
- The Namespace's gRPC endpoint
- mTLS CA certificate
- mTLS private key
See How to manage certificates in Temporal Cloud for details.
Start a Workflow
How to start a Workflow using the Temporal Ruby SDK
To start a Workflow Execution, supply:
- A Task Queue
- A Workflow Type
- Input arguments
- Workflow options such as Workflow Id
Get Workflow results
How to get the results of a Workflow Execution using the Temporal Ruby SDK
Once a Workflow Execution is started, the Workflow Id and Run Id can be used to uniquely identify it.
You can block until the result is available, or retrieve it later using the handle.
You can also use Queries to access Workflow state and results while the Workflow is running.