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

    Class CamundaClient

    Index
    _getSupportLogger _invokeWithRetry activateAdHocSubProcessActivities activateJobs assignClientToGroup assignClientToTenant assignGroupToTenant assignMappingRuleToGroup assignMappingRuleToTenant assignProcessInstanceBusinessId assignRoleToClient assignRoleToGroup assignRoleToMappingRule assignRoleToTenant assignRoleToUser assignUserTask assignUserToGroup assignUserToTenant broadcastSignal cancelBatchOperation cancelProcessInstance cancelProcessInstancesBatchOperation changeClusterMode clearAuthCache completeJob completeUserTask configure correlateMessage createAdminUser createAgentInstance createAgentInstanceHistoryItem 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 deleteRuntimeBackup deleteRuntimeBackupState deleteTenant deleteTenantClusterVariable deleteUser deployResourcesFromFiles emitSupportLogPreamble evaluateConditionals evaluateDecision evaluateExpression failJob forceAuthRefresh getAgentInstance getAuditLog getAuthentication getAuthHeaders getAuthorization getBackpressureState getBatchOperation getClusterStatus getConfig getDecisionDefinition getDecisionDefinitionXml getDecisionInstance getDecisionRequirements getDecisionRequirementsXml getDocument getElementInstance getErrorMode getExportingStatus getFormByKey getGlobalClusterVariable getGlobalJobStatistics getGlobalTaskListener getGroup getIncident getJobErrorStatistics getJobTimeSeriesStatistics getJobTypeStatistics getJobWorkerStatistics getLicense getMappingRule getProcessDefinition getProcessDefinitionInstanceStatistics getProcessDefinitionInstanceVersionStatistics getProcessDefinitionMessageSubscriptionStatistics getProcessDefinitionStatistics getProcessDefinitionXml getProcessInstance getProcessInstanceCallHierarchy getProcessInstanceSequenceFlows getProcessInstanceStatistics getProcessInstanceStatisticsByDefinition getProcessInstanceStatisticsByError getProcessInstanceWaitStateStatistics getResource getResourceContent getResourceContentBinary getRestoreStatus getRole getRuntimeBackup getRuntimeBackupState getStartProcessForm getStatus getSystemConfiguration getTenant getTenantClusterVariable getTopology getUsageMetrics getUser getUserTask getUserTaskForm getVariable getWorkers listRuntimeBackups listSecrets logger migrateProcessInstance migrateProcessInstancesBatchOperation modifyProcessInstance modifyProcessInstancesBatchOperation onAuthHeaders pauseExporting pinClock publishMessage resetClock resolveIncident resolveIncidentsBatchOperation resolveProcessInstanceIncidents resolveSecrets restore resumeBatchOperation resumeExporting resumeProcessInstance resumeProcessInstancesBatchOperation searchAgentInstanceHistory searchAgentInstances searchAuditLogs searchAuthorizations searchBatchOperationItems searchBatchOperations searchClientsForGroup searchClientsForRole searchClientsForTenant searchClusterVariables searchCorrelatedMessageSubscriptions searchDecisionDefinitions searchDecisionInstances searchDecisionRequirements searchElementInstanceIncidents searchElementInstances searchElementInstanceWaitStates searchGlobalTaskListeners searchGroupIdsForTenant searchGroups searchGroupsForRole searchIncidents searchJobs searchMappingRule searchMappingRulesForGroup searchMappingRulesForRole searchMappingRulesForTenant searchMessageSubscriptions searchProcessDefinitions searchProcessDefinitionVariableNames searchProcessInstanceIncidents searchProcessInstances searchResources searchRoles searchRolesForGroup searchRolesForTenant searchTenants searchUsers searchUsersForGroup searchUsersForRole searchUsersForTenant searchUserTaskAuditLogs searchUserTaskEffectiveVariables searchUserTasks searchUserTaskVariables searchVariables searchVariablesAsDto stopAllWorkers suspendBatchOperation suspendProcessInstance suspendProcessInstancesBatchOperation syncRuntimeBackupState takeRuntimeBackup throwJobError unassignClientFromGroup unassignClientFromTenant unassignGroupFromTenant unassignMappingRuleFromGroup unassignMappingRuleFromTenant unassignRoleFromClient unassignRoleFromGroup unassignRoleFromMappingRule unassignRoleFromTenant unassignRoleFromUser unassignUserFromGroup unassignUserFromTenant unassignUserTask updateAgentInstance updateAuthorization updateGlobalClusterVariable updateGlobalTaskListener updateGroup updateJob updateJobsBatchOperation updateMappingRule updateRole updateTenant updateTenantClusterVariable updateUser updateUserTask withCorrelation
    • 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.

      Parameters

      Returns CancelablePromise<void>

      async function activateAdHocSubProcessActivitiesExample(
      adHocSubProcessInstanceKey: ElementInstanceKey,
      elementId: ElementId
      ) {
      const camunda = createCamundaClient();

      await camunda.activateAdHocSubProcessActivities({
      adHocSubProcessInstanceKey,
      elements: [{ elementId }],
      });
      }

      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(groupId: GroupId, clientId: ClientId) {
      const camunda = createCamundaClient();

      await camunda.assignClientToGroup({
      groupId,
      clientId,
      });
      }

      assignClientToGroup

      Group

    • Assign business id to process instance

      Assigns a business id to an already-running process instance that currently has none.

      The assignment is single and irreversible: only artifacts created after the assignment (for example future jobs, user tasks, decision instances, and message subscriptions) carry the business id, while existing artifacts are not retroactively enriched. Re-sending the same business id succeeds as a no-op. This endpoint is only useful while business id uniqueness enforcement is disabled; when it is enabled, the request is rejected with a 409 response.

      Parameters

      Returns CancelablePromise<void>

      async function assignProcessInstanceBusinessIdExample(
      processInstanceKey: ProcessInstanceKey,
      businessId: BusinessId
      ) {
      const camunda = createCamundaClient();

      await camunda.assignProcessInstanceBusinessId({
      processInstanceKey,
      businessId,
      });
      }

      assignProcessInstanceBusinessId

      Process instance

    • 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(roleId: RoleId, groupId: GroupId) {
      const camunda = createCamundaClient();

      await camunda.assignRoleToGroup({
      roleId,
      groupId,
      });
      }

      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(tenantId: TenantId, roleId: RoleId) {
      const camunda = createCamundaClient();

      await camunda.assignRoleToTenant({
      tenantId,
      roleId,
      });
      }

      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(userTaskKey: UserTaskKey) {
      const camunda = createCamundaClient();

      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(groupId: GroupId, username: Username) {
      const camunda = createCamundaClient();

      await camunda.assignUserToGroup({
      groupId,
      username,
      });
      }

      assignUserToGroup

      Group

    • 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(batchOperationKey: BatchOperationKey) {
      const camunda = createCamundaClient();

      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

      • input: { operationReference?: number } & { processInstanceKey: string }
      • Optionaloptions: OperationOptions

      Returns CancelablePromise<void>

      async function cancelProcessInstanceExample(processDefinitionId: ProcessDefinitionId) {
      const camunda = createCamundaClient();

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

      // 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(
      processDefinitionKey: ProcessDefinitionKey
      ) {
      const camunda = createCamundaClient();

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

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

      cancelProcessInstancesBatchOperation

      Process instance

    • Change cluster mode

      Transitions the cluster between processing and recovery mode. This is a non-blocking operation: the request is acknowledged once the change has been accepted, before the transition itself has completed. Entering recovery mode deactivates all partitions so that only a restricted set of read-only operations remains available; exiting recovery mode returns the cluster to normal processing. Returns the planned cluster change so its progress can be monitored via the topology. *

      Parameters

      Returns CancelablePromise<ClusterModeChangeResponse>

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

      // Transition the cluster into recovery mode. Pass `dryRun: true` to validate
      // the request and inspect the resulting plan without applying it. Omit it (or
      // set it to false) to actually trigger the transition.
      const change = await camunda.changeClusterMode({
      mode: 'RECOVERING',
      dryRun: true,
      });

      console.log(`Cluster change ${change.changeId}:`);
      for (const op of change.plannedChanges) {
      console.log(` ${op.operation}${op.mode ? ` -> ${op.mode}` : ''}`);
      }
      }

      changeClusterMode

      Recovery

    • Parameters

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

      Returns void

    • 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(userTaskKey: UserTaskKey) {
      const camunda = createCamundaClient();

      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(username: Username) {
      const camunda = createCamundaClient();

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

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

      createAdminUser

      Setup

    • Create agent instance history item

      Appends a single history item to an agent instance's conversation history. The created item has commitStatus PENDING until the job identified by jobLease completes successfully, at which point it transitions to COMMITTED. If the job fails or is superseded by a retry, the item is marked DISCARDED.

      Parameters

      Returns CancelablePromise<AgentInstanceHistoryItemCreationResult>

      async function createAgentInstanceHistoryItemExample(
      agentInstanceKey: AgentInstanceKey,
      elementInstanceKey: ElementInstanceKey,
      jobKey: JobKey,
      jobLease: string
      ) {
      const camunda = createCamundaClient();

      const result = await camunda.createAgentInstanceHistoryItem({
      agentInstanceKey,
      elementInstanceKey,
      jobKey,
      jobLease,
      role: 'ASSISTANT',
      content: [{ contentType: 'TEXT', text: 'How can I help you today?' }],
      producedAt: new Date().toISOString(),
      });

      console.log(`Created history item: ${result.historyItemKey}`);
      }

      createAgentInstanceHistoryItem

      Agent instance

    • Deploy resources

      Deploys one or more resources, including BPMN processes, DMN decision models, forms, RPA resources, and generic files. A deployment can contain any file type. Files that are not interpreted as BPMN, DMN, form, or RPA resources are stored as deployable generic resources in the engine. 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 deployResourcesFromFilesExample() {
      const camunda = createCamundaClient();

      // Node.js only: deploy directly from file paths
      const result = await camunda.deployResourcesFromFiles(['./process.bpmn', './decision.dmn']);

      console.log(`Deployment key: ${result.deploymentKey}`);
      }

      createDeployment

      Resource

    • Upload document

      Upload a document to the Camunda 8 cluster.

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

      Parameters

      Returns CancelablePromise<DocumentReference>

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

      const file = new Blob(['Hello, world!'], { type: 'text/plain' });

      const result = await camunda.createDocument({
      file,
      metadata: { fileName: 'hello.txt' },
      });

      console.log(`Document ID: ${result.documentId}`);
      }

      createDocument

      Document

    • 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, Azure, GCP, in-memory (non-production), local (non-production)

      Parameters

      Returns CancelablePromise<DocumentCreationBatchResponse>

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

      const file1 = new Blob(['File one'], { type: 'text/plain' });
      const file2 = new Blob(['File two'], { type: 'text/plain' });

      const result = await camunda.createDocuments({
      files: [file1, file2],
      metadataList: [{ fileName: 'one.txt' }, { fileName: 'two.txt' }],
      });

      for (const doc of result.createdDocuments ?? []) {
      console.log(`Created: ${doc.documentId}`);
      }
      }

      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(elementInstanceKey: ElementInstanceKey) {
      const camunda = createCamundaClient();

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

      createElementInstanceVariables

      Element instance

    • Create group

      Create a new group.

      The supplied groupId is validated against ^[a-zA-Z0-9_~@.+-]+$ (max 256 characters) by IdentifierValidator.validateId in the runtime. This strict validation applies wherever the Groups API is available: in OIDC deployments that set camunda.security.authentication.oidc.groupsClaim the Groups API (including this endpoint) is disabled entirely, so group CRUD never sees externally-minted IdP IDs. The BYOG relaxation only loosens validation when a group is referenced as a member of a role or tenant (assignRoleToGroup, assignGroupToTenant); group CRUD itself always uses the strict default-id regex. The constraint is not advertised on the GroupId schema so that the same schema can be reused at member-reference sites without falsely rejecting externally-minted IdP group IDs there.

      Parameters

      Returns CancelablePromise<GroupCreateResult>

      async function createGroupExample(groupId: GroupId) {
      const camunda = createCamundaClient();

      const result = await camunda.createGroup({
      groupId,
      name: 'Engineering Team',
      });

      console.log(`Created group: ${result.groupId}`);
      }

      createGroup

      Group

    • 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(processDefinitionId: ProcessDefinitionId) {
      const camunda = createCamundaClient();

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

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

      // Key from a previous API response (e.g. deployment)
      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

      • input: { operationReference?: number } & { decisionEvaluationKey: string }
      • Optionaloptions: OperationOptions

      Returns CancelablePromise<void>

      async function deleteDecisionInstanceExample(decisionEvaluationKey: DecisionEvaluationKey) {
      const camunda = createCamundaClient();

      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, Azure, GCP, in-memory (non-production), local (non-production)

      Parameters

      Returns CancelablePromise<void>

      async function deleteDocumentExample(documentId: DocumentId) {
      const camunda = createCamundaClient();

      await camunda.deleteDocument({ documentId });
      }

      deleteDocument

      Document

    • Delete process instance

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

      Parameters

      • input: { operationReference?: number } & { processInstanceKey: string }
      • Optionaloptions: OperationOptions

      Returns CancelablePromise<void>

      async function deleteProcessInstanceExample(processInstanceKey: ProcessInstanceKey) {
      const camunda = createCamundaClient();

      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(
      processDefinitionKey: ProcessDefinitionKey
      ) {
      const camunda = createCamundaClient();

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

      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: string;
        }
        • 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
        • resourceKey: string
      • Optionaloptions: OperationOptions

      Returns CancelablePromise<DeleteResourceResponse>

      async function deleteResourceExample(resourceKey: ProcessDefinitionKey) {
      const camunda = createCamundaClient();

      // Use a process definition key as a resource key for deletion
      await camunda.deleteResource({
      resourceKey,
      });
      }

      deleteResource

      Resource

    • Delete runtime backup state

      Resets the runtime backup state of every partition of the physical tenant, clearing all checkpoint info, backup info, checkpoint metadata, and backup ranges. Used when switching backup stores.

      Parameters

      Returns CancelablePromise<void>

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

      // Clears all checkpoint info, backup info, checkpoint metadata, and backup
      // ranges on every partition. Used when switching backup stores.
      await camunda.deleteRuntimeBackupState();
      }

      deleteRuntimeBackupState

      Backup

    • 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(tenantId: TenantId) {
      const camunda = createCamundaClient();

      const result = await camunda.evaluateConditionals({
      variables: { orderReady: true },
      tenantId,
      });

      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(decisionDefinitionId: DecisionDefinitionId) {
      const camunda = createCamundaClient();

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

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

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

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

      evaluateDecision

      Decision definition

    • Returns Promise<Record<string, string>>

    • 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;
          }

    • Get the status of the whole cluster

      Checks the health status of the whole cluster, aggregated over all physical tenants. Returns HEALTHY when every physical tenant is healthy, DOWN when no physical tenant can process work, and DEGRADED in every other case. No per-tenant detail is reported; use GET /cluster/v2/topology for that. *

      Parameters

      Returns CancelablePromise<ClusterStatusResponse>

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

      const status = await camunda.getClusterStatus();

      console.log(`Cluster status: ${status.status}`);
      }

      getClusterStatus

      Cluster

    • Download document

      Download a document from the Camunda 8 cluster.

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

      Parameters

      Returns CancelablePromise<Blob>

      async function getDocumentExample(documentId: DocumentId) {
      const camunda = createCamundaClient();

      await camunda.getDocument({ documentId });

      console.log(`Downloaded document: ${documentId}`);
      }

      getDocument

      Document

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

      Returns "throw" | "result"

    • Get exporting status

      Returns the exporting status of the physical tenant, aggregated over every replica of every one of its partitions.

      Because pause and resume are applied to all replicas, the status is only a single phase if every replica reports that phase; otherwise it is MIXED, which means a pause or resume is still in flight or was only partially applied. Backup tooling should treat only PAUSED and SOFT_PAUSED as confirmation that exporting is paused.

      Parameters

      Returns CancelablePromise<ExportingStatusResponse>

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

      // Reports the aggregated exporting status of the physical tenant — useful to
      // confirm exporting has actually paused before taking a backup, and that it
      // has resumed afterwards.
      const { status } = await camunda.getExportingStatus();
      console.log(`Exporting status: ${status}`);
      }

      getExportingStatus

      Exporting

    • Get resource

      Returns a deployed resource. :::info This endpoint does not return BPMN process definitions, DMN decision definitions, or form resources. To query BPMN process definitions or DMN decision definitions, use their respective APIs. :::

      Parameters

      Returns CancelablePromise<ResourceResult>

      async function getResourceExample(resourceKey: ProcessDefinitionKey) {
      const camunda = createCamundaClient();

      const resource = await camunda.getResource(
      {
      resourceKey,
      },
      { consistency: { waitUpToMs: 0 } }
      );

      console.log(`Resource: ${resource.resourceName} (${resource.resourceId})`);
      }

      getResource

      Resource

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

    • Get RPA resource content (deprecated)

      Deprecated — use /resources/{resourceKey}/content/binary instead, which supports all resource types and returns content as binary (octet-stream).

      Returns the content of a deployed RPA resource as JSON. :::info This endpoint only supports RPA resources. For generic resource content in binary format, use the /resources/{resourceKey}/content/binary endpoint. :::

      Parameters

      Returns CancelablePromise<{ [key: string]: unknown }>

      async function getResourceContentExample(resourceKey: ProcessDefinitionKey) {
      const camunda = createCamundaClient();

      const content = await camunda.getResourceContent(
      {
      resourceKey,
      },
      { consistency: { waitUpToMs: 0 } }
      );

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

      getResourceContent

      Resource

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

    • Get resource content as binary

      Returns the content of a deployed resource in binary format (octet-stream). :::info This endpoint does not return BPMN process definitions, DMN decision definitions, or form resources. To query BPMN process definitions or DMN decision definitions, use their respective APIs. :::

      Parameters

      Returns CancelablePromise<Blob>

      async function getResourceContentBinaryExample(resourceKey: ProcessDefinitionKey) {
      const camunda = createCamundaClient();

      const content = await camunda.getResourceContentBinary(
      {
      resourceKey,
      },
      { consistency: { waitUpToMs: 0 } }
      );

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

      getResourceContentBinary

      Resource

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

    • Get the status of the restore that is currently in progress

      Returns the status of the restore that is currently in progress, reported per broker and per partition. There is at most one restore in flight at any time. Once the restore has finished this endpoint returns 404; the per-partition detail is not retained after completion. *

      Parameters

      Returns CancelablePromise<RestoreStatusResponse>

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

      const status = await camunda.getRestoreStatus();

      console.log(`Restore status: ${status.status} (change ${status.changeId})`);
      for (const broker of status.brokers) {
      console.log(
      ` Broker ${broker.brokerId}: ${broker.partitionsRestored}/${broker.partitionsToRestore} partitions restored`
      );
      }
      }

      getRestoreStatus

      Recovery

    • Get runtime backup state

      Returns the current checkpoint and backup state of every partition of the physical tenant. Unlike the backupRuntime actuator, this fails the whole request if the checkpoint state or the backup ranges cannot be retrieved from any partition, instead of silently returning an empty section.

      Parameters

      Returns CancelablePromise<RuntimeBackupState>

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

      const state = await camunda.getRuntimeBackupState();

      for (const checkpoint of state.checkpointStates) {
      console.log(
      `Partition ${checkpoint.partitionId} checkpoint ${checkpoint.checkpointId} (${checkpoint.checkpointType})`
      );
      }
      for (const range of state.ranges) {
      console.log(
      `Partition ${range.partitionId} range: ${range.start?.checkpointId} -> ${range.end?.checkpointId}`
      );
      }
      }

      getRuntimeBackupState

      Backup

    • Get physical tenant status

      Checks the health status of the default physical tenant by verifying if there's at least one partition of its group with a healthy leader. This endpoint is scoped to the default physical tenant only: it is available unprefixed and at /physical-tenants/default/v2/status, but not for any other physical tenant id (/physical-tenants/{id}/v2/status returns 404 for every other id, whether or not a physical tenant with that id exists). On a cluster with only the default physical tenant this endpoint answers the same question as /cluster/v2/status, though not with the same response: /cluster/v2/status reports its status in a body and so also distinguishes a degraded tenant from a healthy one. Use /cluster/v2/status for the aggregated status of the whole cluster, or /physical-tenants/{id}/v2/topology for the health of a specific physical tenant's partitions. *

      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 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(variableKey: VariableKey) {
      const camunda = createCamundaClient();

      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[]

    • List runtime backups

      Returns a list of all available runtime backups of the physical tenant, with their state and additional info, sorted in descending order of backupId.

      Parameters

      Returns CancelablePromise<BackupInfo[]>

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

      // `prefix` must end in a single '*'. Omit it to list every backup.
      const backups = await camunda.listRuntimeBackups({ prefix: '10*' });

      for (const backup of backups) {
      console.log(`Backup ${backup.backupId}: ${backup.state}`);
      }
      }

      listRuntimeBackups

      Backup

    • List secrets (alpha)

      List the camunda.secrets.* references known for the caller's physical tenant.

      Only references the caller holds SECRET:READ on are returned. This endpoint never returns secret values, only the reference names.

      The references are read from the secret stores configured for the caller's physical tenant. Secret names that cannot form a valid camunda.secrets.<name> reference (for example names containing a dot or a dash) are omitted, since they could neither be resolved nor be used in a BPMN expression.

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

      Parameters

      Returns CancelablePromise<SecretListResult>

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

      // The request body is reserved for future filtering options and currently
      // takes no properties.
      const result = await camunda.listSecrets({});

      // Only the references are returned — never the secret values. Use
      // `resolveSecrets` to fetch a value when one is actually needed.
      for (const reference of result.references) {
      console.log(`Secret available: ${reference}`);
      }
      }

      listSecrets

      Secret

    • 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(
      processInstanceKey: ProcessInstanceKey,
      targetProcessDefinitionKey: ProcessDefinitionKey,
      sourceElementId: ElementId,
      targetElementId: ElementId
      ) {
      const camunda = createCamundaClient();

      await camunda.migrateProcessInstance({
      processInstanceKey,
      targetProcessDefinitionKey,
      mappingInstructions: [
      {
      sourceElementId,
      targetElementId,
      },
      ],
      });
      }

      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(
      processDefinitionKey: ProcessDefinitionKey,
      targetProcessDefinitionKey: ProcessDefinitionKey,
      sourceElementId: ElementId,
      targetElementId: ElementId
      ) {
      const camunda = createCamundaClient();

      const result = await camunda.migrateProcessInstancesBatchOperation({
      filter: {
      processDefinitionKey,
      },
      migrationPlan: {
      targetProcessDefinitionKey,
      mappingInstructions: [
      {
      sourceElementId,
      targetElementId,
      },
      ],
      },
      });

      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(
      processInstanceKey: ProcessInstanceKey,
      elementId: ElementId,
      elementInstanceKey: ElementInstanceKey
      ) {
      const camunda = createCamundaClient();

      await camunda.modifyProcessInstance({
      processInstanceKey,
      activateInstructions: [{ elementId }],
      terminateInstructions: [{ elementInstanceKey }],
      });
      }

      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(
      processDefinitionKey: ProcessDefinitionKey,
      sourceElementId: ElementId,
      targetElementId: ElementId
      ) {
      const camunda = createCamundaClient();

      const result = await camunda.modifyProcessInstancesBatchOperation({
      filter: {
      processDefinitionKey,
      },
      moveInstructions: [
      {
      sourceElementId,
      targetElementId,
      },
      ],
      });

      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

    • Pause exporting

      Pauses exporting on all partitions of the physical tenant. While paused, exported records are not committed, so the log is not compacted for the affected partitions.

      With soft=true, exporting continues to run but its position is not committed, so the state after resuming is identical to a hard pause; use this variant when exporting must keep progressing (e.g. to avoid falling behind) while still preventing log compaction, such as during a backup.

      Parameters

      Returns CancelablePromise<void>

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

      // With `soft: true` exporting keeps running but its position is not committed,
      // so the log is still not compacted — use it when exporting must keep
      // progressing, for example while a backup is taken.
      await camunda.pauseExporting({ soft: true });
      }

      pauseExporting

      Exporting

    • 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 secrets (alpha)

      Resolve a deduplicated batch of camunda.secrets.* references for the caller's physical tenant in a single round-trip.

      Each reference is authorized and resolved independently. For valid requests, the endpoint always responds with HTTP 200: successfully resolved references are returned in resolved, while references that could not be resolved (for example not found, malformed or over-long, or the caller lacks SECRET:REVEAL on that reference) are returned in errors. A failure of one reference never fails the others. Only structurally invalid requests are rejected with HTTP 400: a missing or non-array references field, more than 20 references, or a null entry.

      References are resolved against the secret stores configured for the caller's physical tenant, served from the gateway's secret cache when the value is already cached and read from the store otherwise.

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

      Parameters

      Returns CancelablePromise<SecretResolveResult>

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

      const result = await camunda.resolveSecrets({
      references: ['camunda.secrets.myApiToken', 'camunda.secrets.dbPassword'],
      });

      // Successfully resolved references are returned in `resolved`; references that
      // could not be resolved are returned in `errors`, each with a typed error code.
      // Never log a resolved value — it holds secret material. Pass it straight to the
      // consumer that needs it (HTTP client, DB driver, ...) instead.
      for (const resolved of result.resolved) {
      console.log(`Resolved ${resolved.reference} (value redacted)`);
      useSecret(resolved.value);
      }

      for (const error of result.errors) {
      console.log(`Failed to resolve ${error.reference}: ${error.code} - ${error.message}`);
      }
      }

      // Hands the resolved secret to whatever needs it, without logging it.
      function useSecret(_value: string) {}

      resolveSecrets

      Secret

    • Restore from a backup

      Restores the cluster from a backup. The restore is described either by a single backup ID or by a time range (from/to) that selects the backups to restore. This endpoint is only accessible while the cluster is in recovery mode; requests are rejected otherwise. The request is validated and acknowledged, but the restore itself is performed asynchronously. *

      Parameters

      Returns CancelablePromise<ClusterModeChangeResponse>

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

      // The cluster must be in recovery mode before a restore is accepted. Provide
      // either a list of backup IDs (one per partition) or a time range (`from`/`to`)
      // that selects the backups to restore, but not both.
      const change = await camunda.restore({
      backupIds: [100, 101],
      });

      console.log(`Cluster change ${change.changeId}:`);
      for (const op of change.plannedChanges) {
      console.log(` ${op.operation}${op.mode ? ` -> ${op.mode}` : ''}`);
      }
      }

      restore

      Recovery

    • 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(batchOperationKey: BatchOperationKey) {
      const camunda = createCamundaClient();

      await camunda.resumeBatchOperation({ batchOperationKey });
      }

      resumeBatchOperation

      Batch operation

    • Resume exporting

      Resumes exporting on all partitions of the physical tenant after a pause or soft pause.

      Parameters

      Returns CancelablePromise<void>

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

      await camunda.resumeExporting();
      }

      resumeExporting

      Exporting

    • Resume process instance

      Resumes a suspended process instance, returning it to the ACTIVE state and continuing processing. Only process instances in the SUSPENDED state can be resumed.

      Parameters

      • input: { operationReference?: number } & { processInstanceKey: string }
      • Optionaloptions: OperationOptions

      Returns CancelablePromise<void>

      async function resumeProcessInstanceExample(processInstanceKey: ProcessInstanceKey) {
      const camunda = createCamundaClient();

      await camunda.resumeProcessInstance({ processInstanceKey });
      }

      resumeProcessInstance

      Process instance

    • Resume process instances (batch)

      Resumes multiple suspended process instances. Since only SUSPENDED root instances can be resumed, 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 resumeProcessInstancesBatchOperationExample(
      processDefinitionKey: ProcessDefinitionKey
      ) {
      const camunda = createCamundaClient();

      const result = await camunda.resumeProcessInstancesBatchOperation({
      filter: {
      processDefinitionKey,
      },
      });

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

      resumeProcessInstancesBatchOperation

      Process instance

    • 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(elementInstanceKey: ElementInstanceKey) {
      const camunda = createCamundaClient();

      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 element instance wait states

      Returns the wait states for element instances matching the given filter.

      Parameters

      Returns CancelablePromise<ElementInstanceWaitStateQueryResult>

      async function searchElementInstanceWaitStatesExample(processInstanceKey: ProcessInstanceKey) {
      const camunda = createCamundaClient();

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

      for (const waitState of result.items ?? []) {
      const { details } = waitState;
      let description: string;
      if (details.waitStateType === 'JOB') {
      description = `waiting on job '${details.jobType}'`;
      } else if (details.waitStateType === 'MESSAGE') {
      description = `waiting for message '${details.messageName}'`;
      } else {
      description = `waiting (${details.waitStateType})`;
      }
      console.log(`${waitState.elementId}: ${description}`);
      }
      }

      searchElementInstanceWaitStates

      Element instance

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

    • Search message subscriptions

      Search for message subscriptions based on given criteria.

      By default, both start and intermediate event subscriptions are returned. Use the messageSubscriptionType filter to restrict results to a single type.

      Version notes:

      • Start event subscriptions are only captured for deployments made with 8.10 or later.
      • The messageSubscriptionType field is only populated for data created with Camunda 8.10 or later. For pre-8.10 data, intermediate event entries have no messageSubscriptionType value stored. For convenience, the API returns PROCESS_EVENT as a default for such search results, though.
      • Searching for intermediate event subscriptions including legacy data can be achieved by filtering for messageSubscriptionType not matching START_EVENT.

      Parameters

      Returns CancelablePromise<MessageSubscriptionSearchQueryResult>

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

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

      for (const sub of result.items ?? []) {
      console.log(`Subscription: ${sub.messageName}`);
      }
      }

      searchMessageSubscriptions

      Message subscription

      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(processInstanceKey: ProcessInstanceKey) {
      const camunda = createCamundaClient();

      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 user task effective variables

      Search for the effective variables of a user task. This endpoint returns deduplicated variables where each variable name appears at most once. When the same variable name exists at multiple scope levels in the scope hierarchy, the value from the innermost scope (closest to the user task) takes precedence. This is useful for retrieving the actual runtime state of variables as seen by the user task. By default, long variable values in the response are truncated.

      Returns CancelablePromise<VariableSearchQueryResult>

      async function searchUserTaskEffectiveVariablesExample(userTaskKey: UserTaskKey) {
      const camunda = createCamundaClient();

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

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

      searchUserTaskEffectiveVariables

      User task

      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(userTaskKey: UserTaskKey) {
      const camunda = createCamundaClient();

      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(processInstanceKey: ProcessInstanceKey) {
      const camunda = createCamundaClient();

      const result = await camunda.searchVariables(
      {
      filter: {
      processInstanceKey,
      },
      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.

    • Search for process variables and bind them to a Zod schema (the DTO).

      The schema's keys are the exact variable names to fetch; its shape drives validation. Only those declared variables are queried (via a name $in [...] filter), so memory stays bound by the DTO shape rather than the total number of variables on the instance. Results are paged internally until every declared variable is found or the result set is exhausted.

      Returns a VariableMap offering lenient access (has / get) and a strict validate() that parses the collected values against the schema — returning a fully-typed object or throwing a ZodError when a required variable is missing or malformed.

      Type Parameters

      Parameters

      • schema: TSchema

        A Zod object schema declaring the variables to fetch.

      • options: {
            consistency?: { pollIntervalMs?: number; waitUpToMs: number };
            pageSize?: number;
            processInstanceKey: ProcessInstanceKey;
            scopeKey?: ScopeKey;
            tenantId?: TenantId;
        }

        Query scope. processInstanceKey is required; scopeKey narrows to a single element-instance scope, tenantId filters by tenant, and pageSize tunes the page limit. consistency controls eventual-consistency tolerance for the underlying searchVariables calls: it defaults to { waitUpToMs: 0 } (no waiting), but a non-zero waitUpToMs makes the paging calls poll until the data is consistent, avoiding intermittent missing variables / ZodError on a freshly-updated instance.

      Returns CancelablePromise<VariableMap<TSchema>>

      when a declared variable is found at more than one scope and no scopeKey was provided to disambiguate.

      when a variable's value is not valid JSON.

      import { z } from 'zod';
      const OrderVariables = z.object({ orderId: z.string(), amount: z.number().optional() });
      const map = await client.searchVariablesAsDto(OrderVariables, { processInstanceKey });
      if (map.has('amount')) console.log(map.get('amount'));
      const order = map.validate(); // { orderId: string; amount?: number }
    • 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(batchOperationKey: BatchOperationKey) {
      const camunda = createCamundaClient();

      await camunda.suspendBatchOperation({ batchOperationKey });
      }

      suspendBatchOperation

      Batch operation

    • Suspend process instance

      Suspends a running process instance, pausing further processing until it is resumed. Only process instances in the ACTIVE state can be suspended.

      Parameters

      • input: { operationReference?: number } & { processInstanceKey: string }
      • Optionaloptions: OperationOptions

      Returns CancelablePromise<void>

      async function suspendProcessInstanceExample(processInstanceKey: ProcessInstanceKey) {
      const camunda = createCamundaClient();

      await camunda.suspendProcessInstance({ processInstanceKey });
      }

      suspendProcessInstance

      Process instance

    • Suspend process instances (batch)

      Suspends multiple running process instances. Since only ACTIVE root instances can be suspended, 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 suspendProcessInstancesBatchOperationExample(
      processDefinitionKey: ProcessDefinitionKey
      ) {
      const camunda = createCamundaClient();

      const result = await camunda.suspendProcessInstancesBatchOperation({
      filter: {
      processDefinitionKey,
      },
      });

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

      suspendProcessInstancesBatchOperation

      Process instance

    • Force-write runtime backup state

      Force-writes the checkpoint and backup metadata of every partition of the physical tenant to the backup store, independent of any backup being taken or confirmed, and returns the updated state.

      Parameters

      Returns CancelablePromise<RuntimeBackupState>

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

      // Force-writes checkpoint and backup metadata of every partition to the backup
      // store, independent of any backup being taken, and returns the updated state.
      const state = await camunda.syncRuntimeBackupState();

      console.log(`Synced ${state.backupStates.length} partition backup states`);
      }

      syncRuntimeBackupState

      Backup

    • Take a runtime backup

      Triggers a backup of runtime data on all partitions of the physical tenant.

      The backupId must be omitted if continuous backups and/or a backup or checkpoint schedule is enabled for the physical tenant, as the id is generated automatically. Otherwise, backupId is required.

      Parameters

      Returns CancelablePromise<TakeRuntimeBackupResponse>

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

      // Omit `backupId` when continuous backups or a backup/checkpoint schedule is
      // enabled for the physical tenant — the id is then generated by the cluster.
      // Otherwise `backupId` is required and must be higher than any existing one.
      const backup = await camunda.takeRuntimeBackup({ backupId: 100 });

      console.log(`Scheduled backup ${backup.backupId}`);
      }

      takeRuntimeBackup

      Backup

    • 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(groupId: GroupId, clientId: ClientId) {
      const camunda = createCamundaClient();

      await camunda.unassignClientFromGroup({
      groupId,
      clientId,
      });
      }

      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(tenantId: TenantId, groupId: GroupId) {
      const camunda = createCamundaClient();

      await camunda.unassignGroupFromTenant({
      tenantId,
      groupId,
      });
      }

      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(tenantId: TenantId, roleId: RoleId) {
      const camunda = createCamundaClient();

      await camunda.unassignRoleFromTenant({
      tenantId,
      roleId,
      });
      }

      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(groupId: GroupId, username: Username) {
      const camunda = createCamundaClient();

      await camunda.unassignUserFromGroup({
      groupId,
      username,
      });
      }

      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(userTaskKey: UserTaskKey) {
      const camunda = createCamundaClient();

      await camunda.unassignUserTask({ userTaskKey });
      }

      unassignUserTask

      User task

    • Update agent instance

      Updates the mutable fields of an agent instance: status, metric counters, and tools. Metric values are treated as deltas and applied immediately to the aggregate counters. Tool updates replace the existing tool list.

      Parameters

      Returns CancelablePromise<void>

      async function updateAgentInstanceExample(
      agentInstanceKey: AgentInstanceKey,
      elementInstanceKey: ElementInstanceKey
      ) {
      const camunda = createCamundaClient();

      await camunda.updateAgentInstance({
      agentInstanceKey,
      elementInstanceKey,
      status: 'THINKING',
      metrics: {
      inputTokens: 150,
      outputTokens: 50,
      modelCalls: 1,
      },
      });

      console.log(`Updated agent instance: ${agentInstanceKey}`);
      }

      updateAgentInstance

      Agent instance

    • Update authorization

      Update the authorization with the given key. *

      Parameters

      Returns CancelablePromise<void>

      async function updateAuthorizationExample(authorizationKey: AuthorizationKey) {
      const camunda = createCamundaClient();

      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 jobs (batch)

      Creates a batch operation to update jobs matching the given filter. At least one changeset field must be non-null. This is done asynchronously; the progress can be tracked using the batchOperationKey from the response and the batch operation status endpoint (/batch-operations/{batchOperationKey}).

      Parameters

      Returns CancelablePromise<BatchOperationCreatedResult>

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

      const result = await camunda.updateJobsBatchOperation({
      filter: {
      type: 'payment-processing',
      hasFailedWithRetriesLeft: false,
      },
      changeset: {
      retries: 3,
      },
      });

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

      updateJobsBatchOperation

      Job

    • 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(userTaskKey: UserTaskKey) {
      const camunda = createCamundaClient();

      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>