Skip to main content
Version: 8.5

Java client


To use the Java client library, declare the following Maven dependency in your project:


If you are using Gradle, declare the following:

implementation 'io.camunda:zeebe-client-java:${zeebe.version}'

Use the latest released version from Maven Central.


In Java code, instantiate the client as follows:

  private static final String zeebeGrpc = "[Zeebe Address e.g.]";
private static final String zeebeRest = "[Zeebe Address e.g.]";
private static final String audience = "[Zeebe Token Audience, e.g.,]";
private static final String clientId = "[Client ID, e.g., FmT7K8gVv_FcwiUhc8U-fAJ9wph0Kn~P]";
private static final String clientSecret = "[Client Secret]";
private static final String oAuthAPI = "[OAuth API, e.g.,] ";

public static void main(String[] args) {
OAuthCredentialsProvider credentialsProvider =
new OAuthCredentialsProviderBuilder()

try (ZeebeClient client = ZeebeClient.newClientBuilder()
.build()) {

Let's go over this code snippet line by line:

  1. Declare a few variables to define the connection properties. These values can be taken from the connection information on the Client Credentials page. Note that clientSecret is only visible when you create the client credentials.
  2. Create the credentials provider for the OAuth protocol. This is needed to authenticate your client.
  3. Create the client by passing in the address of the cluster we want to connect to and the credentials provider from the step above. Note that a client should be closed after usage, which is easily achieved by the try-with-resources statement.
  4. Send a test request to verify the connection was established.

Refer to io.camunda.zeebe.client.ZeebeClientBuilder for a description of all available configuration properties.

Another (more compact) option is to pass in the connection settings via environment variables:

export ZEEBE_GRPC_ADDRESS='[Zeebe gRPC Address]'
export ZEEBE_REST_ADDRESS='[Zeebe REST Address]'
export ZEEBE_CLIENT_ID='[Client ID]'
export ZEEBE_CLIENT_SECRET='[Client Secret]'

When you create client credentials in Camunda 8, you have the option to download a file with the lines above filled out for you.

Given these environment variables, you can instantiate the client as follows:

ZeebeClient client =


The official Java client library API documentation can be found here. These are standard Javadocs, so your favorite JVM IDE will be able to install them locally as well.

Next steps

  • Getting Started Guide: A comprehensive tutorial that covers Camunda Modeler, Operate, and the Java client.
  • Job worker: An introduction to the Java client's job worker.
  • Logging: An introduction to configuring logging for a Zeebe client.
  • Writing tests: An introduction to unit testing processes.
  • Examples: A collection of specific examples for different use cases.