@camunda8/orchestration-cluster-api
    Preparing search index...

    Class CamundaClient

    Index

    Constructors

    Accessors

    Methods

    _getSupportLogger _invokeWithRetry activateAdHocSubProcessActivities activateJobs assignClientToGroup assignClientToTenant assignGroupToTenant assignMappingRuleToGroup assignMappingRuleToTenant assignRoleToClient assignRoleToGroup assignRoleToMappingRule assignRoleToTenant assignRoleToUser assignUserTask assignUserToGroup assignUserToTenant broadcastSignal cancelBatchOperation cancelProcessInstance cancelProcessInstancesBatchOperation clearAuthCache completeJob completeUserTask configure correlateMessage createAdminUser createAuthorization createDeployment createDocument createDocumentLink createDocuments createElementInstanceVariables createGlobalClusterVariable createGlobalTaskListener createGroup createJobWorker createMappingRule createProcessInstance createRole createTenant createTenantClusterVariable createThreadedJobWorker createUser deleteAuthorization deleteDecisionInstance deleteDecisionInstancesBatchOperation deleteDocument deleteGlobalClusterVariable deleteGlobalTaskListener deleteGroup deleteMappingRule deleteProcessInstance deleteProcessInstancesBatchOperation deleteResource deleteRole deleteTenant deleteTenantClusterVariable deleteUser deployResourcesFromFiles emitSupportLogPreamble evaluateConditionals evaluateDecision evaluateExpression failJob forceAuthRefresh getAuditLog getAuthentication getAuthHeaders getAuthorization getBackpressureState getBatchOperation getConfig getDecisionDefinition getDecisionDefinitionXml getDecisionInstance getDecisionRequirements getDecisionRequirementsXml getDocument getElementInstance getErrorMode getGlobalClusterVariable getGlobalJobStatistics getGlobalTaskListener getGroup getIncident getJobErrorStatistics getJobTimeSeriesStatistics getJobTypeStatistics getJobWorkerStatistics getLicense getMappingRule getProcessDefinition getProcessDefinitionInstanceStatistics getProcessDefinitionInstanceVersionStatistics getProcessDefinitionMessageSubscriptionStatistics getProcessDefinitionStatistics getProcessDefinitionXml getProcessInstance getProcessInstanceCallHierarchy getProcessInstanceSequenceFlows getProcessInstanceStatistics getProcessInstanceStatisticsByDefinition getProcessInstanceStatisticsByError getResource getResourceContent getRole getStartProcessForm getStatus getSystemConfiguration getTenant getTenantClusterVariable getTopology getUsageMetrics getUser getUserTask getUserTaskForm getVariable getWorkers logger migrateProcessInstance migrateProcessInstancesBatchOperation modifyProcessInstance modifyProcessInstancesBatchOperation onAuthHeaders pinClock publishMessage resetClock resolveIncident resolveIncidentsBatchOperation resolveProcessInstanceIncidents resumeBatchOperation searchAuditLogs searchAuthorizations searchBatchOperationItems searchBatchOperations searchClientsForGroup searchClientsForRole searchClientsForTenant searchClusterVariables searchCorrelatedMessageSubscriptions searchDecisionDefinitions searchDecisionInstances searchDecisionRequirements searchElementInstanceIncidents searchElementInstances searchGlobalTaskListeners searchGroupIdsForTenant searchGroups searchGroupsForRole searchIncidents searchJobs searchMappingRule searchMappingRulesForGroup searchMappingRulesForRole searchMappingRulesForTenant searchMessageSubscriptions searchProcessDefinitions searchProcessInstanceIncidents searchProcessInstances searchRoles searchRolesForGroup searchRolesForTenant searchTenants searchUsers searchUsersForGroup searchUsersForRole searchUsersForTenant searchUserTaskAuditLogs searchUserTaskEffectiveVariables searchUserTasks searchUserTaskVariables searchVariables stopAllWorkers suspendBatchOperation throwJobError unassignClientFromGroup unassignClientFromTenant unassignGroupFromTenant unassignMappingRuleFromGroup unassignMappingRuleFromTenant unassignRoleFromClient unassignRoleFromGroup unassignRoleFromMappingRule unassignRoleFromTenant unassignRoleFromUser unassignUserFromGroup unassignUserFromTenant unassignUserTask updateAuthorization updateGlobalClusterVariable updateGlobalTaskListener updateGroup updateJob updateMappingRule updateRole updateTenant updateTenantClusterVariable updateUser updateUserTask withCorrelation

    Constructors

    Accessors

    Methods

    • Internal invocation helper to apply global backpressure gating + retry + normalization

      Type Parameters

      • T

      Parameters

      • op: () => Promise<T>
      • opts: {
            classify?: (e: any) => { reason: string; retryable: boolean };
            exempt?: boolean;
            opId: string;
            retryOverride?: false | Partial<HttpRetryPolicy>;
        }

      Returns Promise<T>

    • Activate activities within an ad-hoc sub-process

      Activates selected activities within an ad-hoc sub-process identified by element ID. The provided element IDs must exist within the ad-hoc sub-process instance identified by the provided adHocSubProcessInstanceKey.

      Returns CancelablePromise<void>

      async function activateAdHocSubProcessActivitiesExample() {
      const camunda = createCamundaClient();

      const adHocSubProcessInstanceKey = ElementInstanceKey.assumeExists('2251799813685249');

      await camunda.activateAdHocSubProcessActivities({
      adHocSubProcessInstanceKey,
      elements: [{ elementId: ElementId.assumeExists('task-a') }],
      });
      }

      activateAdHocSubProcessActivities

      Ad-hoc sub-process

    • Assign a client to a group

      Assigns a client to a group, making it a member of the group. Members of the group inherit the group authorizations, roles, and tenant assignments.

      Parameters

      Returns CancelablePromise<void>

      async function assignClientToGroupExample() {
      const camunda = createCamundaClient();

      await camunda.assignClientToGroup({
      groupId: 'engineering-team',
      clientId: 'my-service-account',
      });
      }

      assignClientToGroup

      Group

    • Assign a client to a tenant

      Assign the client to the specified tenant. The client can then access tenant data and perform authorized actions.

      Parameters

      Returns CancelablePromise<void>

      async function assignClientToTenantExample() {
      const camunda = createCamundaClient();

      await camunda.assignClientToTenant({
      tenantId: TenantId.assumeExists('customer-service'),
      clientId: 'my-service-account',
      });
      }

      assignClientToTenant

      Tenant

    • Assign a group to a tenant

      Assigns a group to a specified tenant. Group members (users, clients) can then access tenant data and perform authorized actions.

      Parameters

      Returns CancelablePromise<void>

      async function assignGroupToTenantExample() {
      const camunda = createCamundaClient();

      await camunda.assignGroupToTenant({
      tenantId: TenantId.assumeExists('customer-service'),
      groupId: 'engineering-team',
      });
      }

      assignGroupToTenant

      Tenant

    • Assign a role to a group

      Assigns the specified role to the group. Every member of the group (user or client) will inherit the authorizations associated with this role. *

      Parameters

      Returns CancelablePromise<void>

      async function assignRoleToGroupExample() {
      const camunda = createCamundaClient();

      await camunda.assignRoleToGroup({
      roleId: 'process-admin',
      groupId: 'engineering-team',
      });
      }

      assignRoleToGroup

      Role

    • Assign a role to a tenant

      Assigns a role to a specified tenant. Users, Clients or Groups, that have the role assigned, will get access to the tenant's data and can perform actions according to their authorizations.

      Parameters

      Returns CancelablePromise<void>

      async function assignRoleToTenantExample() {
      const camunda = createCamundaClient();

      await camunda.assignRoleToTenant({
      tenantId: TenantId.assumeExists('customer-service'),
      roleId: 'process-admin',
      });
      }

      assignRoleToTenant

      Tenant

    • Assign user task

      Assigns a user task with the given key to the given assignee. Assignment waits for blocking task listeners on this lifecycle transition. If listener processing is delayed beyond the request timeout, this endpoint can return 504. Other gateway timeout causes are also possible. Retry with backoff and inspect listener worker availability and logs when this repeats.

      Parameters

      Returns CancelablePromise<void>

      async function assignUserTaskExample() {
      const camunda = createCamundaClient();

      const userTaskKey = UserTaskKey.assumeExists('2251799813685249');

      await camunda.assignUserTask({
      userTaskKey,
      assignee: 'alice',
      allowOverride: true,
      });
      }

      assignUserTask

      User task

    • Assign a user to a group

      Assigns a user to a group, making the user a member of the group. Group members inherit the group authorizations, roles, and tenant assignments.

      Parameters

      Returns CancelablePromise<void>

      async function assignUserToGroupExample() {
      const camunda = createCamundaClient();

      await camunda.assignUserToGroup({
      groupId: 'engineering-team',
      username: Username.assumeExists('alice'),
      });
      }

      assignUserToGroup

      Group

    • Assign a user to a tenant

      Assign a single user to a specified tenant. The user can then access tenant data and perform authorized actions. *

      Parameters

      Returns CancelablePromise<void>

      async function assignUserToTenantExample() {
      const camunda = createCamundaClient();

      await camunda.assignUserToTenant({
      tenantId: TenantId.assumeExists('customer-service'),
      username: Username.assumeExists('alice'),
      });
      }

      assignUserToTenant

      Tenant

    • Cancel Batch operation

      Cancels a running batch operation. This is done asynchronously, the progress can be tracked using the batch operation status endpoint (/batch-operations/{batchOperationKey}).

      Parameters

      Returns CancelablePromise<void>

      async function cancelBatchOperationExample() {
      const camunda = createCamundaClient();

      const batchOperationKey = BatchOperationKey.assumeExists('2251799813685249');

      await camunda.cancelBatchOperation({ batchOperationKey });
      }

      cancelBatchOperation

      Batch operation

    • Cancel process instance

      Cancels a running process instance. As a cancellation includes more than just the removal of the process instance resource, the cancellation resource must be posted. Cancellation can wait on listener-related processing; when that processing does not complete in time, this endpoint can return 504. Other gateway timeout causes are also possible. Retry with backoff and inspect listener worker availability and logs when this repeats.

      Parameters

      Returns CancelablePromise<void>

      async function cancelProcessInstanceExample() {
      const camunda = createCamundaClient();

      // Create a process instance and get its key from the response
      const created = await camunda.createProcessInstance({
      processDefinitionId: ProcessDefinitionId.assumeExists('order-process'),
      });

      // Cancel the process instance using the key from the creation response
      await camunda.cancelProcessInstance({
      processInstanceKey: created.processInstanceKey,
      });
      }

      cancelProcessInstance

      Process instance

    • Cancel process instances (batch)

      Cancels multiple running process instances. Since only ACTIVE root instances can be cancelled, any given filters for state and parentProcessInstanceKey are ignored and overridden during this batch operation. This is done asynchronously, the progress can be tracked using the batchOperationKey from the response and the batch operation status endpoint (/batch-operations/{batchOperationKey}).

      Returns CancelablePromise<BatchOperationCreatedResult>

      async function cancelProcessInstancesBatchOperationExample() {
      const camunda = createCamundaClient();

      const result = await camunda.cancelProcessInstancesBatchOperation({
      filter: {
      processDefinitionKey: ProcessDefinitionKey.assumeExists('2251799813685249'),
      },
      });

      console.log(`Batch operation key: ${result.batchOperationKey}`);
      }

      cancelProcessInstancesBatchOperation

      Process instance

    • Parameters

      • Optionalopts: { disk?: boolean; memory?: boolean }

      Returns void

    • Complete job

      Complete a job with the given payload, which allows completing the associated service task.

      Parameters

      Returns CancelablePromise<void>

      async function completeJobExample() {
      const camunda = createCamundaClient();

      const jobKey = JobKey.assumeExists('2251799813685249');

      await camunda.completeJob({
      jobKey,
      variables: {
      paymentId: 'PAY-123',
      status: 'completed',
      },
      });
      }

      completeJob

      Job

    • Complete user task

      Completes a user task with the given key. Completion waits for blocking task listeners on this lifecycle transition. If listener processing is delayed beyond the request timeout, this endpoint can return 504. Other gateway timeout causes are also possible. Retry with backoff and inspect listener worker availability and logs when this repeats.

      Parameters

      Returns CancelablePromise<void>

      async function completeUserTaskExample() {
      const camunda = createCamundaClient();

      const userTaskKey = UserTaskKey.assumeExists('2251799813685249');

      await camunda.completeUserTask({
      userTaskKey,
      variables: {
      approved: true,
      comment: 'Looks good',
      },
      });
      }

      completeUserTask

      User task

    • Correlate message

      Publishes a message and correlates it to a subscription. If correlation is successful it will return the first process instance key the message correlated with. The message is not buffered. Use the publish message endpoint to send messages that can be buffered.

      Parameters

      Returns CancelablePromise<MessageCorrelationResult>

      async function correlateMessageExample() {
      const camunda = createCamundaClient();

      const result = await camunda.correlateMessage({
      name: 'order-payment-received',
      correlationKey: 'ORD-12345',
      variables: {
      paymentId: 'PAY-123',
      amount: 99.95,
      },
      });

      console.log(`Message correlated to: ${result.processInstanceKey}`);
      }

      correlateMessage

      Message

    • Create admin user

      Creates a new user and assigns the admin role to it. This endpoint is only usable when users are managed in the Orchestration Cluster and while no user is assigned to the admin role. *

      Parameters

      Returns CancelablePromise<UserCreateResult>

      async function createAdminUserExample() {
      const camunda = createCamundaClient();

      const result = await camunda.createAdminUser({
      username: Username.assumeExists('admin'),
      name: 'Admin User',
      email: 'admin@example.com',
      password: 'admin-password-123',
      });

      console.log(`Created admin user: ${result.username}`);
      }

      createAdminUser

      Setup

    • Deploy resources

      Deploys one or more resources (e.g. processes, decision models, or forms). This is an atomic call, i.e. either all resources are deployed or none of them are.

      Parameters

      Returns CancelablePromise<ExtendedDeploymentResult>

      Enriched deployment result with typed arrays (processes, decisions, decisionRequirements, forms, resources).

      async function createDeploymentExample() {
      const camunda = createCamundaClient();

      const file = new File(['<xml/>'], 'order-process.bpmn', { type: 'application/xml' });

      const result = await camunda.createDeployment({
      resources: [file],
      });

      console.log(`Deployment key: ${result.deploymentKey}`);
      for (const process of result.processes ?? []) {
      console.log(` Process: ${process.processDefinitionId} v${process.processDefinitionVersion}`);
      }
      }

      createDeployment

      Resource

    • Upload multiple documents

      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. You can add a parallel array of metadata objects. These are matched with the files based on index, and must have the same length as the files array. To pass homogenous metadata for all files, spread the metadata over the metadata array. A filename value provided explicitly via the metadata array in the request overrides the Content-Disposition header of the file part.

      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)

      Parameters

      Returns CancelablePromise<DocumentCreationBatchResponse>

      createDocuments

      Document

    • Update element instance variables

      Updates all the variables of a particular scope (for example, process instance, element instance) with the given variable data. Specify the element instance in the elementInstanceKey parameter. Variable updates can be delayed by listener-related processing; if processing exceeds the request timeout, this endpoint can return 504. Other gateway timeout causes are also possible. Retry with backoff and inspect listener worker availability and logs when this repeats.

      Parameters

      Returns CancelablePromise<void>

      async function createElementInstanceVariablesExample() {
      const camunda = createCamundaClient();

      const elementInstanceKey = ElementInstanceKey.assumeExists('2251799813685249');

      await camunda.createElementInstanceVariables({
      elementInstanceKey,
      variables: { orderId: 'ORD-12345', status: 'processing' },
      });
      }

      createElementInstanceVariables

      Element instance

    • Create a job worker that activates and processes jobs of the given type.

      Worker configuration fields inherit global defaults resolved via the unified configuration (environment variables or equivalent CAMUNDA_WORKER_* keys provided via CamundaOptions.config) when not explicitly set on the config object.

      Type Parameters

      • In extends ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>> = any
      • Out extends ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>> = any
      • Headers extends ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>> = any

      Parameters

      Returns JobWorker

      async function createJobWorkerExample() {
      const camunda = createCamundaClient();

      const _worker = camunda.createJobWorker({
      jobType: 'payment-processing',
      jobTimeoutMs: 30000,
      maxParallelJobs: 5,
      jobHandler: async (job): Promise<JobActionReceipt> => {
      console.log(`Processing job ${job.jobKey}`);
      return job.complete({ processed: true });
      },
      });

      // Workers run continuously until closed
      // worker.close();
      }
      async function jobWorkerWithErrorHandlingExample() {
      const camunda = createCamundaClient();

      const worker = camunda.createJobWorker({
      jobType: 'email-sending',
      jobTimeoutMs: 60000,
      maxParallelJobs: 10,
      pollIntervalMs: 300,
      jobHandler: async (job): Promise<JobActionReceipt> => {
      try {
      console.log(`Sending email for job ${job.jobKey}`);
      return job.complete({ sent: true });
      } catch (err) {
      return job.fail({
      errorMessage: String(err),
      retries: (job.retries ?? 1) - 1,
      });
      }
      },
      });

      void worker;
      }
    • Create process instance

      Creates and starts an instance of the specified process. The process definition to use to create the instance can be specified either using its unique key (as returned by Deploy resources), or using the BPMN process id and a version.

      Waits for the completion of the process instance before returning a result when awaitCompletion is enabled.

      Returns CancelablePromise<CreateProcessInstanceResult>

      async function createProcessInstanceByIdExample() {
      const camunda = createCamundaClient();

      const result = await camunda.createProcessInstance({
      processDefinitionId: ProcessDefinitionId.assumeExists('order-process'),
      variables: {
      orderId: 'ORD-12345',
      amount: 99.95,
      },
      });

      console.log(`Started process instance: ${result.processInstanceKey}`);
      }
      async function createProcessInstanceByKeyExample() {
      const camunda = createCamundaClient();

      // Key from a previous API response (e.g. deployment)
      const processDefinitionKey = ProcessDefinitionKey.assumeExists('2251799813685249');

      const result = await camunda.createProcessInstance({
      processDefinitionKey,
      variables: {
      orderId: 'ORD-12345',
      amount: 99.95,
      },
      });

      console.log(`Started process instance: ${result.processInstanceKey}`);
      }

      createProcessInstance

      Process instance

    • Create a threaded job worker that runs handler logic in a pool of worker threads. The handler must be a separate module file that exports a default function with signature (job, client) => Promise<JobActionReceipt>.

      This keeps the main event loop free for polling and I/O, dramatically improving throughput for CPU-bound job handlers.

      Worker configuration fields inherit global defaults resolved via the unified configuration (environment variables or equivalent CAMUNDA_WORKER_* keys provided via CamundaOptions.config) when not explicitly set on the config object.

      Type Parameters

      • In extends ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>> = any
      • Out extends ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>> = any
      • Headers extends ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>> = any

      Parameters

      Returns ThreadedJobWorker

      const worker = client.createThreadedJobWorker({
      jobType: 'cpu-heavy-task',
      handlerModule: './my-handler.js',
      maxParallelJobs: 32,
      jobTimeoutMs: 30000,
      })
    • Delete decision instance

      Delete all associated decision evaluations based on provided key. *

      Parameters

      Returns CancelablePromise<void>

      async function deleteDecisionInstanceExample() {
      const camunda = createCamundaClient();

      const decisionEvaluationKey = DecisionEvaluationKey.assumeExists('2251799813685249');

      await camunda.deleteDecisionInstance({ decisionEvaluationKey });
      }

      deleteDecisionInstance

      Decision instance

    • Delete document

      Delete a document from the Camunda 8 cluster.

      Note that this is currently supported for document stores of type: AWS, GCP, in-memory (non-production), local (non-production)

      Parameters

      Returns CancelablePromise<void>

      async function deleteDocumentExample() {
      const camunda = createCamundaClient();

      const documentId = DocumentId.assumeExists('doc-123');

      await camunda.deleteDocument({ documentId });
      }

      deleteDocument

      Document

    • Delete process instance

      Deletes a process instance. Only instances that are completed or terminated can be deleted. *

      Parameters

      Returns CancelablePromise<void>

      async function deleteProcessInstanceExample() {
      const camunda = createCamundaClient();

      const processInstanceKey = ProcessInstanceKey.assumeExists('2251799813685249');

      await camunda.deleteProcessInstance({ processInstanceKey });
      }

      deleteProcessInstance

      Process instance

    • Delete process instances (batch)

      Delete multiple process instances. This will delete the historic data from secondary storage. Only process instances in a final state (COMPLETED or TERMINATED) can be deleted. This is done asynchronously, the progress can be tracked using the batchOperationKey from the response and the batch operation status endpoint (/batch-operations/{batchOperationKey}).

      Returns CancelablePromise<BatchOperationCreatedResult>

      async function deleteProcessInstancesBatchOperationExample() {
      const camunda = createCamundaClient();

      const result = await camunda.deleteProcessInstancesBatchOperation({
      filter: {
      processDefinitionKey: ProcessDefinitionKey.assumeExists('2251799813685249'),
      },
      });

      console.log(`Batch operation key: ${result.batchOperationKey}`);
      }

      deleteProcessInstancesBatchOperation

      Process instance

    • Delete resource

      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.

      Once a resource has been deleted it cannot be recovered. If the resource needs to be available again, a new deployment of the resource is required.

      By default, only the resource itself is deleted from the runtime state. To also delete the historic data associated with a resource, set the deleteHistory flag in the request body to true. The historic data is deleted asynchronously via a batch operation. The details of the created batch operation are included in the response. Note that history deletion is only supported for process resources; for other resource types this flag is ignored and no history will be deleted. *

      Parameters

      • input: { deleteHistory?: boolean; operationReference?: number } & {
            resourceKey: ResourceKey;
        }
        • OptionaldeleteHistory?: boolean

          Indicates if the historic data of a process resource should be deleted via a batch operation asynchronously.

          This flag is only effective for process resources. For other resource types (decisions, forms, generic resources), this flag is ignored and no history will be deleted. In those cases, the batchOperation field in the response will not be populated.

        • OptionaloperationReference?: number
      • Optionaloptions: OperationOptions

      Returns CancelablePromise<DeleteResourceResponse>

      async function deleteResourceExample() {
      const camunda = createCamundaClient();

      // Use a process definition key as a resource key for deletion
      const resourceKey = ProcessDefinitionKey.assumeExists('2251799813685249');

      await camunda.deleteResource({
      resourceKey,
      });
      }

      deleteResource

      Resource

    • Emit the standard support log preamble & redacted configuration to the current support logger. Safe to call multiple times; subsequent calls are ignored (idempotent). Useful when a custom supportLogger was injected and you still want the canonical header & config dump.

      Returns void

    • Evaluate root level conditional start events

      Evaluates root-level conditional start events for process definitions. If the evaluation is successful, it will return the keys of all created process instances, along with their associated process definition key. Multiple root-level conditional start events of the same process definition can trigger if their conditions evaluate to true.

      Parameters

      Returns CancelablePromise<EvaluateConditionalResult>

      async function evaluateConditionalsExample() {
      const camunda = createCamundaClient();

      const result = await camunda.evaluateConditionals({
      variables: { orderReady: true },
      tenantId: TenantId.assumeExists('customer-service'),
      });

      console.log(`Evaluated conditionals: ${JSON.stringify(result)}`);
      }

      evaluateConditionals

      Conditional

    • 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.

      Returns CancelablePromise<EvaluateDecisionResult>

      async function evaluateDecisionByIdExample() {
      const camunda = createCamundaClient();

      const result = await camunda.evaluateDecision({
      decisionDefinitionId: DecisionDefinitionId.assumeExists('invoice-classification'),
      variables: {
      amount: 1000,
      invoiceCategory: 'Misc',
      },
      });

      console.log(`Decision: ${result.decisionDefinitionId}`);
      console.log(`Output: ${result.output}`);
      }
      async function evaluateDecisionByKeyExample() {
      const camunda = createCamundaClient();

      const decisionDefinitionKey = DecisionDefinitionKey.assumeExists('2251799813685249');

      const result = await camunda.evaluateDecision({
      decisionDefinitionKey,
      variables: {
      amount: 1000,
      invoiceCategory: 'Misc',
      },
      });

      console.log(`Decision output: ${result.output}`);
      }

      evaluateDecision

      Decision definition

    • Public accessor for current backpressure adaptive limiter state (stable)

      Returns
          | {
              backoffMs: number;
              consecutive: number;
              permitsCurrent: number;
              permitsMax: number
              | null;
              severity: BackpressureSeverity;
              waiters: number;
          }
          | {
              consecutive: number;
              permitsCurrent: number;
              permitsMax: null;
              severity: string;
              waiters: number;
          }

    • Internal accessor (read-only) for eventual consistency error mode.

      Returns "throw" | "result"

    • Get resource content

      Returns the content of a deployed resource. :::info Currently, this endpoint only supports RPA resources. :::

      Parameters

      Returns CancelablePromise<string>

      async function getResourceContentExample() {
      const camunda = createCamundaClient();

      const content = await camunda.getResourceContent({
      resourceKey: ProcessDefinitionKey.assumeExists('2251799813685249'),
      });

      console.log(`Content retrieved (type: ${typeof content})`);
      }

      getResourceContent

      Resource

    • Get process start form

      Get the start form of a process. Note that this endpoint will only return linked forms. This endpoint does not support embedded forms.

      Parameters

      Returns CancelablePromise<void | FormResult>

      async function getStartProcessFormExample() {
      const camunda = createCamundaClient();

      const processDefinitionKey = ProcessDefinitionKey.assumeExists('2251799813685249');

      const form = await camunda.getStartProcessForm(
      { processDefinitionKey },
      { consistency: { waitUpToMs: 5000 } }
      );

      if (form) {
      console.log(`Form key: ${form.formKey}`);
      }
      }

      getStartProcessForm

      Process definition

      eventual - this endpoint is backed by data that is eventually consistent with the system state.

    • Get cluster status

      Checks the health status of the cluster by verifying if there's at least one partition with a healthy leader. *

      Parameters

      Returns CancelablePromise<void>

      async function getStatusExample() {
      const camunda = createCamundaClient();

      await camunda.getStatus();

      console.log('Cluster is healthy');
      }

      getStatus

      Cluster

    • System configuration (alpha)

      Returns the current system configuration. The response is an envelope that groups settings by feature area.

      This endpoint is an alpha feature and may be subject to change in future releases.

      Parameters

      Returns CancelablePromise<SystemConfigurationResponse>

      async function getSystemConfigurationExample() {
      const camunda = createCamundaClient();

      const config = await camunda.getSystemConfiguration();

      console.log(`Configuration loaded: ${JSON.stringify(config)}`);
      }

      getSystemConfiguration

      System

    • Get cluster topology

      Obtains the current topology of the cluster the gateway is part of. *

      Parameters

      Returns CancelablePromise<TopologyResponse>

      async function getTopologyExample() {
      const camunda = createCamundaClient();

      const topology = await camunda.getTopology();

      console.log(`Cluster size: ${topology.clusterSize}`);
      console.log(`Partitions: ${topology.partitionsCount}`);
      for (const broker of topology.brokers ?? []) {
      console.log(` Broker ${broker.nodeId}: ${broker.host}:${broker.port}`);
      }
      }

      getTopology

      Cluster

    • Get user

      Get a user by its username. *

      Parameters

      Returns CancelablePromise<
          { email: string
          | null; name: string | null; username: Username },
      >

      async function getUserExample() {
      const camunda = createCamundaClient();

      const username = Username.assumeExists('alice');

      const user = await camunda.getUser({ username }, { consistency: { waitUpToMs: 5000 } });

      console.log(`User: ${user.name} (${user.email})`);
      }

      getUser

      User

      eventual - this endpoint is backed by data that is eventually consistent with the system state.

    • Get user task form

      Get the form of a user task. Note that this endpoint will only return linked forms. This endpoint does not support embedded forms.

      Parameters

      Returns CancelablePromise<void | FormResult>

      async function getUserTaskFormExample() {
      const camunda = createCamundaClient();

      const { UserTaskKey } = await import('@camunda8/orchestration-cluster-api');
      const userTaskKey = UserTaskKey.assumeExists('2251799813685249');

      const form = await camunda.getUserTaskForm(
      { userTaskKey },
      { consistency: { waitUpToMs: 5000 } }
      );

      if (form) {
      console.log(`Form key: ${form.formKey}`);
      }
      }

      getUserTaskForm

      User task

      eventual - this endpoint is backed by data that is eventually consistent with the system state.

    • Get variable

      Get a variable by its key.

      This endpoint returns both process-level and local (element-scoped) variables. The variable's scopeKey indicates whether it's a process-level variable or scoped to a specific element instance. *

      Parameters

      Returns CancelablePromise<VariableResult>

      async function getVariableExample() {
      const camunda = createCamundaClient();

      const variableKey = VariableKey.assumeExists('2251799813685249');

      const variable = await camunda.getVariable(
      { variableKey },
      { consistency: { waitUpToMs: 5000 } }
      );

      console.log(`${variable.name} = ${variable.value}`);
      }

      getVariable

      Variable

      eventual - this endpoint is backed by data that is eventually consistent with the system state.

    • Return a read-only snapshot of currently registered job workers.

      Returns any[]

    • Migrate process instance

      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.

      Parameters

      Returns CancelablePromise<void>

      async function migrateProcessInstanceExample() {
      const camunda = createCamundaClient();

      const processInstanceKey = ProcessInstanceKey.assumeExists('2251799813685249');

      await camunda.migrateProcessInstance({
      processInstanceKey,
      targetProcessDefinitionKey: ProcessDefinitionKey.assumeExists('2251799813685250'),
      mappingInstructions: [
      {
      sourceElementId: ElementId.assumeExists('task-a'),
      targetElementId: ElementId.assumeExists('task-b'),
      },
      ],
      });
      }

      migrateProcessInstance

      Process instance

    • Migrate process instances (batch)

      Migrate multiple process instances. Since only process instances with ACTIVE state can be migrated, any given filters for state are ignored and overridden during this batch operation. This is done asynchronously, the progress can be tracked using the batchOperationKey from the response and the batch operation status endpoint (/batch-operations/{batchOperationKey}).

      Returns CancelablePromise<BatchOperationCreatedResult>

      async function migrateProcessInstancesBatchOperationExample() {
      const camunda = createCamundaClient();

      const result = await camunda.migrateProcessInstancesBatchOperation({
      filter: {
      processDefinitionKey: ProcessDefinitionKey.assumeExists('2251799813685249'),
      },
      migrationPlan: {
      targetProcessDefinitionKey: ProcessDefinitionKey.assumeExists('2251799813685250'),
      mappingInstructions: [
      {
      sourceElementId: ElementId.assumeExists('task-a'),
      targetElementId: ElementId.assumeExists('task-b'),
      },
      ],
      },
      });

      console.log(`Batch operation key: ${result.batchOperationKey}`);
      }

      migrateProcessInstancesBatchOperation

      Process instance

    • 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.

      Parameters

      Returns CancelablePromise<void>

      async function modifyProcessInstanceExample() {
      const camunda = createCamundaClient();

      const processInstanceKey = ProcessInstanceKey.assumeExists('2251799813685249');

      await camunda.modifyProcessInstance({
      processInstanceKey,
      activateInstructions: [{ elementId: ElementId.assumeExists('task-a') }],
      terminateInstructions: [
      { elementInstanceKey: ElementInstanceKey.assumeExists('2251799813685260') },
      ],
      });
      }

      modifyProcessInstance

      Process instance

    • Modify process instances (batch)

      Modify multiple process instances. Since only process instances with ACTIVE state can be modified, any given filters for state are ignored and overridden during this batch operation. In contrast to single modification operation, it is not possible to add variable instructions or modify by element key. It is only possible to use the element id of the source and target. This is done asynchronously, the progress can be tracked using the batchOperationKey from the response and the batch operation status endpoint (/batch-operations/{batchOperationKey}).

      Returns CancelablePromise<BatchOperationCreatedResult>

      async function modifyProcessInstancesBatchOperationExample() {
      const camunda = createCamundaClient();

      const result = await camunda.modifyProcessInstancesBatchOperation({
      filter: {
      processDefinitionKey: ProcessDefinitionKey.assumeExists('2251799813685249'),
      },
      moveInstructions: [
      {
      sourceElementId: ElementId.assumeExists('task-a'),
      targetElementId: ElementId.assumeExists('task-b'),
      },
      ],
      });

      console.log(`Batch operation key: ${result.batchOperationKey}`);
      }

      modifyProcessInstancesBatchOperation

      Process instance

    • Parameters

      • h: (
            headers: Record<string, string>,
        ) => Record<string, string> | Promise<Record<string, string>>

      Returns void

    • Pin internal clock (alpha)

      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.

      This endpoint is an alpha feature and may be subject to change in future releases.

      Parameters

      Returns CancelablePromise<void>

      async function pinClockExample() {
      const camunda = createCamundaClient();

      await camunda.pinClock({
      timestamp: 1735689599000,
      });

      console.log('Clock pinned');
      }

      pinClock

      Clock

    • Reset internal clock (alpha)

      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.

      This endpoint is an alpha feature and may be subject to change in future releases.

      Parameters

      Returns CancelablePromise<void>

      async function resetClockExample() {
      const camunda = createCamundaClient();

      await camunda.resetClock();

      console.log('Clock reset');
      }

      resetClock

      Clock

    • Resolve incident

      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.

      Parameters

      Returns CancelablePromise<void>

      async function resolveIncidentExample() {
      const camunda = createCamundaClient();

      const incidentKey = IncidentKey.assumeExists('2251799813685249');

      await camunda.resolveIncident({ incidentKey });
      }

      resolveIncident

      Incident

    • Resume Batch operation

      Resumes a suspended batch operation. This is done asynchronously, the progress can be tracked using the batch operation status endpoint (/batch-operations/{batchOperationKey}).

      Parameters

      Returns CancelablePromise<void>

      async function resumeBatchOperationExample() {
      const camunda = createCamundaClient();

      const batchOperationKey = BatchOperationKey.assumeExists('2251799813685249');

      await camunda.resumeBatchOperation({ batchOperationKey });
      }

      resumeBatchOperation

      Batch operation

    • Search for incidents of a specific element instance

      Search for incidents caused by the specified element instance, including incidents of any child instances created from this element instance.

      Although the elementInstanceKey is provided as a path parameter to indicate the root element instance, you may also include an elementInstanceKey within the filter object to narrow results to specific child element instances. This is useful, for example, if you want to isolate incidents associated with nested or subordinate elements within the given element instance while excluding incidents directly tied to the root element itself.

      Returns CancelablePromise<IncidentSearchQueryResult>

      async function searchElementInstanceIncidentsExample() {
      const camunda = createCamundaClient();

      const elementInstanceKey = ElementInstanceKey.assumeExists('2251799813685249');

      const result = await camunda.searchElementInstanceIncidents(
      { elementInstanceKey },
      { consistency: { waitUpToMs: 5000 } }
      );

      for (const incident of result.items ?? []) {
      console.log(`Incident: ${incident.errorType}`);
      }
      }

      searchElementInstanceIncidents

      Element instance

      eventual - this endpoint is backed by data that is eventually consistent with the system state.

    • Search related incidents

      Search for incidents caused by the process instance or any of its called process or decision instances.

      Although the processInstanceKey is provided as a path parameter to indicate the root process instance, you may also include a processInstanceKey within the filter object to narrow results to specific child process instances. This is useful, for example, if you want to isolate incidents associated with subprocesses or called processes under the root instance while excluding incidents directly tied to the root.

      Returns CancelablePromise<IncidentSearchQueryResult>

      async function searchProcessInstanceIncidentsExample() {
      const camunda = createCamundaClient();

      const processInstanceKey = ProcessInstanceKey.assumeExists('2251799813685249');

      const result = await camunda.searchProcessInstanceIncidents(
      {
      processInstanceKey,
      },
      { consistency: { waitUpToMs: 5000 } }
      );

      for (const incident of result.items ?? []) {
      console.log(`Incident: ${incident.errorType} - ${incident.errorMessage}`);
      }
      }

      searchProcessInstanceIncidents

      Process instance

      eventual - this endpoint is backed by data that is eventually consistent with the system state.

    • Search users

      Search for users based on given criteria. *

      Parameters

      Returns CancelablePromise<
          SearchQueryResponse & {
              items: {
                  email: string
                  | null;
                  name: string | null;
                  username: Username;
              }[];
          },
      >

      async function searchUsersExample() {
      const camunda = createCamundaClient();

      const result = await camunda.searchUsers(
      {
      filter: {},
      page: { limit: 10 },
      },
      { consistency: { waitUpToMs: 5000 } }
      );

      for (const user of result.items ?? []) {
      console.log(`${user.username}: ${user.name}`);
      }
      }

      searchUsers

      User

      eventual - this endpoint is backed by data that is eventually consistent with the system state.

    • Search user task variables

      Search for user task variables based on given criteria. This endpoint returns all variable documents visible from the user task's scope, including variables from parent scopes in the scope hierarchy. If the same variable name exists at multiple scope levels, each scope's variable is returned as a separate result. Use the /user-tasks/{userTaskKey}/effective-variables/search endpoint to get deduplicated variables where the innermost scope takes precedence. By default, long variable values in the response are truncated.

      Parameters

      Returns CancelablePromise<VariableSearchQueryResult>

      async function searchUserTaskVariablesExample() {
      const camunda = createCamundaClient();

      const { UserTaskKey } = await import('@camunda8/orchestration-cluster-api');
      const userTaskKey = UserTaskKey.assumeExists('2251799813685249');

      const result = await camunda.searchUserTaskVariables(
      { userTaskKey },
      { consistency: { waitUpToMs: 5000 } }
      );

      for (const variable of result.items ?? []) {
      console.log(`${variable.name} = ${variable.value}`);
      }
      }

      searchUserTaskVariables

      User task

      eventual - this endpoint is backed by data that is eventually consistent with the system state.

    • Search variables

      Search for variables based on given criteria.

      This endpoint returns variables that exist directly at the specified scopes - it does not include variables from parent scopes that would be visible through the scope hierarchy.

      Variables can be process-level (scoped to the process instance) or local (scoped to specific BPMN elements like tasks, subprocesses, etc.).

      By default, long variable values in the response are truncated. *

      Parameters

      Returns CancelablePromise<VariableSearchQueryResult>

      async function searchVariablesExample() {
      const camunda = createCamundaClient();

      const result = await camunda.searchVariables(
      {
      filter: {
      processInstanceKey: ProcessInstanceKey.assumeExists('2251799813685249'),
      },
      page: { limit: 10 },
      },
      { consistency: { waitUpToMs: 5000 } }
      );

      for (const variable of result.items ?? []) {
      console.log(`${variable.name} = ${variable.value}`);
      }
      }

      searchVariables

      Variable

      eventual - this endpoint is backed by data that is eventually consistent with the system state.

    • Stop all registered job workers (best-effort) and terminate the shared thread pool.

      Returns void

    • Suspend Batch operation

      Suspends a running batch operation. This is done asynchronously, the progress can be tracked using the batch operation status endpoint (/batch-operations/{batchOperationKey}).

      Parameters

      Returns CancelablePromise<void>

      async function suspendBatchOperationExample() {
      const camunda = createCamundaClient();

      const batchOperationKey = BatchOperationKey.assumeExists('2251799813685249');

      await camunda.suspendBatchOperation({ batchOperationKey });
      }

      suspendBatchOperation

      Batch operation

    • Throw error for job

      Reports a business error (i.e. non-technical) that occurs while processing a job.

      Parameters

      Returns CancelablePromise<void>

      async function throwJobErrorExample() {
      const camunda = createCamundaClient();

      const jobKey = JobKey.assumeExists('2251799813685249');

      await camunda.throwJobError({
      jobKey,
      errorCode: 'PAYMENT_FAILED',
      errorMessage: 'Payment provider returned error',
      });
      }

      throwJobError

      Job

    • Unassign a client from a group

      Unassigns a client from a group. The client is removed as a group member, with associated authorizations, roles, and tenant assignments no longer applied.

      Parameters

      Returns CancelablePromise<void>

      async function unassignClientFromGroupExample() {
      const camunda = createCamundaClient();

      await camunda.unassignClientFromGroup({
      groupId: 'engineering-team',
      clientId: 'my-service-account',
      });
      }

      unassignClientFromGroup

      Group

    • Unassign a group from a tenant

      Unassigns a group from a specified tenant. Members of the group (users, clients) will no longer have access to the tenant's data - except they are assigned directly to the tenant.

      Parameters

      Returns CancelablePromise<void>

      async function unassignGroupFromTenantExample() {
      const camunda = createCamundaClient();

      await camunda.unassignGroupFromTenant({
      tenantId: TenantId.assumeExists('customer-service'),
      groupId: 'engineering-team',
      });
      }

      unassignGroupFromTenant

      Tenant

    • Unassign a role from a tenant

      Unassigns a role from a specified tenant. Users, Clients or Groups, that have the role assigned, will no longer have access to the tenant's data - unless they are assigned directly to the tenant.

      Parameters

      Returns CancelablePromise<void>

      async function unassignRoleFromTenantExample() {
      const camunda = createCamundaClient();

      await camunda.unassignRoleFromTenant({
      tenantId: TenantId.assumeExists('customer-service'),
      roleId: 'process-admin',
      });
      }

      unassignRoleFromTenant

      Tenant

    • Unassign a user from a group

      Unassigns a user from a group. The user is removed as a group member, with associated authorizations, roles, and tenant assignments no longer applied.

      Parameters

      Returns CancelablePromise<void>

      async function unassignUserFromGroupExample() {
      const camunda = createCamundaClient();

      await camunda.unassignUserFromGroup({
      groupId: 'engineering-team',
      username: Username.assumeExists('alice'),
      });
      }

      unassignUserFromGroup

      Group

    • Unassign user task

      Removes the assignee of a task with the given key. Unassignment waits for blocking task listeners on this lifecycle transition. If listener processing is delayed beyond the request timeout, this endpoint can return 504. Other gateway timeout causes are also possible. Retry with backoff and inspect listener worker availability and logs when this repeats.

      Parameters

      Returns CancelablePromise<void>

      async function unassignUserTaskExample() {
      const camunda = createCamundaClient();

      const userTaskKey = UserTaskKey.assumeExists('2251799813685249');

      await camunda.unassignUserTask({ userTaskKey });
      }

      unassignUserTask

      User task

    • Update authorization

      Update the authorization with the given key. *

      Parameters

      Returns CancelablePromise<void>

      async function updateAuthorizationExample() {
      const camunda = createCamundaClient();

      const authorizationKey = AuthorizationKey.assumeExists('2251799813685249');

      await camunda.updateAuthorization({
      authorizationKey,
      ownerId: 'user-123',
      ownerType: 'USER',
      resourceId: 'order-process',
      resourceType: 'PROCESS_DEFINITION',
      permissionTypes: [
      'CREATE_PROCESS_INSTANCE',
      'READ_PROCESS_INSTANCE',
      'DELETE_PROCESS_INSTANCE',
      ],
      });
      }

      updateAuthorization

      Authorization

    • Update user

      Updates a user. *

      Parameters

      Returns CancelablePromise<
          { email: string
          | null; name: string | null; username: Username },
      >

      async function updateUserExample() {
      const camunda = createCamundaClient();

      const username = Username.assumeExists('alice');

      await camunda.updateUser({
      username,
      name: 'Alice Jones',
      email: 'alice.jones@example.com',
      });
      }

      updateUser

      User

    • Update user task

      Update a user task with the given key. Updates wait for blocking task listeners on this lifecycle transition. If listener processing is delayed beyond the request timeout, this endpoint can return 504. Other gateway timeout causes are also possible. Retry with backoff and inspect listener worker availability and logs when this repeats.

      Parameters

      Returns CancelablePromise<void>

      async function updateUserTaskExample() {
      const camunda = createCamundaClient();

      const { UserTaskKey } = await import('@camunda8/orchestration-cluster-api');
      const userTaskKey = UserTaskKey.assumeExists('2251799813685249');

      await camunda.updateUserTask({
      userTaskKey,
      changeset: {
      candidateUsers: ['alice', 'bob'],
      dueDate: '2025-12-31T23:59:59Z',
      priority: 80,
      },
      });
      }

      updateUserTask

      User task

    • Type Parameters

      • T

      Parameters

      • id: string
      • fn: () => T | Promise<T>

      Returns Promise<T>