Choose between REST and gRPC
Decide whether to use the Camunda REST API, gRPC, or both, and when job streaming beats polling for your job workers.
About
Use the Orchestration Cluster REST API by default. Add the Zeebe API (gRPC) alongside it only when your job workers need job streaming, or when the REST job activation limitations affect you.
- Every integration needs REST. Querying process data, such as process instances, user tasks, incidents, and variables, is available only through the REST API.
- Job streaming is the main reason to use gRPC. It is available only over gRPC and pushes jobs to workers without polling.
- You don't have to pick one. The official Java client and Spring Boot Starter can send commands over REST and stream jobs over gRPC at the same time.
- Not every client supports both protocols. The community Go client supports gRPC only. The official Python, C#, and Rust SDKs and the Orchestration Cluster API TypeScript client support REST only. The Go SDK uses REST and adds gRPC job streaming.
Compare the protocols
Use the following table to compare and understand the capabilities and transport details of the Orchestration Cluster REST API and the Zeebe gRPC API.
| Capability | REST (Orchestration Cluster API) | gRPC (Zeebe API) |
|---|---|---|
| Deploy resources, create, cancel, and modify process instances | Yes | Yes |
| Publish messages, broadcast signals, resolve incidents | Yes | Yes |
| Activate jobs with long polling | Yes (POST /v2/jobs/activation) | Yes (ActivateJobs) |
| Job streaming (jobs pushed to workers) | No | Yes (StreamActivatedJobs) |
| Search and query process data | Yes | No |
| Users, groups, roles, tenants, and authorizations | Yes | No |
| Transport | HTTP/1.1 or HTTP/2 | HTTP/2 only |
| Default Self-Managed port | 8080 | 26500 |
Choose a protocol for your scenario
Use the following table to choose the recommended protocol for your integration scenario, and understand the reason behind each recommendation.
| Scenario | Use | Why |
|---|---|---|
| New integration in any language | REST | Every official client defaults to REST, and REST covers everything except job streaming. |
| Browser app, custom task UI, reporting, or data sync | REST | Querying and user task operations are available only through REST. |
| Language without an official SDK | REST | Generate a client from the OpenAPI specification. |
| Job workers where a few seconds of activation delay is acceptable | REST with long polling | It works with the default client configuration and network setup. |
| Job workers that need low activation latency or run in a large fleet | REST for commands, gRPC for job streaming | Streaming removes the poll round trip and sends fewer activation requests. See Streaming or polling. |
| Brokers close to their CPU limit with high-volume clients | Consider gRPC | REST uses more broker CPU than gRPC at the same load. See Protocol: REST or gRPC. |
| Network allows only HTTP/1.1, or port 26500 is not reachable | REST only | gRPC requires HTTP/2 end to end. |
Migrating from ZeebeClient with gRPC-dependent behavior | Either | ZeebeClient preferred gRPC, while CamundaClient prefers REST. Set preferRestOverGrpc to false to keep gRPC as the default. |
If gRPC can't reach your cluster, stay on REST and tune long polling. Job streaming is the only capability you give up.
Streaming or polling
Both delivery methods reach the same engine, and a worker can use either.
| Long polling | Job streaming | |
|---|---|---|
| Protocol | REST or gRPC | gRPC only |
| Activation latency | Depends on the poll interval and cluster size | Lower, because the broker pushes jobs as they become available |
| Requests at low load | About one activation request per job | Far fewer activation requests, because most jobs arrive by push |
| Draining a backlog | Serves jobs that are already waiting | Pushes new jobs only. Streaming job workers bundle a backup poll to pick up jobs created before the worker started. |
| Network requirements | Standard HTTP | Long-lived HTTP/2 connections that proxies and load balancers must not close |
In Camunda's SDK performance tests, streaming and polling reached about the same throughput when draining a backlog. The difference showed up under light and steady load and in large worker fleets:
- Streaming sends fewer activation requests and uses less broker CPU. With 100 workers receiving a trickle of jobs, streaming made a fraction of the activation requests polling made.
- Streaming reduces backpressure on job activation. In fleets of hundreds of worker processes, polling produced many more
RESOURCE_EXHAUSTEDresponses on activation than streaming. - Polling did not cause a thundering herd in these tests. Each long poll is held open until a job is available, so the number of requests stays close to one per job.
Benchmark results are sensitive to small changes, so treat them as directional, not as figures to size against. Profile your own workload before you tune. For the methodology and results, see the SDK performance matrix and the streaming vs polling findings for the community Go client.
Tune your workers
Apply the following recommendations to get the best throughput from your job workers without overloading the cluster.
- Scale CPU-bound handlers by adding processes, not workers. Adding workers within one process doesn't increase throughput when the handler is CPU-bound.
- Don't add processes beyond what the cluster can take. Once the cluster is at its limit, each extra process only adds connections and activation requests.
- Share a worker name across small groups of workers. The gateway aggregates streams that target the same job type, worker name, timeout, and fetch variables. See how job streaming works.
- Use
fetchVariablesand a sensiblemaxJobsActive. Fetch only the variables the handler needs, and size the worker's capacity for its job timeout. See writing good workers. - Check how your client handles
RESOURCE_EXHAUSTED. Many Camunda SDKs back off automatically and let you tune the backpressure response profile. Consult the documentation and source code of your client. See also technical error handling.
Choose a client
Use the following table to compare the default protocol, gRPC support, and job streaming support of each Camunda client.
| Client | Default protocol | gRPC | Job streaming |
|---|---|---|---|
| Camunda Java Client | REST | Yes, with preferRestOverGrpc(false) and a grpcAddress | Opt in per worker with streamEnabled(true) |
| Camunda Spring Boot Starter | REST | Yes, with prefer-rest-over-grpc: false | Opt in with stream-enabled: true |
TypeScript SDK (@camunda8/sdk) | REST | Yes | Yes |
| Orchestration Cluster API TypeScript client | REST | No | No |
| C# SDK | REST | No | No |
| Python SDK | REST | No | No |
| Go SDK (Technical Preview) | REST | Streaming worker only | Yes, with NewStreamJobWorker |
| Rust SDK (Technical Preview) | REST | No | No |
When you configure both addresses and enable streaming, the Java client sends commands and polls over REST and streams jobs over gRPC. Both endpoints must be reachable from the worker.
The Go SDK can stream jobs from 8.7 and 8.8 clusters. It uses REST for all other operations.
Community Go client
The community-maintained zeebe-client-go supports gRPC only, for both polling and streaming. It doesn't use REST. Camunda does not support community clients as part of its commercial services.
- Before v8.7.0, job streaming can stall under high volume. Use v8.7.0 or later to stream jobs.
- Use v8.7.1 or later for the fixes that reduce idle polling cost, avoid stranding jobs on shutdown, and recycle streams after a gateway scale-out or restart.
Configure the protocol in the Java client and Spring Boot Starter
Configure two settings to define the protocol:
prefer-rest-over-grpcfor commands.stream-enabledfor job delivery.
| Setup | prefer-rest-over-grpc | stream-enabled | gRPC address needed |
|---|---|---|---|
| REST only (default) | true | false | No |
| REST commands, gRPC job streaming | true | true | Yes |
| gRPC by default | false | true or false | Yes |
Example: Spring Boot Starter, REST commands with gRPC job streaming:
camunda:
client:
rest-address: http://localhost:8080
grpc-address: http://localhost:26500
prefer-rest-over-grpc: true # default; false sends commands over gRPC
worker:
defaults:
stream-enabled: true # streams jobs over gRPC
Example: Java client, the same setup:
CamundaClient client = CamundaClient.newClientBuilder()
.restAddress(URI.create("http://localhost:8080"))
.grpcAddress(URI.create("http://localhost:26500"))
.build(); // add .preferRestOverGrpc(false) to make gRPC the default
client.newWorker()
.jobType("payment")
.handler(handler)
.streamEnabled(true)
.open();
Addresses must include the scheme (http:// or https://).
To migrate from ZeebeClient, see REST vs gRPC selection. For all client settings, see the Java client and Spring Boot Starter documentation.
REST job activation limitations
If any of these limitations affect you, use gRPC for job activation, or work around them as follows:
| Limitation | Effect | Mitigation |
|---|---|---|
| Long polls can outlive a closed client | The gateway doesn't detect the closed connection, so the request can still activate jobs. They stay locked until their job timeout elapses. | Use gRPC for job activation, or disable long polling for REST job activation. |
| Client-side response size isn't limited | Jobs from all partitions are combined into one response, which can be several times the maximum message size. | Lower maxJobsActive and use fetchVariables to fetch only what the handler needs. |
| Higher broker CPU under load | REST uses about 10 to 15% more broker CPU than gRPC at the same load. | Size your brokers with headroom. See Protocol: REST or gRPC. |
Deployment and network considerations
gRPC needs HTTP/2 end to end, its own port and ingress, and its own TLS settings. REST needs none of these.
- Protocol: REST works over HTTP/1.1 or HTTP/2. gRPC requires HTTP/2 through every proxy and load balancer between the client and the gateway.
- Ports: REST listens on 8080. gRPC listens on 26500.
- Ingress (Helm): gRPC uses its own Ingress, configured under
orchestration.ingress.grpc. It inherits nothing fromglobal.ingress.annotations. Ingress-nginx needsnginx.ingress.kubernetes.io/backend-protocol: "GRPC". - TLS: You configure each protocol separately. See Configure Orchestration REST and gRPC TLS modes.
- Long-lived streams: Proxies that close idle HTTP/2 connections end job streams with
504errors. See job streaming.