For the complete documentation index, see llms.txt.
Skip to main content
Version: 8.11 (unreleased)

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.

CapabilityREST (Orchestration Cluster API)gRPC (Zeebe API)
Deploy resources, create, cancel, and modify process instancesYesYes
Publish messages, broadcast signals, resolve incidentsYesYes
Activate jobs with long pollingYes (POST /v2/jobs/activation)Yes (ActivateJobs)
Job streaming (jobs pushed to workers)NoYes (StreamActivatedJobs)
Search and query process dataYesNo
Users, groups, roles, tenants, and authorizationsYesNo
TransportHTTP/1.1 or HTTP/2HTTP/2 only
Default Self-Managed port808026500

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.

ScenarioUseWhy
New integration in any languageRESTEvery official client defaults to REST, and REST covers everything except job streaming.
Browser app, custom task UI, reporting, or data syncRESTQuerying and user task operations are available only through REST.
Language without an official SDKRESTGenerate a client from the OpenAPI specification.
Job workers where a few seconds of activation delay is acceptableREST with long pollingIt works with the default client configuration and network setup.
Job workers that need low activation latency or run in a large fleetREST for commands, gRPC for job streamingStreaming removes the poll round trip and sends fewer activation requests. See Streaming or polling.
Brokers close to their CPU limit with high-volume clientsConsider gRPCREST 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 reachableREST onlygRPC requires HTTP/2 end to end.
Migrating from ZeebeClient with gRPC-dependent behaviorEitherZeebeClient preferred gRPC, while CamundaClient prefers REST. Set preferRestOverGrpc to false to keep gRPC as the default.
REST fallback

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 pollingJob streaming
ProtocolREST or gRPCgRPC only
Activation latencyDepends on the poll interval and cluster sizeLower, because the broker pushes jobs as they become available
Requests at low loadAbout one activation request per jobFar fewer activation requests, because most jobs arrive by push
Draining a backlogServes jobs that are already waitingPushes new jobs only. Streaming job workers bundle a backup poll to pick up jobs created before the worker started.
Network requirementsStandard HTTPLong-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_EXHAUSTED responses 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 fetchVariables and a sensible maxJobsActive. 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.

ClientDefault protocolgRPCJob streaming
Camunda Java ClientRESTYes, with preferRestOverGrpc(false) and a grpcAddressOpt in per worker with streamEnabled(true)
Camunda Spring Boot StarterRESTYes, with prefer-rest-over-grpc: falseOpt in with stream-enabled: true
TypeScript SDK (@camunda8/sdk)RESTYesYes
Orchestration Cluster API TypeScript clientRESTNoNo
C# SDKRESTNoNo
Python SDKRESTNoNo
Go SDK (Technical Preview)RESTStreaming worker onlyYes, with NewStreamJobWorker
Rust SDK (Technical Preview)RESTNoNo

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-grpc for commands.
  • stream-enabled for job delivery.
Setupprefer-rest-over-grpcstream-enabledgRPC address needed
REST only (default)truefalseNo
REST commands, gRPC job streamingtruetrueYes
gRPC by defaultfalsetrue or falseYes

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();
note

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:

LimitationEffectMitigation
Long polls can outlive a closed clientThe 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 limitedJobs 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 loadREST 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 from global.ingress.annotations. Ingress-nginx needs nginx.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 504 errors. See job streaming.