All constructor parameters for configuration are optional. If no configuration is provided, the SDK will use environment variables to configure itself.
Optional
options: {Iterate through all known partitions and activate jobs up to the requested maximum.
The parameter inputVariablesDto
is a Dto to decode the job payload. The customHeadersDto
parameter is a Dto to decode the custom headers.
Pass in a Dto class that extends LosslessDto to provide both type information in your code,
and safe interoperability with applications that use the int64
type in variables.
Assign a user task with the given key to the given assignee.
Documentation: https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/assign-user-task/
Assign a user task with the given key to the given assignee.
Documentation: https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/assign-user-task/
Broadcast a signal.
Documentation: https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/broadcast-signal/
This is a generic method to call an API endpoint. Use this method to call any REST API endpoint in the Camunda 8 cluster. TODO: This does not currently support multipart form-data, but it will.
This is a generic method to call an API endpoint. Use this method to call any REST API endpoint in the Camunda 8 cluster. TODO: This does not currently support multipart form-data, but it will.
Complete a job with the given payload, which allows completing the associated service task.
Documentation: https://docs.camunda.io/docs/next/apis-tools/camunda-api-rest/specifications/complete-job/
Complete a user task with the given key. The method either completes the task or throws 400, 404, or 409.
Documentation: https://docs.camunda.io/docs/apis-tools/zeebe-api-rest/specifications/complete-a-user-task/
Publish a Message and correlates it to a subscription. If correlation is successful it will return the first process instance key the message correlated with.
Documentation: https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/correlate-a-message/
Create document link
Create a link to a document in the Camunda 8 cluster. Note that this is currently supported for document stores of type: AWS, GCP
Documentation: https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/create-document-link/
Create a new polling Job Worker.
You can pass in an optional winston.Logger instance as logger
. This enables you to have distinct logging levels for different workers.
Polling: The worker polls periodically. If no jobs are available, the poll stays open for 10 seconds. If no jobs become available in that time, the poll is closed, and the worker polls again. When jobs are available, they are returned, and the worker polls again for more jobs as soon as it has capacity for more jobs.
Create and start a process instance. This method does not await the outcome of the process. For that, use createProcessInstanceWithResult
.
Documentation: https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/create-process-instance/
Create and start a process instance. This method awaits the outcome of the process.
Documentation: https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/create-process-instance/
Optional
fetchVariables?: string[]An array of variable names to fetch. If not supplied, all visible variables in the root scope will be returned
Create and start a process instance. This method awaits the outcome of the process.
Documentation: https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/create-process-instance/
Optional
fetchVariables?: string[]An array of variable names to fetch. If not supplied, all visible variables in the root scope will be returned
A Dto specifying the shape of the output variables. If not supplied, the output variables will be returned as a LosslessDto
of type unknown
.
Create a user.
Documentation: https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/create-user/
Delete a document from the Camunda 8 cluster.
Documentation: https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/delete-document/
Deletes a deployed resource. This can be a process definition, decision requirements definition, or form definition deployed using the deploy resources endpoint. Specify the resource you want to delete in the resourceKey parameter.
Documentation: https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/delete-resource/
Deploy resources to the broker.
An array of binary data strings representing the resources to deploy.
Optional
tenantId: stringOptional tenant ID to deploy the resources to. If not provided, the default tenant ID is used.
Documentation: https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/deploy-resources/
Deploy resources to Camunda 8 from files
an array of file paths
Download a document from the Camunda 8 cluster.
Note that this is currently supported for document stores of type: AWS, GCP, in-memory, local Documentation: https://docs.camunda.io/docs/8.7/apis-tools/camunda-api-rest/specifications/get-document/
Report a business error (i.e. non-technical) that occurs while processing a job.
Documentation: https://docs.camunda.io/docs/next/apis-tools/camunda-api-rest/specifications/report-error-for-job/
Evaluate decision
Evaluates a decision. You specify the decision to evaluate either by using its unique key (as returned by DeployResource), or using the decision ID. When using the decision ID, the latest deployed version of the decision is used.
Documentation: https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/evaluate-decision/
Fails a job using the provided job key. This method sends a POST request to the endpoint '/jobs/{jobKey}/fail' with the failure reason and other details specified in the failJobRequest object.
Documentation: https://docs.camunda.io/docs/next/apis-tools/camunda-api-rest/specifications/fail-job/
The authentication strategy to use for the Camunda 8 SDK. Defaults to 'OAUTH'.
If you are passing in a custom IHeadersProvider implementation, you can set this to 'NONE' to disable the default authentication.
Password for Basic Auth. Set this when using the BASIC
auth strategy with CAMUNDA_AUTH_STRATEGY
.
Username for Basic Auth. Set this when using the BASIC
auth strategy with CAMUNDA_AUTH_STRATEGY
.
The base url for the Admin Console API.
Credentials id for Admin Console and Modeler API
Credentials secret for Admin Console and Modeler API
The audience parameter for an Admin Console OAuth token request. Defaults to api.cloud.camunda.io when connecting to Camunda SaaS, and '' otherwise
The password for Cookie authentication when CAMUNDA_AUTH_STRATEGY
is set to COOKIE
. Defaults to 'demo'
The login endpoint for Cookie authentication (for use with C8Run in 8.7). Defaults to http://localhost:8080/api/login
The username for Cookie authentication when CAMUNDA_AUTH_STRATEGY
is set to COOKIE
. Defaults to 'demo'
When using custom or self-signed certificates with mTLS, provide the path to the client certificate chain. Works with Zeebe gRPC.
When using custom or self-signed certificates with mTLS, provide the path to the client private key. Works with Zeebe gRPC.
In an environment using self-signed certificates, provide the path to the server certificate. Provide this to allow the client to connect to a server secured with this cert.
In an environment using self-signed certificates, provide the server certificate as a string. Provide this to allow the client to connect to a server secured with this cert.
Custom user agent
Maximum polling backoff time in milliseconds for Job Workers when an error is encountered. Defaults to 16000 (16 seconds).
The log level for logging. Defaults to 'info'. Values (in order of priority): 'error', 'warn', 'info', 'http', 'verbose', 'debug', 'silly'. Set to 'none' to suppress logging.
The base url for the Modeler API. Defaults to Camunda Saas - https://modeler.camunda.io/api
The audience parameter for a Modeler OAuth token request. Defaults to api.cloud.camunda.io when connecting to Camunda SaaS, and '' otherwise See: https://github.com/camunda/camunda-8-js-sdk/issues/60
Set to true to disable OAuth completely
The OAuth token (used for CAMUNDA_AUTH_STRATEGY "BEARER")
How soon in milliseconds before its expiration time a cached OAuth token should be considered expired. Defaults to 1000
The OAuth token exchange endpoint url
The base url for the Operate API
The audience parameter for an Operate OAuth token request. Defaults to operate.camunda.io
The base url for the Optimize API
The audience parameter for an Optimize OAuth token request. Defaults to optimize.camunda.io
Control TLS for Zeebe GRPC connections. Defaults to true.
Note: This setting interacts with the ZEEBE_INSECURE_CONNECTION
setting in zeebeGrpcSettings
.
CAMUNDA_SECURE_CONNECTION
is true and ZEEBE_INSECURE_CONNECTION
is false, a secure TLS connection will be used.CAMUNDA_SECURE_CONNECTION
is false or ZEEBE_INSECURE_CONNECTION
is true, an insecure connection will be used.CAMUNDA_SECURE_CONNECTION
to true and ZEEBE_INSECURE_CONNECTION
to true will result in a warning
and an insecure connection will be used.CAMUNDA_SECURE_CONNECTION
to false and ZEEBE_INSECURE_CONNECTION
to false will result in a warning
and an insecure connection will be used.Set to true to enable an output log file with debugging information and diagnostic traces to assist Camunda Support in technical support.
Optionally provide a file path for the support log. By default it will be emitted as camunda-support.log
The base url for the Tasklist API
The audience parameter for a Tasklist OAuth token request. Defaults to tasklist.camunda.io
The tenant id when multi-tenancy is enabled
The directory to cache OAuth tokens on-disk. Defaults to $HOME/.camunda
Set to true to disable disk caching of OAuth tokens and use memory caching only
Optional scope parameter for OAuth (needed by some OIDC, such as Microsoft Entra)
The audience parameter for a Zeebe OAuth token request. This is a synonym for and has precedence over ZEEBE_TOKEN_AUDIENCE. If this value is not set, ZEEBE_TOKEN_AUDIENCE will be used.
The address for the Zeebe gRPC Gateway. Defaults to localhost:26500
This is the client ID for the client credentials
This is the client secret for the client credentials
The address for the Zeebe gRPC Gateway. Defaults to localhost:26500. If a value is also provided for ZEEBE_ADDRESS, that value will be used preferentially.
The address for the Zeebe REST API. Defaults to localhost:8080
The audience parameter for a Zeebe OAuth token request. Defaults to zeebe.camunda.io
This channel argument controls the maximum number of pings that can be sent when there is no other data (data frame or header frame) to be sent. GRPC Core will not continue sending pings if we run over the limit. Setting it to 0 allows sending pings without sending data.
Minimum allowed time between a server receiving successive ping frames without sending any data frame. Int valued, milliseconds. Default: 90000
Defaults to 90000.
The time between the first and second connection attempts, in ms. Defaults to 1000.
This channel argument if set to 1 (0 : false; 1 : true), allows keepalive pings to be sent even if there are no calls in flight. Defaults to 1.
After a duration of this time the client/server pings its peer to see if the transport is still alive. Int valued, milliseconds. Defaults to 360000.
After waiting for a duration of this time, if the keepalive ping sender does not receive the ping ack, it will close the transport. Int valued, milliseconds. Defaults to 120000.
The maximum time between subsequent connection attempts, in ms. Defaults to 10000.
The minimum time between subsequent connection attempts, in ms. Default is 1000ms, but this can cause an SSL Handshake failure. This causes an intermittent failure in the Worker-LongPoll test when run against Camunda Cloud. Raised to 5000ms. See: https://github.com/grpc/grpc/issues/8382#issuecomment-259482949
Log level of Zeebe Client and Workers - 'DEBUG' | 'INFO' | 'NONE'. Defaults to 'INFO'
Zeebe client log output can be human-readable 'SIMPLE' or structured 'JSON'. Defaults to 'SIMPLE'
The gRPC channel can "jitter". This suppresses a connection error message if the channel comes back within this window in milliseconds. Defaults to 3000
Immediately connect to the Zeebe Gateway (issues a silent topology request). Defaults to false
This suppresses intermediate errors during initial connection negotiation. On Camunda SaaS this defaults to 6000, on Self-Managed to 0
Maximum number of retries of network operations before failing. Defaults to -1 (infinite retries)
When retrying failed network operations, retries back off to this maximum period. Defaults to 10s
Automate retrying operations that fail due to network conditions or broker backpressure. Defaults to true
How long in seconds the long poll Job Activation request is held open by a worker. Defaults to 60
After a long poll Job Activation request, this is the cool-off period in milliseconds before the worker requests more work. Defaults to 300
Use an insecure connection for Zeebe GRPC.
Note: This setting interacts with the CAMUNDA_SECURE_CONNECTION
setting.
ZEEBE_INSECURE_CONNECTION
is false and CAMUNDA_SECURE_CONNECTION
is true, a secure TLS connection will be used (recommended).ZEEBE_INSECURE_CONNECTION
is true or CAMUNDA_SECURE_CONNECTION
is false, an insecure connection will be used.ZEEBE_INSECURE_CONNECTION
to true and CAMUNDA_SECURE_CONNECTION
to true will result in a warning
and an insecure connection will be used.ZEEBE_INSECURE_CONNECTION
to false and CAMUNDA_SECURE_CONNECTION
to false will result in a warning
and an insecure connection will be used.Obtains the status of the current Camunda license.
Documentation: https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/get-status-of-camunda-license/
Get the user task by the user task key.
Documentation: https://docs.camunda.io/docs/next/apis-tools/camunda-api-rest/specifications/get-user-task/
Migrates a process instance to a new process definition. This request can contain multiple mapping instructions to define mapping between the active process instance's elements and target process definition elements. Use this to upgrade a process instance to a new version of a process or to a different process definition, e.g. to keep your running instances up-to-date with the latest process improvements.
Documentation: https://docs.camunda.io/docs/next/apis-tools/camunda-api-rest/specifications/migrate-process-instance/
Manage the permissions assigned to authorization.
Documentation: https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/patch-authorization/
Modify process instance
Modifies a running process instance. This request can contain multiple instructions to activate an element of the process or to terminate an active instance of an element. Use this to repair a process instance that is stuck on an element or took an unintended path. For example, because an external system is not available or doesn't respond as expected.
Documentation https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/modify-process-instance/
Set a precise, static time for the Zeebe engine's internal clock. When the clock is pinned, it remains at the specified time and does not advance. To change the time, the clock must be pinned again with a new timestamp, or reset.
Documentation: https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/pin-internal-clock/
Publish a single message. Messages are published to specific partitions computed from their correlation keys. This method does not wait for a correlation result. Use correlateMessage
for such use cases.
Documentation: https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/publish-a-message/
Resets the Zeebe engine's internal clock to the current system time, enabling it to tick in real-time. This operation is useful for returning the clock to normal behavior after it has been pinned to a specific time.
Documentation: https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/reset-internal-clock/
Marks the incident as resolved; most likely a call to Update job will be necessary to reset the job's retries, followed by this call.
Documentation: https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/resolve-incident/
Query process instances
Documentation: https://docs.camunda.io/docs/8.7/apis-tools/camunda-api-rest/specifications/query-process-instances-alpha/
Search users for tenant.
Documentation: https://docs.camunda.io/docs/next/apis-tools/camunda-api-rest/specifications/find-users/
Search users for tenant.
Documentation: https://docs.camunda.io/docs/next/apis-tools/camunda-api-rest/specifications/search-users-for-tenant/
Search for user tasks based on given criteria.
Documentation: https://docs.camunda.io/docs/8.7/apis-tools/camunda-api-rest/specifications/find-user-tasks/
Search for user task variables based on given criteria.
Documentation: https://docs.camunda.io/docs/next/apis-tools/camunda-api-rest/specifications/find-user-task-variables/
Search for process and local variables based on given criteria.
Documentation: https://docs.camunda.io/docs/next/apis-tools/camunda-api-rest/specifications/find-variables/
Remove the assignee of a task with the given key.
Documentation: https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/unassign-user-task/
Remove the assignee of a task with the given key.
Documentation: https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/unassign-user-task/
Updates all the variables of a particular scope (for example, process instance, flow element instance) with the given variable data. Specify the element instance in the elementInstanceKey parameter.
Documentation: https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/update-element-instance-variables/
Update a job with the given key.
Documentation: https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/update-a-job/
Update a user task with the given key.
Documentation: https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/update-user-task/
Update a user task with the given key.
Documentation: https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/update-user-task/
Upload a document to the Camunda 8 cluster. Note that this is currently supported for document stores of type: AWS, GCP, in-memory, local
Documentation: https://docs.camunda.io/docs/8.7/apis-tools/camunda-api-rest/specifications/create-document/
Upload multiple documents to the Camunda 8 cluster. The caller must provide a file name for each document, which will be used in case of a multi-status response to identify which documents failed to upload. The file name can be provided in the Content-Disposition header of the file part or in the fileName field of the metadata part. If both are provided, the fileName field takes precedence.
In case of a multi-status response, the response body will contain a list of DocumentBatchProblemDetail objects, each of which contains the file name of the document that failed to upload and the reason for the failure. The client can choose to retry the whole batch or individual documents based on the response.
Note that this is currently supported for document stores of type: AWS, GCP, in-memory (non-production), local (non-production)
Documentation: https://docs.camunda.io/docs/apis-tools/camunda-api-rest/specifications/create-documents/
Optional
storeId?: stringThe ID of the document store to upload the documents to. Currently, only a single document store is supported per cluster. However, this attribute is included to allow for potential future support of multiple document stores.
The client for the unified Camunda 8 REST API.
Logging: to enable debug tracing during development, you can set
DEBUG=camunda:zeebe-rest
.For production, you can pass in an logger compatible with Logger to the constructor as
logger
.CAMUNDA_LOG_LEVEL
in the environment or the constructor options can be used to set the log level to one of 'error', 'warn', 'info', 'http', 'verbose', 'debug', or 'silly'.Since
8.6.0