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

CamundaClient

The primary entry point of the SDK.

A CamundaClient is cheap to clone — clones share the same configuration, HTTP client, OAuth token cache, and worker registry.

CamundaClient exposes 260 methods covering the full Orchestration Cluster REST API surface, with authentication, retries, and backpressure applied automatically.

Methods​

MethodDescription
activate_ad_hoc_sub_process_activitiesActivate activities within an ad-hoc sub-process (POST /element-instances/ad-hoc-activities/{adHocSubProcessInstanceKey}/activation).
activate_jobsActivate jobs of a given type. Prefer CamundaClient::create_job_worker for continuous polling.
assign_client_to_groupAssign a client to a group (PUT /groups/{groupId}/clients/{clientId}).
assign_client_to_tenantAssign a client to a tenant (PUT /tenants/{tenantId}/clients/{clientId}).
assign_group_to_tenantAssign a group to a tenant (PUT /tenants/{tenantId}/groups/{groupId}).
assign_mapping_rule_to_groupAssign a mapping rule to a group (PUT /groups/{groupId}/mapping-rules/{mappingRuleId}).
assign_mapping_rule_to_tenantAssign a mapping rule to a tenant (PUT /tenants/{tenantId}/mapping-rules/{mappingRuleId}).
assign_process_instance_business_idAssign business id to process instance (POST /process-instances/{processInstanceKey}/business-id-assignment).
assign_role_to_clientAssign a role to a client (PUT /roles/{roleId}/clients/{clientId}).
assign_role_to_groupAssign a role to a group (PUT /roles/{roleId}/groups/{groupId}).
assign_role_to_mapping_ruleAssign a role to a mapping rule (PUT /roles/{roleId}/mapping-rules/{mappingRuleId}).
assign_role_to_tenantAssign a role to a tenant (PUT /tenants/{tenantId}/roles/{roleId}).
assign_role_to_userAssign a role to a user (PUT /roles/{roleId}/users/{username}).
assign_user_taskAssign user task (POST /user-tasks/{userTaskKey}/assignment).
assign_user_to_groupAssign a user to a group (PUT /groups/{groupId}/users/{username}).
assign_user_to_tenantAssign a user to a tenant (PUT /tenants/{tenantId}/users/{username}).
authThe authentication handler.
backpressure_stateA snapshot of the adaptive backpressure controller's state, for observability.
broadcast_signalBroadcast a signal. The configured default tenant id is applied when unset.
cancel_batch_operationCancel Batch operation (POST /batch-operations/{batchOperationKey}/cancellation).
cancel_cluster_rebalanceStop the running rebalance (DELETE /cluster/v2/rebalance).
cancel_process_instanceCancel a running process instance by key.
cancel_process_instances_batch_operationCancel process instances (batch) (POST /process-instances/cancellation).
change_cluster_modeChange cluster mode (PATCH /mode).
change_cluster_mode_as_cluster_adminChange the cluster mode of one or every physical tenant (PATCH /cluster/v2/mode).
clockThe clock this client's cadence resolves through.
complete_jobComplete a job, optionally with output variables.
complete_user_taskComplete user task (POST /user-tasks/{userTaskKey}/completion).
configThe resolved configuration.
configurationBuild a generated-client Configuration with the base URL set and the current authentication applied (refreshing the OAuth token if needed).
correlate_messageCorrelate a message to a waiting process instance. The configured default tenant id is applied when unset.
create_admin_userCreate admin user (POST /setup/user).
create_agent_instanceCreate agent instance (POST /agent-instances).
create_authorizationCreate authorization (POST /authorizations).
create_deploymentDeploy resources (POST /deployments).
create_documentUpload document (POST /documents).
create_document_linkCreate document link (POST /documents/{documentId}/links).
create_documentsUpload multiple documents (POST /documents/batch).
create_element_instance_variablesUpdate element instance variables (PUT /element-instances/{elementInstanceKey}/variables).
create_global_cluster_variableCreate a global-scoped cluster variable (POST /cluster-variables/global).
create_global_task_listenerCreate global user task listener (POST /global-task-listeners).
create_groupCreate group (POST /groups).
create_job_workerCreate a JobWorker that continuously polls for and processes jobs of the configured type. Call JobWorker::run (or JobWorker::start / JobWorker::spawn) to begin.
create_mapping_ruleCreate mapping rule (POST /mapping-rules).
create_process_instanceCreate (start) a process instance. The configured default tenant id is applied when the instruction does not already specify one.
create_roleCreate role (POST /roles).
create_tenantCreate tenant (POST /tenants).
create_tenant_cluster_variableCreate a tenant-scoped cluster variable (POST /cluster-variables/tenants/{tenantId}).
create_userCreate user (POST /users).
delete_authorizationDelete authorization (DELETE /authorizations/{authorizationKey}).
delete_decision_instanceDelete decision instance (POST /decision-instances/{decisionEvaluationKey}/deletion).
delete_decision_instances_batch_operationDelete decision instances (batch) (POST /decision-instances/deletion).
delete_documentDelete document (DELETE /documents/{documentId}).
delete_global_cluster_variableDelete a global-scoped cluster variable (DELETE /cluster-variables/global/{name}).
delete_global_task_listenerDelete global user task listener (DELETE /global-task-listeners/{id}).
delete_groupDelete group (DELETE /groups/{groupId}).
delete_history_backupDelete history backup (DELETE /backups/history/{backupId}).
delete_history_backup_as_cluster_adminDelete a history backup across physical tenants (DELETE /cluster/v2/backups/history/{backupId}).
delete_mapping_ruleDelete a mapping rule (DELETE /mapping-rules/{mappingRuleId}).
delete_process_instanceDelete process instance (POST /process-instances/{processInstanceKey}/deletion).
delete_process_instances_batch_operationDelete process instances (batch) (POST /process-instances/deletion).
delete_resourceDelete resource (POST /resources/{resourceKey}/deletion).
delete_roleDelete role (DELETE /roles/{roleId}).
delete_runtime_backupDelete runtime backup (DELETE /backups/runtime/{backupId}).
delete_runtime_backup_as_cluster_adminDelete a runtime backup across physical tenants (DELETE /cluster/v2/backups/runtime/{backupId}).
delete_runtime_backup_stateDelete runtime backup state (DELETE /backups/runtime/state).
delete_runtime_backup_state_as_cluster_adminDelete runtime backup state across physical tenants (DELETE /cluster/v2/backups/runtime/state).
delete_tenantDelete tenant (DELETE /tenants/{tenantId}).
delete_tenant_cluster_variableDelete a tenant-scoped cluster variable (DELETE /cluster-variables/tenants/{tenantId}/{name}).
delete_userDelete user (DELETE /users/{username}).
deploy_resourcesDeploy one or more resources (BPMN, DMN, forms) from local file paths. The configured default tenant id is applied when tenant_id is None.
evaluate_conditionalsEvaluate root level conditional start events (POST /conditionals/evaluation).
evaluate_decisionEvaluate a decision (DMN). The configured default tenant id is applied when unset.
evaluate_expressionEvaluate an expression (POST /expression/evaluation).
eventualPoll a read operation until it returns Ok, retrying 404 Not Found (the typical symptom of a not-yet-replicated read) until the eventual-consistency window elapses.
eventual_untilPoll a read operation until predicate is satisfied by its result, retrying 404 and ignoring consistent-but-not-yet-matching reads, until the eventual-consistency window elapses.
fail_jobFail a job, decrementing retries.
from_envConstruct a client from environment variables only.
get_agent_definitionGet agent definition (GET /agent-definitions/{agentDefinitionKey}).
get_agent_instanceGet agent instance (GET /agent-instances/{agentInstanceKey}).
get_audit_logGet audit log (GET /audit-logs/{auditLogKey}).
get_authenticationGet current user (GET /authentication/me).
get_authorizationGet authorization (GET /authorizations/{authorizationKey}).
get_batch_operationGet batch operation (GET /batch-operations/{batchOperationKey}).
get_cluster_exporting_statusGet exporting status of the whole cluster (GET /cluster/v2/exporting).
get_cluster_rebalanceReport the cluster's current leadership balance (GET /cluster/v2/rebalance).
get_cluster_statusGet the status of the whole cluster (GET /cluster/v2/status).
get_cluster_topologyGet the topology of the whole cluster (GET /cluster/v2/topology).
get_decision_definitionGet decision definition (GET /decision-definitions/{decisionDefinitionKey}).
get_decision_definition_xmlGet decision definition XML (GET /decision-definitions/{decisionDefinitionKey}/xml).
get_decision_instanceGet decision instance (GET /decision-instances/{decisionEvaluationInstanceKey}).
get_decision_requirementsGet decision requirements (GET /decision-requirements/{decisionRequirementsKey}).
get_decision_requirements_xmlGet decision requirements XML (GET /decision-requirements/{decisionRequirementsKey}/xml).
get_documentDownload document (GET /documents/{documentId}).
get_element_instanceGet element instance (GET /element-instances/{elementInstanceKey}).
get_exporting_statusGet exporting status (GET /exporting).
get_form_by_keyGet form by key (GET /forms/{formKey}).
get_global_cluster_variableGet a global-scoped cluster variable (GET /cluster-variables/global/{name}).
get_global_job_statisticsGlobal job statistics (GET /jobs/statistics/global).
get_global_task_listenerGet global user task listener (GET /global-task-listeners/{id}).
get_groupGet group (GET /groups/{groupId}).
get_history_backupGet history backup (GET /backups/history/{backupId}).
get_history_backup_as_cluster_adminGet a history backup across physical tenants (GET /cluster/v2/backups/history/{backupId}).
get_incidentGet incident (GET /incidents/{incidentKey}).
get_job_error_statisticsGet error metrics for a job type (POST /jobs/statistics/errors).
get_job_time_series_statisticsGet time-series metrics for a job type (POST /jobs/statistics/time-series).
get_job_type_statisticsGet job statistics by type (POST /jobs/statistics/by-types).
get_job_worker_statisticsGet job statistics by worker (POST /jobs/statistics/by-workers).
get_licenseGet license status (GET /license).
get_mapping_ruleGet a mapping rule (GET /mapping-rules/{mappingRuleId}).
get_process_definitionGet process definition (GET /process-definitions/{processDefinitionKey}).
get_process_definition_instance_statisticsGet process instance statistics (POST /process-definitions/statistics/process-instances).
get_process_definition_instance_version_statisticsGet process instance statistics by version (POST /process-definitions/statistics/process-instances-by-version).
get_process_definition_message_subscription_statisticsGet message subscription statistics (POST /process-definitions/statistics/message-subscriptions).
get_process_definition_statisticsGet process definition statistics (POST /process-definitions/{processDefinitionKey}/statistics/element-instances).
get_process_definition_xmlGet process definition XML (GET /process-definitions/{processDefinitionKey}/xml).
get_process_instanceFetch a process instance by key (a read; not subject to backpressure). Returns a 404 CamundaError::Api if not yet visible — compose with CamundaClient::eventual to wait through replication lag.
get_process_instance_call_hierarchyGet call hierarchy (GET /process-instances/{processInstanceKey}/call-hierarchy).
get_process_instance_sequence_flowsGet sequence flows (GET /process-instances/{processInstanceKey}/sequence-flows).
get_process_instance_statisticsGet element instance statistics (GET /process-instances/{processInstanceKey}/statistics/element-instances).
get_process_instance_statistics_by_definitionGet process instance statistics by definition (POST /incidents/statistics/process-instances-by-definition).
get_process_instance_statistics_by_errorGet process instance statistics by error (POST /incidents/statistics/process-instances-by-error).
get_process_instance_wait_state_statisticsGet wait state statistics (GET /process-instances/{processInstanceKey}/statistics/wait-states).
get_resourceGet resource (GET /resources/{resourceKey}).
get_resource_contentGet RPA resource content (deprecated) (GET /resources/{resourceKey}/content).
get_resource_content_binaryGet resource content as binary (GET /resources/{resourceKey}/content/binary).
get_restore_statusGet the status of the restore that is currently in progress (GET /restore).
get_roleGet role (GET /roles/{roleId}).
get_runtime_backupGet runtime backup (GET /backups/runtime/{backupId}).
get_runtime_backup_as_cluster_adminGet a runtime backup across physical tenants (GET /cluster/v2/backups/runtime/{backupId}).
get_runtime_backup_stateGet runtime backup state (GET /backups/runtime/state).
get_runtime_backup_state_as_cluster_adminGet runtime backup state across physical tenants (GET /cluster/v2/backups/runtime/state).
get_start_process_formGet process start form (GET /process-definitions/{processDefinitionKey}/form).
get_statusGet physical tenant status (GET /status).
get_system_configurationSystem configuration (alpha) (GET /system/configuration).
get_tenantGet tenant (GET /tenants/{tenantId}).
get_tenant_cluster_variableGet a tenant-scoped cluster variable (GET /cluster-variables/tenants/{tenantId}/{name}).
get_usage_metricsGet usage metrics (GET /system/usage-metrics).
get_userGet user (GET /users/{username}).
get_user_taskGet user task (GET /user-tasks/{userTaskKey}).
get_user_task_formGet user task form (GET /user-tasks/{userTaskKey}/form).
get_variableGet variable (GET /variables/{variableKey}).
init_loggingInstall a formatting tracing subscriber filtered to the configured CAMUNDA_SDK_LOG_LEVEL. No-op if a global subscriber is already set or logging is off. Returns true if this call installed the subscriber.
list_history_backupsList history backups (GET /backups/history).
list_history_backups_as_cluster_adminList history backups across physical tenants (GET /cluster/v2/backups/history).
list_runtime_backupsList runtime backups (GET /backups/runtime).
list_runtime_backups_as_cluster_adminList runtime backups across physical tenants (GET /cluster/v2/backups/runtime).
list_secretsList secrets (alpha) (POST /secrets/list).
migrate_process_instanceMigrate process instance (POST /process-instances/{processInstanceKey}/migration).
migrate_process_instances_batch_operationMigrate process instances (batch) (POST /process-instances/migration).
modify_process_instanceModify process instance (POST /process-instances/{processInstanceKey}/modification).
modify_process_instances_batch_operationModify process instances (batch) (POST /process-instances/modification).
newConstruct a client from CamundaOptions (environment + overrides).
pause_cluster_exportingPause exporting across the whole cluster (POST /cluster/v2/exporting/pause).
pause_exportingPause exporting (POST /exporting/pause).
pin_clockPin internal clock (alpha) (PUT /clock).
publish_messagePublish a message (no correlation key matching against active subscriptions only — buffered). The configured default tenant id is applied when unset.
reset_clockReset internal clock (alpha) (POST /clock/reset).
resolve_incidentResolve incident (POST /incidents/{incidentKey}/resolution).
resolve_incidents_batch_operationResolve related incidents (batch) (POST /process-instances/incident-resolution).
resolve_process_instance_incidentsResolve related incidents (POST /process-instances/{processInstanceKey}/incident-resolution).
resolve_secretsResolve secrets (alpha) (POST /secrets/resolve).
restoreRestore from a backup (POST /restore).
restore_as_cluster_adminRestore one or every physical tenant from a backup (POST /cluster/v2/restore).
resume_batch_operationResume Batch operation (POST /batch-operations/{batchOperationKey}/resumption).
resume_cluster_exportingResume exporting across the whole cluster (POST /cluster/v2/exporting/resume).
resume_exportingResume exporting (POST /exporting/resume).
resume_process_instanceResume process instance (POST /process-instances/{processInstanceKey}/resumption).
resume_process_instances_batch_operationResume process instances (batch) (POST /process-instances/resumption).
running_workersThe job types of all currently-registered workers that are still running.
search_agent_definitionsSearch agent definitions (POST /agent-definitions/search).
search_agent_instance_historySearch agent instance history (POST /agent-instances/{agentInstanceKey}/history/search).
search_agent_instancesSearch agent instances (POST /agent-instances/search).
search_audit_logsSearch audit logs (POST /audit-logs/search).
search_authorizationsSearch authorizations (POST /authorizations/search).
search_batch_operation_itemsSearch batch operation items (POST /batch-operation-items/search).
search_batch_operationsSearch batch operations (POST /batch-operations/search).
search_clients_for_groupSearch group clients (POST /groups/{groupId}/clients/search).
search_clients_for_roleSearch role clients (POST /roles/{roleId}/clients/search).
search_clients_for_tenantSearch clients for tenant (POST /tenants/{tenantId}/clients/search).
search_cluster_variablesSearch for cluster variables based on given criteria (POST /cluster-variables/search).
search_correlated_message_subscriptionsSearch correlated message subscriptions (POST /correlated-message-subscriptions/search).
search_decision_definitionsSearch decision definitions (POST /decision-definitions/search).
search_decision_instancesSearch decision instances (POST /decision-instances/search).
search_decision_requirementsSearch decision requirements (POST /decision-requirements/search).
search_element_instance_incidentsSearch for incidents of a specific element instance (POST /element-instances/{elementInstanceKey}/incidents/search).
search_element_instance_wait_statesSearch element instance wait states (POST /element-instances/wait-states/search).
search_element_instancesSearch element instances (POST /element-instances/search).
search_global_task_listenersSearch global user task listeners (POST /global-task-listeners/search).
search_group_ids_for_tenantSearch groups for tenant (POST /tenants/{tenantId}/groups/search).
search_groupsSearch groups (POST /groups/search).
search_groups_for_roleSearch role groups (POST /roles/{roleId}/groups/search).
search_incidentsSearch incidents (POST /incidents/search).
search_jobsSearch jobs (POST /jobs/search).
search_mapping_ruleSearch mapping rules (POST /mapping-rules/search).
search_mapping_rules_for_groupSearch group mapping rules (POST /groups/{groupId}/mapping-rules/search).
search_mapping_rules_for_roleSearch role mapping rules (POST /roles/{roleId}/mapping-rules/search).
search_mapping_rules_for_tenantSearch mapping rules for tenant (POST /tenants/{tenantId}/mapping-rules/search).
search_message_subscriptionsSearch message subscriptions (POST /message-subscriptions/search).
search_own_authorizationsSearch own authorizations (POST /authentication/me/authorizations/search).
search_process_definition_variable_namesSearch process definition variable names (POST /process-definitions/{processDefinitionKey}/variable-names/search).
search_process_definitionsSearch process definitions (POST /process-definitions/search).
search_process_instance_incidentsSearch related incidents (POST /process-instances/{processInstanceKey}/incidents/search).
search_process_instancesSearch process instances (POST /process-instances/search).
search_resourcesSearch resources (POST /resources/search).
search_rolesSearch roles (POST /roles/search).
search_roles_for_groupSearch group roles (POST /groups/{groupId}/roles/search).
search_roles_for_tenantSearch roles for tenant (POST /tenants/{tenantId}/roles/search).
search_tenantsSearch tenants (POST /tenants/search).
search_user_task_audit_logsSearch user task audit logs (POST /user-tasks/{userTaskKey}/audit-logs/search).
search_user_task_effective_variablesSearch user task effective variables (POST /user-tasks/{userTaskKey}/effective-variables/search).
search_user_task_variablesSearch user task variables (POST /user-tasks/{userTaskKey}/variables/search).
search_user_tasksSearch user tasks (POST /user-tasks/search).
search_usersSearch users (POST /users/search).
search_users_for_groupSearch group users (POST /groups/{groupId}/users/search).
search_users_for_roleSearch role users (POST /roles/{roleId}/users/search).
search_users_for_tenantSearch users for tenant (POST /tenants/{tenantId}/users/search).
search_variablesSearch variables, returning the raw generated result.
search_variables_asSearch variables and deserialize each variable's JSON value into a typed T.
spawn_workerSpawn a managed job worker and register it for lifecycle control. The returned handle can stop the individual worker; CamundaClient::stop_all_workers stops every registered worker. The worker is also retained by the client so it keeps running even if the returned handle is dropped.
stop_all_workersGracefully stop every registered worker, letting in-flight jobs drain, and await their completion. Clears the registry.
suspend_batch_operationSuspend Batch operation (POST /batch-operations/{batchOperationKey}/suspension).
suspend_process_instanceSuspend process instance (POST /process-instances/{processInstanceKey}/suspension).
suspend_process_instances_batch_operationSuspend process instances (batch) (POST /process-instances/suspension).
sync_runtime_backup_stateForce-write runtime backup state (POST /backups/runtime/state/sync).
sync_runtime_backup_state_as_cluster_adminForce-write runtime backup state across physical tenants (POST /cluster/v2/backups/runtime/state/sync).
take_history_backupTake a history backup (POST /backups/history).
take_history_backup_as_cluster_adminTake a history backup on one or every physical tenant (POST /cluster/v2/backups/history).
take_runtime_backupTake a runtime backup (POST /backups/runtime).
take_runtime_backup_as_cluster_adminTake a runtime backup on one or every physical tenant (POST /cluster/v2/backups/runtime).
throw_job_errorThrow a BPMN error from a job.
topologyFetch the cluster topology.
trigger_cluster_rebalanceTrigger a cluster-wide leadership rebalance (POST /cluster/v2/rebalance).
unassign_client_from_groupUnassign a client from a group (DELETE /groups/{groupId}/clients/{clientId}).
unassign_client_from_tenantUnassign a client from a tenant (DELETE /tenants/{tenantId}/clients/{clientId}).
unassign_group_from_tenantUnassign a group from a tenant (DELETE /tenants/{tenantId}/groups/{groupId}).
unassign_mapping_rule_from_groupUnassign a mapping rule from a group (DELETE /groups/{groupId}/mapping-rules/{mappingRuleId}).
unassign_mapping_rule_from_tenantUnassign a mapping rule from a tenant (DELETE /tenants/{tenantId}/mapping-rules/{mappingRuleId}).
unassign_role_from_clientUnassign a role from a client (DELETE /roles/{roleId}/clients/{clientId}).
unassign_role_from_groupUnassign a role from a group (DELETE /roles/{roleId}/groups/{groupId}).
unassign_role_from_mapping_ruleUnassign a role from a mapping rule (DELETE /roles/{roleId}/mapping-rules/{mappingRuleId}).
unassign_role_from_tenantUnassign a role from a tenant (DELETE /tenants/{tenantId}/roles/{roleId}).
unassign_role_from_userUnassign a role from a user (DELETE /roles/{roleId}/users/{username}).
unassign_user_from_groupUnassign a user from a group (DELETE /groups/{groupId}/users/{username}).
unassign_user_from_tenantUnassign a user from a tenant (DELETE /tenants/{tenantId}/users/{username}).
unassign_user_taskUnassign user task (DELETE /user-tasks/{userTaskKey}/assignee).
update_agent_instanceUpdate agent instance (PATCH /agent-instances/{agentInstanceKey}).
update_authorizationUpdate authorization (PUT /authorizations/{authorizationKey}).
update_global_cluster_variableUpdate a global-scoped cluster variable (PUT /cluster-variables/global/{name}).
update_global_task_listenerUpdate global user task listener (PUT /global-task-listeners/{id}).
update_groupUpdate group (PUT /groups/{groupId}).
update_jobUpdate job (PATCH /jobs/{jobKey}).
update_jobs_batch_operationUpdate jobs (batch) (POST /jobs/batch-update).
update_mapping_ruleUpdate mapping rule (PUT /mapping-rules/{mappingRuleId}).
update_roleUpdate role (PUT /roles/{roleId}).
update_tenantUpdate tenant (PUT /tenants/{tenantId}).
update_tenant_cluster_variableUpdate a tenant-scoped cluster variable (PUT /cluster-variables/tenants/{tenantId}/{name}).
update_userUpdate user (PUT /users/{username}).
update_user_taskUpdate user task (PATCH /user-tasks/{userTaskKey}).
worker_configBuild a JobWorkerConfig for job_type pre-seeded from the SDK's resolved worker defaults (env-driven: CAMUNDA_WORKER_*). Builder methods override fields.

Method details​

activate_ad_hoc_sub_process_activities​

pub async fn activate_ad_hoc_sub_process_activities(&self, params: ActivateAdHocSubProcessActivitiesParams) -> Result<()>

Activate activities within an ad-hoc sub-process (POST /element-instances/ad-hoc-activities/{adHocSubProcessInstanceKey}/activation).

Example

async fn activate_ad_hoc_sub_process_activities(
ad_hoc_sub_process_instance_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.activate_ad_hoc_sub_process_activities(ActivateAdHocSubProcessActivitiesParams {
ad_hoc_sub_process_instance_key,
ad_hoc_sub_process_activate_activities_instruction:
AdHocSubProcessActivateActivitiesInstruction {
elements: vec![AdHocSubProcessActivateActivityReference {
element_id: ElementId::assume_exists("my-element"),
..Default::default()
}],
..Default::default()
},
})
.await?;
println!("Activate activities within an ad-hoc sub-process: done");

Ok(())
}

activate_jobs​

pub async fn activate_jobs(&self, request: models::JobActivationRequest) -> Result<models::JobActivationResult>

Activate jobs of a given type. Prefer CamundaClient::create_job_worker for continuous polling.

Example

async fn activate_jobs() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

// For long-running workers prefer `client.create_job_worker(..)`, which handles
// polling, back-off, and concurrency for you.
let activated = client
.activate_jobs(JobActivationRequest {
r#type: "payment-service".to_string(),
timeout: 60_000,
max_jobs_to_activate: 10,
worker: Some("payment-worker".to_string()),
..Default::default()
})
.await?;

for job in activated.jobs {
println!("Activated job {} for {}", job.job_key, job.element_id);
}

Ok(())
}

assign_client_to_group​

pub async fn assign_client_to_group(&self, params: AssignClientToGroupParams) -> Result<()>

Assign a client to a group (PUT /groups/{groupId}/clients/{clientId}).

Example

async fn assign_client_to_group(
group_id: String,
client_id: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.assign_client_to_group(AssignClientToGroupParams {
group_id,
client_id,
})
.await?;
println!("Assign a client to a group: done");

Ok(())
}

assign_client_to_tenant​

pub async fn assign_client_to_tenant(&self, params: AssignClientToTenantParams) -> Result<()>

Assign a client to a tenant (PUT /tenants/{tenantId}/clients/{clientId}).

Example

async fn assign_client_to_tenant(
tenant_id: String,
client_id: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.assign_client_to_tenant(AssignClientToTenantParams {
tenant_id,
client_id,
})
.await?;
println!("Assign a client to a tenant: done");

Ok(())
}

assign_group_to_tenant​

pub async fn assign_group_to_tenant(&self, params: AssignGroupToTenantParams) -> Result<()>

Assign a group to a tenant (PUT /tenants/{tenantId}/groups/{groupId}).

Example

async fn assign_group_to_tenant(
tenant_id: String,
group_id: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.assign_group_to_tenant(AssignGroupToTenantParams {
tenant_id,
group_id,
})
.await?;
println!("Assign a group to a tenant: done");

Ok(())
}

assign_mapping_rule_to_group​

pub async fn assign_mapping_rule_to_group(&self, params: AssignMappingRuleToGroupParams) -> Result<()>

Assign a mapping rule to a group (PUT /groups/{groupId}/mapping-rules/{mappingRuleId}).

Example

async fn assign_mapping_rule_to_group(
group_id: String,
mapping_rule_id: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.assign_mapping_rule_to_group(AssignMappingRuleToGroupParams {
group_id,
mapping_rule_id,
})
.await?;
println!("Assign a mapping rule to a group: done");

Ok(())
}

assign_mapping_rule_to_tenant​

pub async fn assign_mapping_rule_to_tenant(&self, params: AssignMappingRuleToTenantParams) -> Result<()>

Assign a mapping rule to a tenant (PUT /tenants/{tenantId}/mapping-rules/{mappingRuleId}).

Example

async fn assign_mapping_rule_to_tenant(
tenant_id: String,
mapping_rule_id: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.assign_mapping_rule_to_tenant(AssignMappingRuleToTenantParams {
tenant_id,
mapping_rule_id,
})
.await?;
println!("Assign a mapping rule to a tenant: done");

Ok(())
}

assign_process_instance_business_id​

pub async fn assign_process_instance_business_id(&self, params: AssignProcessInstanceBusinessIdParams) -> Result<()>

Assign business id to process instance (POST /process-instances/{processInstanceKey}/business-id-assignment).

Example

async fn assign_process_instance_business_id(
process_instance_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.assign_process_instance_business_id(AssignProcessInstanceBusinessIdParams {
process_instance_key,
process_instance_business_id_assignment_instruction:
ProcessInstanceBusinessIdAssignmentInstruction {
business_id: BusinessId::assume_exists("my-business-id"),
},
})
.await?;
println!("Assign business id to process instance: done");

Ok(())
}

assign_role_to_client​

pub async fn assign_role_to_client(&self, params: AssignRoleToClientParams) -> Result<()>

Assign a role to a client (PUT /roles/{roleId}/clients/{clientId}).

Example

async fn assign_role_to_client(
role_id: String,
client_id: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.assign_role_to_client(AssignRoleToClientParams { role_id, client_id })
.await?;
println!("Assign a role to a client: done");

Ok(())
}

assign_role_to_group​

pub async fn assign_role_to_group(&self, params: AssignRoleToGroupParams) -> Result<()>

Assign a role to a group (PUT /roles/{roleId}/groups/{groupId}).

Example

async fn assign_role_to_group(
role_id: String,
group_id: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.assign_role_to_group(AssignRoleToGroupParams { role_id, group_id })
.await?;
println!("Assign a role to a group: done");

Ok(())
}

assign_role_to_mapping_rule​

pub async fn assign_role_to_mapping_rule(&self, params: AssignRoleToMappingRuleParams) -> Result<()>

Assign a role to a mapping rule (PUT /roles/{roleId}/mapping-rules/{mappingRuleId}).

Example

async fn assign_role_to_mapping_rule(
role_id: String,
mapping_rule_id: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.assign_role_to_mapping_rule(AssignRoleToMappingRuleParams {
role_id,
mapping_rule_id,
})
.await?;
println!("Assign a role to a mapping rule: done");

Ok(())
}

assign_role_to_tenant​

pub async fn assign_role_to_tenant(&self, params: AssignRoleToTenantParams) -> Result<()>

Assign a role to a tenant (PUT /tenants/{tenantId}/roles/{roleId}).

Example

async fn assign_role_to_tenant(
tenant_id: String,
role_id: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.assign_role_to_tenant(AssignRoleToTenantParams { tenant_id, role_id })
.await?;
println!("Assign a role to a tenant: done");

Ok(())
}

assign_role_to_user​

pub async fn assign_role_to_user(&self, params: AssignRoleToUserParams) -> Result<()>

Assign a role to a user (PUT /roles/{roleId}/users/{username}).

Example

async fn assign_role_to_user(
role_id: String,
username: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.assign_role_to_user(AssignRoleToUserParams { role_id, username })
.await?;
println!("Assign a role to a user: done");

Ok(())
}

assign_user_task​

pub async fn assign_user_task(&self, params: AssignUserTaskParams) -> Result<()>

Assign user task (POST /user-tasks/{userTaskKey}/assignment).

Example

async fn assign_user_task(user_task_key: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.assign_user_task(AssignUserTaskParams {
user_task_key,
user_task_assignment_request: UserTaskAssignmentRequest::default(),
})
.await?;
println!("Assign user task: done");

Ok(())
}

assign_user_to_group​

pub async fn assign_user_to_group(&self, params: AssignUserToGroupParams) -> Result<()>

Assign a user to a group (PUT /groups/{groupId}/users/{username}).

Example

async fn assign_user_to_group(
group_id: String,
username: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.assign_user_to_group(AssignUserToGroupParams { group_id, username })
.await?;
println!("Assign a user to a group: done");

Ok(())
}

assign_user_to_tenant​

pub async fn assign_user_to_tenant(&self, params: AssignUserToTenantParams) -> Result<()>

Assign a user to a tenant (PUT /tenants/{tenantId}/users/{username}).

Example

async fn assign_user_to_tenant(
tenant_id: String,
username: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.assign_user_to_tenant(AssignUserToTenantParams {
tenant_id,
username,
})
.await?;
println!("Assign a user to a tenant: done");

Ok(())
}

auth​

pub fn auth(&self) -> &Authentication

The authentication handler.

backpressure_state​

pub fn backpressure_state(&self) -> BackpressureState

A snapshot of the adaptive backpressure controller's state, for observability.

broadcast_signal​

pub async fn broadcast_signal(&self, request: models::SignalBroadcastRequest) -> Result<models::SignalBroadcastResult>

Broadcast a signal. The configured default tenant id is applied when unset.

Example

async fn broadcast_signal() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let broadcast = client
.broadcast_signal(SignalBroadcastRequest {
signal_name: "cancel-all-orders".to_string(),
variables: Some(
[("reason".to_string(), serde_json::json!("stock outage"))]
.into_iter()
.collect(),
),
..Default::default()
})
.await?;

println!("Broadcast signal {}", broadcast.signal_key);

Ok(())
}

cancel_batch_operation​

pub async fn cancel_batch_operation(&self, params: CancelBatchOperationParams) -> Result<()>

Cancel Batch operation (POST /batch-operations/{batchOperationKey}/cancellation).

Example

async fn cancel_batch_operation(
batch_operation_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.cancel_batch_operation(CancelBatchOperationParams {
batch_operation_key,
})
.await?;
println!("Cancel Batch operation: done");

Ok(())
}

cancel_cluster_rebalance​

pub async fn cancel_cluster_rebalance(&self) -> Result<models::RebalanceCancellationResponse>

Stop the running rebalance (DELETE /cluster/v2/rebalance).

Example

async fn cancel_cluster_rebalance() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client.cancel_cluster_rebalance().await?;
println!("{result:#?}");

Ok(())
}

cancel_process_instance​

pub async fn cancel_process_instance(&self, process_instance_key: &str, request: Option<models::CancelProcessInstanceRequest>) -> Result<()>

Cancel a running process instance by key.

Example

async fn cancel_process_instance(
process_instance_key: &str,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

// Pass `Some(CancelProcessInstanceRequest { .. })` to supply an operation reference.
client
.cancel_process_instance(process_instance_key, None)
.await?;

println!("Cancelled process instance {process_instance_key}");

Ok(())
}

cancel_process_instances_batch_operation​

pub async fn cancel_process_instances_batch_operation(&self, params: CancelProcessInstancesBatchOperationParams) -> Result<models::BatchOperationCreatedResult>

Cancel process instances (batch) (POST /process-instances/cancellation).

Example

async fn cancel_process_instances_batch_operation() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.cancel_process_instances_batch_operation(CancelProcessInstancesBatchOperationParams {
process_instance_cancellation_batch_operation_request:
ProcessInstanceCancellationBatchOperationRequest {
filter: Box::new(ProcessInstanceFilter::default()),
..Default::default()
},
})
.await?;
println!("{}", result.batch_operation_key);

Ok(())
}

change_cluster_mode​

pub async fn change_cluster_mode(&self, params: ChangeClusterModeParams) -> Result<models::ClusterModeChangeResponse>

Change cluster mode (PATCH /mode).

Example

async fn change_cluster_mode() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.change_cluster_mode(ChangeClusterModeParams {
mode: Mode::Recovering,
dry_run: None,
})
.await?;
println!("{}", result.change_id);

Ok(())
}

change_cluster_mode_as_cluster_admin​

pub async fn change_cluster_mode_as_cluster_admin(&self, params: ChangeClusterModeAsClusterAdminParams) -> Result<models::ClusterModeChangeResponse>

Change the cluster mode of one or every physical tenant (PATCH /cluster/v2/mode).

Example

async fn change_cluster_mode_as_cluster_admin() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

// Omit `physical_tenant_id` to apply the change to every physical tenant.
let result = client
.change_cluster_mode_as_cluster_admin(ChangeClusterModeAsClusterAdminParams {
mode: Mode::Recovering,
physical_tenant_id: Some("default".to_string()),
dry_run: Some(true),
})
.await?;
println!("{}", result.change_id);

Ok(())
}

clock​

pub fn clock(&self) -> &Arc<dyn Clock>

The clock this client's cadence resolves through.

complete_job​

pub async fn complete_job(&self, job_key: &str, request: Option<models::JobCompletionRequest>) -> Result<()>

Complete a job, optionally with output variables.

Job completion is a drain operation and intentionally bypasses the backpressure gate so in-flight work can always be drained, even while new load is being shed.

Example

async fn complete_job(job_key: &str) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.complete_job(
job_key,
Some(JobCompletionRequest {
variables: Some(Some(
[("paymentStatus".to_string(), serde_json::json!("SETTLED"))]
.into_iter()
.collect(),
)),
..Default::default()
}),
)
.await?;

println!("Completed job {job_key}");

Ok(())
}

complete_user_task​

pub async fn complete_user_task(&self, params: CompleteUserTaskParams) -> Result<()>

Complete user task (POST /user-tasks/{userTaskKey}/completion).

Example

async fn complete_user_task(user_task_key: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.complete_user_task(CompleteUserTaskParams {
user_task_key,
user_task_completion_request: Some(UserTaskCompletionRequest::default()),
})
.await?;
println!("Complete user task: done");

Ok(())
}

config​

pub fn config(&self) -> &CamundaConfig

The resolved configuration.

configuration​

pub async fn configuration(&self) -> Result<Configuration>

Build a generated-client Configuration with the base URL set and the current authentication applied (refreshing the OAuth token if needed).

Use this to call generated operations that the facade does not yet wrap:

use camunda_orchestration_sdk::client::apis::authentication_api;
let client = CamundaClient::from_env()?;
let cfg = client.configuration().await?;
let me = authentication_api::get_authentication(&cfg).await?;

correlate_message​

pub async fn correlate_message(&self, request: models::MessageCorrelationRequest) -> Result<models::MessageCorrelationResult>

Correlate a message to a waiting process instance. The configured default tenant id is applied when unset.

Example

async fn correlate_message() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

// Unlike `publish_message`, this blocks until the message is correlated and
// returns the process instance it was correlated with.
let correlated = client
.correlate_message(MessageCorrelationRequest {
name: "order-received".to_string(),
correlation_key: Some("ORD-4711".to_string()),
variables: Some(
[("total".to_string(), serde_json::json!(99.5))]
.into_iter()
.collect(),
),
..Default::default()
})
.await?;

println!(
"Correlated message {} with process instance {}",
correlated.message_key, correlated.process_instance_key
);

Ok(())
}

create_admin_user​

pub async fn create_admin_user(&self, params: CreateAdminUserParams) -> Result<models::UserCreateResult>

Create admin user (POST /setup/user).

Example

async fn create_admin_user() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.create_admin_user(CreateAdminUserParams {
user_request: UserRequest {
password: "my-password".to_string(),
username: Username::assume_exists("my-user"),
..Default::default()
},
})
.await?;
println!("{}", result.username);

Ok(())
}

create_agent_instance​

pub async fn create_agent_instance(&self, params: CreateAgentInstanceParams) -> Result<models::AgentInstanceCreationResult>

Create agent instance (POST /agent-instances).

Example

async fn create_agent_instance() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

// The batch must open with a CONFIGURATION item; it establishes the model,
// provider and system prompt for the instance.
let result = client
.create_agent_instance(CreateAgentInstanceParams {
agent_instance_creation_request: AgentInstanceCreationRequest {
element_instance_key: Box::new(ElementInstanceKey::assume_exists(
"my-element-instance",
)),
job_key: Box::new(JobKey::assume_exists("my-job")),
job_lease: "my-job-lease".to_string(),
history: vec![AgentInstanceHistoryItem {
history_item_id: HistoryItemId::assume_exists("configuration-1"),
loop_iteration: 0,
role: AgentInstanceHistoryRoleEnum::Configuration,
content: Vec::new(),
produced_at: Default::default(),
model: Some("my-model".to_string()),
provider: Some("my-provider".to_string()),
system_prompt: Some(Some(vec![AgentInstanceMessageContent::Text(Box::new(
AgentInstanceTextContent {
text: "my-system-prompt".to_string(),
},
))])),
..Default::default()
}],
},
})
.await?;
println!("{result:#?}");

Ok(())
}

create_authorization​

pub async fn create_authorization(&self, params: CreateAuthorizationParams) -> Result<models::AuthorizationCreateResult>

Create authorization (POST /authorizations).

Example

async fn create_authorization() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.create_authorization(CreateAuthorizationParams {
authorization_request: AuthorizationRequest::AuthorizationIdBasedRequest(Box::new(
AuthorizationIdBasedRequest {
owner_id: "my-owner".to_string(),
owner_type: OwnerTypeEnum::User,
resource_id: "my-resource".to_string(),
resource_type: ResourceTypeEnum::AuditLog,
permission_types: vec![PermissionTypeEnum::Access],
},
)),
})
.await?;
println!("{result:#?}");

Ok(())
}

create_deployment​

pub async fn create_deployment(&self, params: CreateDeploymentParams) -> Result<models::DeploymentResult>

Deploy resources (POST /deployments).

Example

async fn create_deployment() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

// `deploy_resources` reads the files and builds the multipart request for you.
// BPMN, DMN, and form resources can be deployed together in one atomic call.
let deployment = client
.deploy_resources(
vec![
PathBuf::from("resources/order-process.bpmn"),
PathBuf::from("resources/approval.dmn"),
],
None, // tenant id; `None` uses the default tenant
)
.await?;

println!("Deployment {}", deployment.deployment_key);
for item in deployment.deployments {
if let Some(process) = item.process_definition {
println!(" deployed process {}", process.process_definition_id);
}
}

Ok(())
}

create_document​

pub async fn create_document(&self, params: CreateDocumentParams) -> Result<models::DocumentReference>

Upload document (POST /documents).

Example

async fn create_document() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.create_document(CreateDocumentParams {
file: Default::default(),
store_id: None,
document_id: None,
metadata: Some(DocumentMetadata::default()),
})
.await?;
println!("{}", result.document_id);

Ok(())
}
pub async fn create_document_link(&self, params: CreateDocumentLinkParams) -> Result<models::DocumentLink>

Create document link (POST /documents/{documentId}/links).

Example

async fn create_document_link(document_id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.create_document_link(CreateDocumentLinkParams {
document_id,
store_id: None,
content_hash: None,
document_link_request: Some(DocumentLinkRequest::default()),
})
.await?;
println!("{}", result.url);

Ok(())
}

create_documents​

pub async fn create_documents(&self, params: CreateDocumentsParams) -> Result<models::DocumentCreationBatchResponse>

Upload multiple documents (POST /documents/batch).

Example

async fn create_documents() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.create_documents(CreateDocumentsParams {
files: vec![Default::default()],
store_id: None,
metadata_list: None,
})
.await?;
println!("{result:#?}");

Ok(())
}

create_element_instance_variables​

pub async fn create_element_instance_variables(&self, params: CreateElementInstanceVariablesParams) -> Result<()>

Update element instance variables (PUT /element-instances/{elementInstanceKey}/variables).

Example

async fn create_element_instance_variables(
element_instance_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.create_element_instance_variables(CreateElementInstanceVariablesParams {
element_instance_key,
set_variable_request: SetVariableRequest {
variables: [("key".to_string(), serde_json::json!({"key": "value"}))]
.into_iter()
.collect(),
..Default::default()
},
})
.await?;
println!("Update element instance variables: done");

Ok(())
}

create_global_cluster_variable​

pub async fn create_global_cluster_variable(&self, params: CreateGlobalClusterVariableParams) -> Result<models::ClusterVariableResult>

Create a global-scoped cluster variable (POST /cluster-variables/global).

Example

async fn create_global_cluster_variable() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.create_global_cluster_variable(CreateGlobalClusterVariableParams {
create_cluster_variable_request: CreateClusterVariableRequest {
name: ClusterVariableName::assume_exists("my-variable"),
value: serde_json::json!({"key": "value"}),
..Default::default()
},
})
.await?;
println!("{}", result.name);

Ok(())
}

create_global_task_listener​

pub async fn create_global_task_listener(&self, params: CreateGlobalTaskListenerParams) -> Result<models::GlobalTaskListenerResult>

Create global user task listener (POST /global-task-listeners).

Example

async fn create_global_task_listener() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.create_global_task_listener(CreateGlobalTaskListenerParams {
create_global_task_listener_request: CreateGlobalTaskListenerRequest {
id: GlobalListenerId::assume_exists("my-id"),
..Default::default()
},
})
.await?;
println!("{}", result.id);

Ok(())
}

create_group​

pub async fn create_group(&self, params: CreateGroupParams) -> Result<models::GroupCreateResult>

Create group (POST /groups).

Example

async fn create_group() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.create_group(CreateGroupParams {
group_create_request: Some(GroupCreateRequest {
group_id: GroupId::assume_exists("my-group"),
name: "my-variable".to_string(),
..Default::default()
}),
})
.await?;
println!("{}", result.group_id);

Ok(())
}

create_job_worker​

pub fn create_job_worker(&self, config: JobWorkerConfig) -> JobWorker

Create a JobWorker that continuously polls for and processes jobs of the configured type. Call JobWorker::run (or JobWorker::start / JobWorker::spawn) to begin.

create_mapping_rule​

pub async fn create_mapping_rule(&self, params: CreateMappingRuleParams) -> Result<models::MappingRuleCreateResult>

Create mapping rule (POST /mapping-rules).

Example

async fn create_mapping_rule() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.create_mapping_rule(CreateMappingRuleParams {
mapping_rule_create_request: Some(MappingRuleCreateRequest {
claim_name: "my-claim-name".to_string(),
claim_value: "my-claim-value".to_string(),
name: "my-variable".to_string(),
mapping_rule_id: MappingRuleId::assume_exists("my-mapping-rule"),
}),
})
.await?;
println!("{}", result.mapping_rule_id);

Ok(())
}

create_process_instance​

pub async fn create_process_instance(&self, instruction: models::ProcessInstanceCreationInstruction) -> Result<models::CreateProcessInstanceResult>

Create (start) a process instance. The configured default tenant id is applied when the instruction does not already specify one.

Example

async fn create_process_instance() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

// Start by BPMN process id. Use `ProcessInstanceCreationInstructionByKey` to
// pin a specific deployed version instead.
let instruction = ProcessInstanceCreationInstruction::ProcessInstanceCreationInstructionById(
Box::new(ProcessInstanceCreationInstructionById {
process_definition_id: ProcessDefinitionId::assume_exists("order-process"),
variables: Some(
[
("orderId".to_string(), serde_json::json!("ORD-4711")),
("amount".to_string(), serde_json::json!(42)),
]
.into_iter()
.collect(),
),
..Default::default()
}),
);

let created = client.create_process_instance(instruction).await?;
println!("Started process instance {}", created.process_instance_key);

Ok(())
}

create_role​

pub async fn create_role(&self, params: CreateRoleParams) -> Result<models::RoleCreateResult>

Create role (POST /roles).

Example

async fn create_role() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.create_role(CreateRoleParams {
role_create_request: Some(RoleCreateRequest {
role_id: RoleId::assume_exists("my-role"),
name: "my-variable".to_string(),
..Default::default()
}),
})
.await?;
println!("{}", result.role_id);

Ok(())
}

create_tenant​

pub async fn create_tenant(&self, params: CreateTenantParams) -> Result<models::TenantCreateResult>

Create tenant (POST /tenants).

Example

async fn create_tenant() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.create_tenant(CreateTenantParams {
tenant_create_request: TenantCreateRequest {
tenant_id: TenantId::assume_exists("my-tenant"),
name: "my-variable".to_string(),
..Default::default()
},
})
.await?;
println!("{}", result.name);

Ok(())
}

create_tenant_cluster_variable​

pub async fn create_tenant_cluster_variable(&self, params: CreateTenantClusterVariableParams) -> Result<models::ClusterVariableResult>

Create a tenant-scoped cluster variable (POST /cluster-variables/tenants/{tenantId}).

Example

async fn create_tenant_cluster_variable(
tenant_id: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.create_tenant_cluster_variable(CreateTenantClusterVariableParams {
tenant_id,
create_cluster_variable_request: CreateClusterVariableRequest {
name: ClusterVariableName::assume_exists("my-variable"),
value: serde_json::json!({"key": "value"}),
..Default::default()
},
})
.await?;
println!("{}", result.name);

Ok(())
}

create_user​

pub async fn create_user(&self, params: CreateUserParams) -> Result<models::UserCreateResult>

Create user (POST /users).

Example

async fn create_user() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.create_user(CreateUserParams {
user_request: UserRequest {
password: "my-password".to_string(),
username: Username::assume_exists("my-user"),
..Default::default()
},
})
.await?;
println!("{}", result.username);

Ok(())
}

delete_authorization​

pub async fn delete_authorization(&self, params: DeleteAuthorizationParams) -> Result<()>

Delete authorization (DELETE /authorizations/{authorizationKey}).

Example

async fn delete_authorization(authorization_key: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.delete_authorization(DeleteAuthorizationParams { authorization_key })
.await?;
println!("Delete authorization: done");

Ok(())
}

delete_decision_instance​

pub async fn delete_decision_instance(&self, params: DeleteDecisionInstanceParams) -> Result<()>

Delete decision instance (POST /decision-instances/{decisionEvaluationKey}/deletion).

Example

async fn delete_decision_instance(
decision_evaluation_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.delete_decision_instance(DeleteDecisionInstanceParams {
decision_evaluation_key,
delete_decision_instance_request: Some(DeleteDecisionInstanceRequest::default()),
})
.await?;
println!("Delete decision instance: done");

Ok(())
}

delete_decision_instances_batch_operation​

pub async fn delete_decision_instances_batch_operation(&self, params: DeleteDecisionInstancesBatchOperationParams) -> Result<models::BatchOperationCreatedResult>

Delete decision instances (batch) (POST /decision-instances/deletion).

Example

async fn delete_decision_instances_batch_operation() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.delete_decision_instances_batch_operation(DeleteDecisionInstancesBatchOperationParams {
decision_instance_deletion_batch_operation_request:
DecisionInstanceDeletionBatchOperationRequest {
filter: Box::new(DecisionInstanceFilter::default()),
..Default::default()
},
})
.await?;
println!("{}", result.batch_operation_key);

Ok(())
}

delete_document​

pub async fn delete_document(&self, params: DeleteDocumentParams) -> Result<()>

Delete document (DELETE /documents/{documentId}).

Example

async fn delete_document(document_id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.delete_document(DeleteDocumentParams {
document_id,
store_id: None,
})
.await?;
println!("Delete document: done");

Ok(())
}

delete_global_cluster_variable​

pub async fn delete_global_cluster_variable(&self, params: DeleteGlobalClusterVariableParams) -> Result<()>

Delete a global-scoped cluster variable (DELETE /cluster-variables/global/{name}).

Example

async fn delete_global_cluster_variable(name: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.delete_global_cluster_variable(DeleteGlobalClusterVariableParams { name })
.await?;
println!("Delete a global-scoped cluster variable: done");

Ok(())
}

delete_global_task_listener​

pub async fn delete_global_task_listener(&self, params: DeleteGlobalTaskListenerParams) -> Result<()>

Delete global user task listener (DELETE /global-task-listeners/{id}).

Example

async fn delete_global_task_listener(id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.delete_global_task_listener(DeleteGlobalTaskListenerParams { id })
.await?;
println!("Delete global user task listener: done");

Ok(())
}

delete_group​

pub async fn delete_group(&self, params: DeleteGroupParams) -> Result<()>

Delete group (DELETE /groups/{groupId}).

Example

async fn delete_group(group_id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client.delete_group(DeleteGroupParams { group_id }).await?;
println!("Delete group: done");

Ok(())
}

delete_history_backup​

pub async fn delete_history_backup(&self, params: DeleteHistoryBackupParams) -> Result<()>

Delete history backup (DELETE /backups/history/{backupId}).

Example

async fn delete_history_backup() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.delete_history_backup(DeleteHistoryBackupParams { backup_id: 1 })
.await?;
println!("Delete history backup: done");

Ok(())
}

delete_history_backup_as_cluster_admin​

pub async fn delete_history_backup_as_cluster_admin(&self, params: DeleteHistoryBackupAsClusterAdminParams) -> Result<()>

Delete a history backup across physical tenants (DELETE /cluster/v2/backups/history/{backupId}).

Example

async fn delete_history_backup_as_cluster_admin() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.delete_history_backup_as_cluster_admin(DeleteHistoryBackupAsClusterAdminParams {
backup_id: 1,
physical_tenant_id: None,
})
.await?;
println!("Delete history backup as cluster admin: done");

Ok(())
}

delete_mapping_rule​

pub async fn delete_mapping_rule(&self, params: DeleteMappingRuleParams) -> Result<()>

Delete a mapping rule (DELETE /mapping-rules/{mappingRuleId}).

Example

async fn delete_mapping_rule(mapping_rule_id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.delete_mapping_rule(DeleteMappingRuleParams { mapping_rule_id })
.await?;
println!("Delete a mapping rule: done");

Ok(())
}

delete_process_instance​

pub async fn delete_process_instance(&self, params: DeleteProcessInstanceParams) -> Result<()>

Delete process instance (POST /process-instances/{processInstanceKey}/deletion).

Example

async fn delete_process_instance(
process_instance_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.delete_process_instance(DeleteProcessInstanceParams {
process_instance_key,
delete_process_instance_request: Some(DeleteProcessInstanceRequest::default()),
})
.await?;
println!("Delete process instance: done");

Ok(())
}

delete_process_instances_batch_operation​

pub async fn delete_process_instances_batch_operation(&self, params: DeleteProcessInstancesBatchOperationParams) -> Result<models::BatchOperationCreatedResult>

Delete process instances (batch) (POST /process-instances/deletion).

Example

async fn delete_process_instances_batch_operation() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.delete_process_instances_batch_operation(DeleteProcessInstancesBatchOperationParams {
process_instance_deletion_batch_operation_request:
ProcessInstanceDeletionBatchOperationRequest {
filter: Box::new(ProcessInstanceFilter::default()),
..Default::default()
},
})
.await?;
println!("{}", result.batch_operation_key);

Ok(())
}

delete_resource​

pub async fn delete_resource(&self, params: DeleteResourceParams) -> Result<models::DeleteResourceResponse>

Delete resource (POST /resources/{resourceKey}/deletion).

Example

async fn delete_resource(resource_key: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.delete_resource(DeleteResourceParams {
resource_key,
delete_resource_request: Some(DeleteResourceRequest::default()),
})
.await?;
println!("{result:#?}");

Ok(())
}

delete_role​

pub async fn delete_role(&self, params: DeleteRoleParams) -> Result<()>

Delete role (DELETE /roles/{roleId}).

Example

async fn delete_role(role_id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client.delete_role(DeleteRoleParams { role_id }).await?;
println!("Delete role: done");

Ok(())
}

delete_runtime_backup​

pub async fn delete_runtime_backup(&self, params: DeleteRuntimeBackupParams) -> Result<()>

Delete runtime backup (DELETE /backups/runtime/{backupId}).

Example

async fn delete_runtime_backup() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.delete_runtime_backup(DeleteRuntimeBackupParams { backup_id: 1 })
.await?;
println!("Delete runtime backup: done");

Ok(())
}

delete_runtime_backup_as_cluster_admin​

pub async fn delete_runtime_backup_as_cluster_admin(&self, params: DeleteRuntimeBackupAsClusterAdminParams) -> Result<()>

Delete a runtime backup across physical tenants (DELETE /cluster/v2/backups/runtime/{backupId}).

Example

async fn delete_runtime_backup_as_cluster_admin() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.delete_runtime_backup_as_cluster_admin(DeleteRuntimeBackupAsClusterAdminParams {
backup_id: 1,
physical_tenant_id: None,
})
.await?;
println!("Delete runtime backup as cluster admin: done");

Ok(())
}

delete_runtime_backup_state​

pub async fn delete_runtime_backup_state(&self) -> Result<()>

Delete runtime backup state (DELETE /backups/runtime/state).

Example

async fn delete_runtime_backup_state() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client.delete_runtime_backup_state().await?;
println!("Delete runtime backup state: done");

Ok(())
}

delete_runtime_backup_state_as_cluster_admin​

pub async fn delete_runtime_backup_state_as_cluster_admin(&self, params: DeleteRuntimeBackupStateAsClusterAdminParams) -> Result<()>

Delete runtime backup state across physical tenants (DELETE /cluster/v2/backups/runtime/state).

Example

async fn delete_runtime_backup_state_as_cluster_admin() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.delete_runtime_backup_state_as_cluster_admin(
DeleteRuntimeBackupStateAsClusterAdminParams {
physical_tenant_id: None,
},
)
.await?;
println!("Delete runtime backup state as cluster admin: done");

Ok(())
}

delete_tenant​

pub async fn delete_tenant(&self, params: DeleteTenantParams) -> Result<()>

Delete tenant (DELETE /tenants/{tenantId}).

Example

async fn delete_tenant(tenant_id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.delete_tenant(DeleteTenantParams { tenant_id })
.await?;
println!("Delete tenant: done");

Ok(())
}

delete_tenant_cluster_variable​

pub async fn delete_tenant_cluster_variable(&self, params: DeleteTenantClusterVariableParams) -> Result<()>

Delete a tenant-scoped cluster variable (DELETE /cluster-variables/tenants/{tenantId}/{name}).

Example

async fn delete_tenant_cluster_variable(
tenant_id: String,
name: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.delete_tenant_cluster_variable(DeleteTenantClusterVariableParams { tenant_id, name })
.await?;
println!("Delete a tenant-scoped cluster variable: done");

Ok(())
}

delete_user​

pub async fn delete_user(&self, params: DeleteUserParams) -> Result<()>

Delete user (DELETE /users/{username}).

Example

async fn delete_user(username: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client.delete_user(DeleteUserParams { username }).await?;
println!("Delete user: done");

Ok(())
}

deploy_resources​

pub async fn deploy_resources(&self, resources: Vec<PathBuf>, tenant_id: Option<String>) -> Result<models::DeploymentResult>

Deploy one or more resources (BPMN, DMN, forms) from local file paths. The configured default tenant id is applied when tenant_id is None.

evaluate_conditionals​

pub async fn evaluate_conditionals(&self, params: EvaluateConditionalsParams) -> Result<models::EvaluateConditionalResult>

Evaluate root level conditional start events (POST /conditionals/evaluation).

Example

async fn evaluate_conditionals() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.evaluate_conditionals(EvaluateConditionalsParams {
conditional_evaluation_instruction: ConditionalEvaluationInstruction {
variables: [("key".to_string(), serde_json::json!({"key": "value"}))]
.into_iter()
.collect(),
..Default::default()
},
})
.await?;
println!("{}", result.tenant_id);

Ok(())
}

evaluate_decision​

pub async fn evaluate_decision(&self, instruction: models::DecisionEvaluationInstruction) -> Result<models::EvaluateDecisionResult>

Evaluate a decision (DMN). The configured default tenant id is applied when unset.

Example

async fn evaluate_decision() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let instruction =
DecisionEvaluationInstruction::DecisionEvaluationById(Box::new(DecisionEvaluationById {
decision_definition_id: DecisionDefinitionId::assume_exists("approval-decision"),
variables: Some(
[("amount".to_string(), serde_json::json!(500))]
.into_iter()
.collect(),
),
..Default::default()
}));

let evaluated = client.evaluate_decision(instruction).await?;

println!("Decision output: {}", evaluated.output);

Ok(())
}

evaluate_expression​

pub async fn evaluate_expression(&self, params: EvaluateExpressionParams) -> Result<models::ExpressionEvaluationResult>

Evaluate an expression (POST /expression/evaluation).

Example

async fn evaluate_expression() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.evaluate_expression(EvaluateExpressionParams {
expression_evaluation_request: ExpressionEvaluationRequest {
expression: "my-expression".to_string(),
..Default::default()
},
})
.await?;
println!("{}", result.expression);

Ok(())
}

eventual​

pub async fn eventual<T, F, Fut>(&self, options: ConsistencyOptions, op: F) -> Result<T>

Poll a read operation until it returns Ok, retrying 404 Not Found (the typical symptom of a not-yet-replicated read) until the eventual-consistency window elapses.

The default timeout is CAMUNDA_SDK_EVENTUAL_POLL_DEFAULT_MS; override per-call with ConsistencyOptions.

eventual_until​

pub async fn eventual_until<T, F, Fut, P>(&self, options: ConsistencyOptions, op: F, predicate: P) -> Result<T>

Poll a read operation until predicate is satisfied by its result, retrying 404 and ignoring consistent-but-not-yet-matching reads, until the eventual-consistency window elapses.

fail_job​

pub async fn fail_job(&self, job_key: &str, request: Option<models::JobFailRequest>) -> Result<()>

Fail a job, decrementing retries.

Example

async fn fail_job(job_key: &str) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

// Setting `retries` to 0 raises an incident instead of retrying.
client
.fail_job(
job_key,
Some(JobFailRequest {
retries: Some(2),
error_message: Some("payment gateway timed out".to_string()),
retry_back_off: Some(10_000),
..Default::default()
}),
)
.await?;

println!("Failed job {job_key}");

Ok(())
}

from_env​

pub fn from_env() -> Result<Self>

Construct a client from environment variables only.

get_agent_definition​

pub async fn get_agent_definition(&self, params: GetAgentDefinitionParams) -> Result<models::AgentDefinitionResult>

Get agent definition (GET /agent-definitions/{agentDefinitionKey}).

Example

async fn get_agent_definition() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_agent_definition(GetAgentDefinitionParams {
agent_definition_key: "2251799813691958".to_string(),
})
.await?;
println!("{result:#?}");

Ok(())
}

get_agent_instance​

pub async fn get_agent_instance(&self, params: GetAgentInstanceParams) -> Result<models::AgentInstanceResult>

Get agent instance (GET /agent-instances/{agentInstanceKey}).

Example

async fn get_agent_instance(agent_instance_key: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_agent_instance(GetAgentInstanceParams { agent_instance_key })
.await?;
println!("{}", result.element_id);

Ok(())
}

get_audit_log​

pub async fn get_audit_log(&self, params: GetAuditLogParams) -> Result<models::AuditLogResult>

Get audit log (GET /audit-logs/{auditLogKey}).

Example

async fn get_audit_log(audit_log_key: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_audit_log(GetAuditLogParams { audit_log_key })
.await?;
println!("{}", result.entity_key);

Ok(())
}

get_authentication​

pub async fn get_authentication(&self) -> Result<models::CamundaUserResult>

Get current user (GET /authentication/me).

Example

async fn get_authentication() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client.get_authentication().await?;
println!("{}", result.username);

Ok(())
}

get_authorization​

pub async fn get_authorization(&self, params: GetAuthorizationParams) -> Result<models::AuthorizationResult>

Get authorization (GET /authorizations/{authorizationKey}).

Example

async fn get_authorization(authorization_key: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_authorization(GetAuthorizationParams { authorization_key })
.await?;
println!("{}", result.owner_id);

Ok(())
}

get_batch_operation​

pub async fn get_batch_operation(&self, params: GetBatchOperationParams) -> Result<models::BatchOperationResponse>

Get batch operation (GET /batch-operations/{batchOperationKey}).

Example

async fn get_batch_operation(
batch_operation_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_batch_operation(GetBatchOperationParams {
batch_operation_key,
})
.await?;
println!("{}", result.batch_operation_key);

Ok(())
}

get_cluster_exporting_status​

pub async fn get_cluster_exporting_status(&self) -> Result<models::ExportingStatusResponse>

Get exporting status of the whole cluster (GET /cluster/v2/exporting).

Example

async fn get_cluster_exporting_status() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let status = client.get_cluster_exporting_status().await?;
println!("{status:#?}");

Ok(())
}

get_cluster_rebalance​

pub async fn get_cluster_rebalance(&self) -> Result<models::ClusterBalanceResponse>

Report the cluster's current leadership balance (GET /cluster/v2/rebalance).

Example

async fn get_cluster_rebalance() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client.get_cluster_rebalance().await?;
println!("{result:#?}");

Ok(())
}

get_cluster_status​

pub async fn get_cluster_status(&self) -> Result<models::ClusterStatusResponse>

Get the status of the whole cluster (GET /cluster/v2/status).

Example

async fn get_cluster_status() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let status = client.get_cluster_status().await?;
println!("{status:#?}");

Ok(())
}

get_cluster_topology​

pub async fn get_cluster_topology(&self) -> Result<models::ClusterTopologyResponse>

Get the topology of the whole cluster (GET /cluster/v2/topology).

Example

async fn get_cluster_topology() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

// Unlike `topology`, this reports the brokers of every physical tenant.
let topology = client.get_cluster_topology().await?;

println!("Cluster id: {:?}", topology.cluster_id);
println!("Cluster size: {}", topology.cluster_size);

for tenant in topology.physical_tenants {
println!("{tenant:#?}");
}

Ok(())
}

get_decision_definition​

pub async fn get_decision_definition(&self, params: GetDecisionDefinitionParams) -> Result<models::DecisionDefinitionResult>

Get decision definition (GET /decision-definitions/{decisionDefinitionKey}).

Example

async fn get_decision_definition(
decision_definition_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_decision_definition(GetDecisionDefinitionParams {
decision_definition_key,
})
.await?;
println!("{}", result.decision_definition_id);

Ok(())
}

get_decision_definition_xml​

pub async fn get_decision_definition_xml(&self, params: GetDecisionDefinitionXmlParams) -> Result<String>

Get decision definition XML (GET /decision-definitions/{decisionDefinitionKey}/xml).

Example

async fn get_decision_definition_xml(
decision_definition_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let xml = client
.get_decision_definition_xml(GetDecisionDefinitionXmlParams {
decision_definition_key,
})
.await?;

println!("{xml}");

Ok(())
}

get_decision_instance​

pub async fn get_decision_instance(&self, params: GetDecisionInstanceParams) -> Result<models::DecisionInstanceGetQueryResult>

Get decision instance (GET /decision-instances/{decisionEvaluationInstanceKey}).

Example

async fn get_decision_instance(
decision_evaluation_instance_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_decision_instance(GetDecisionInstanceParams {
decision_evaluation_instance_key,
})
.await?;
println!("{}", result.decision_evaluation_instance_key);

Ok(())
}

get_decision_requirements​

pub async fn get_decision_requirements(&self, params: GetDecisionRequirementsParams) -> Result<models::DecisionRequirementsResult>

Get decision requirements (GET /decision-requirements/{decisionRequirementsKey}).

Example

async fn get_decision_requirements(
decision_requirements_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_decision_requirements(GetDecisionRequirementsParams {
decision_requirements_key,
})
.await?;
println!("{}", result.decision_requirements_id);

Ok(())
}

get_decision_requirements_xml​

pub async fn get_decision_requirements_xml(&self, params: GetDecisionRequirementsXmlParams) -> Result<String>

Get decision requirements XML (GET /decision-requirements/{decisionRequirementsKey}/xml).

Example

async fn get_decision_requirements_xml(
decision_requirements_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let xml = client
.get_decision_requirements_xml(GetDecisionRequirementsXmlParams {
decision_requirements_key,
})
.await?;

println!("{xml}");

Ok(())
}

get_document​

pub async fn get_document(&self, params: GetDocumentParams) -> Result<Response>

Download document (GET /documents/{documentId}).

Example

async fn get_document(document_id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_document(GetDocumentParams {
document_id,
store_id: None,
content_hash: None,
})
.await?;
println!("{result:#?}");

Ok(())
}

get_element_instance​

pub async fn get_element_instance(&self, params: GetElementInstanceParams) -> Result<models::ElementInstanceResult>

Get element instance (GET /element-instances/{elementInstanceKey}).

Example

async fn get_element_instance(
element_instance_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_element_instance(GetElementInstanceParams {
element_instance_key,
})
.await?;
println!("{}", result.element_id);

Ok(())
}

get_exporting_status​

pub async fn get_exporting_status(&self) -> Result<models::ExportingStatusResponse>

Get exporting status (GET /exporting).

Example

async fn get_exporting_status() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let status = client.get_exporting_status().await?;
println!("{status:#?}");

Ok(())
}

get_form_by_key​

pub async fn get_form_by_key(&self, params: GetFormByKeyParams) -> Result<models::FormResult>

Get form by key (GET /forms/{formKey}).

Example

async fn get_form_by_key(form_key: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_form_by_key(GetFormByKeyParams { form_key })
.await?;
println!("{}", result.form_id);

Ok(())
}

get_global_cluster_variable​

pub async fn get_global_cluster_variable(&self, params: GetGlobalClusterVariableParams) -> Result<models::ClusterVariableResult>

Get a global-scoped cluster variable (GET /cluster-variables/global/{name}).

Example

async fn get_global_cluster_variable(name: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_global_cluster_variable(GetGlobalClusterVariableParams { name })
.await?;
println!("{}", result.name);

Ok(())
}

get_global_job_statistics​

pub async fn get_global_job_statistics(&self, params: GetGlobalJobStatisticsParams) -> Result<models::GlobalJobStatisticsQueryResult>

Global job statistics (GET /jobs/statistics/global).

Example

async fn get_global_job_statistics() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_global_job_statistics(GetGlobalJobStatisticsParams {
from: Default::default(),
to: Default::default(),
job_type: None,
})
.await?;
println!("{}", result.is_incomplete);

Ok(())
}

get_global_task_listener​

pub async fn get_global_task_listener(&self, params: GetGlobalTaskListenerParams) -> Result<models::GlobalTaskListenerResult>

Get global user task listener (GET /global-task-listeners/{id}).

Example

async fn get_global_task_listener(id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_global_task_listener(GetGlobalTaskListenerParams { id })
.await?;
println!("{}", result.id);

Ok(())
}

get_group​

pub async fn get_group(&self, params: GetGroupParams) -> Result<models::GroupResult>

Get group (GET /groups/{groupId}).

Example

async fn get_group(group_id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client.get_group(GetGroupParams { group_id }).await?;
println!("{}", result.group_id);

Ok(())
}

get_history_backup​

pub async fn get_history_backup(&self, params: GetHistoryBackupParams) -> Result<models::HistoryBackupInfo>

Get history backup (GET /backups/history/{backupId}).

Example

async fn get_history_backup() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_history_backup(GetHistoryBackupParams { backup_id: 1 })
.await?;
println!("{result:#?}");

Ok(())
}

get_history_backup_as_cluster_admin​

pub async fn get_history_backup_as_cluster_admin(&self, params: GetHistoryBackupAsClusterAdminParams) -> Result<models::ClusterHistoryBackupInfo>

Get a history backup across physical tenants (GET /cluster/v2/backups/history/{backupId}).

Example

async fn get_history_backup_as_cluster_admin() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_history_backup_as_cluster_admin(GetHistoryBackupAsClusterAdminParams {
backup_id: 1,
physical_tenant_id: None,
})
.await?;
println!("{result:#?}");

Ok(())
}

get_incident​

pub async fn get_incident(&self, params: GetIncidentParams) -> Result<models::IncidentResult>

Get incident (GET /incidents/{incidentKey}).

Example

async fn get_incident(incident_key: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_incident(GetIncidentParams { incident_key })
.await?;
println!("{}", result.element_id);

Ok(())
}

get_job_error_statistics​

pub async fn get_job_error_statistics(&self, params: GetJobErrorStatisticsParams) -> Result<models::JobErrorStatisticsQueryResult>

Get error metrics for a job type (POST /jobs/statistics/errors).

Example

async fn get_job_error_statistics() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_job_error_statistics(GetJobErrorStatisticsParams {
job_error_statistics_query: JobErrorStatisticsQuery {
filter: Box::new(JobErrorStatisticsFilter {
from: Default::default(),
to: Default::default(),
job_type: "payment-service".to_string(),
..Default::default()
}),
..Default::default()
},
})
.await?;
println!("{result:#?}");

Ok(())
}

get_job_time_series_statistics​

pub async fn get_job_time_series_statistics(&self, params: GetJobTimeSeriesStatisticsParams) -> Result<models::JobTimeSeriesStatisticsQueryResult>

Get time-series metrics for a job type (POST /jobs/statistics/time-series).

Example

async fn get_job_time_series_statistics() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_job_time_series_statistics(GetJobTimeSeriesStatisticsParams {
job_time_series_statistics_query: JobTimeSeriesStatisticsQuery {
filter: Box::new(JobTimeSeriesStatisticsFilter {
from: Default::default(),
to: Default::default(),
job_type: "payment-service".to_string(),
..Default::default()
}),
..Default::default()
},
})
.await?;
println!("{result:#?}");

Ok(())
}

get_job_type_statistics​

pub async fn get_job_type_statistics(&self, params: GetJobTypeStatisticsParams) -> Result<models::JobTypeStatisticsQueryResult>

Get job statistics by type (POST /jobs/statistics/by-types).

Example

async fn get_job_type_statistics() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_job_type_statistics(GetJobTypeStatisticsParams {
job_type_statistics_query: JobTypeStatisticsQuery::default(),
})
.await?;
println!("{result:#?}");

Ok(())
}

get_job_worker_statistics​

pub async fn get_job_worker_statistics(&self, params: GetJobWorkerStatisticsParams) -> Result<models::JobWorkerStatisticsQueryResult>

Get job statistics by worker (POST /jobs/statistics/by-workers).

Example

async fn get_job_worker_statistics() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_job_worker_statistics(GetJobWorkerStatisticsParams {
job_worker_statistics_query: JobWorkerStatisticsQuery {
filter: Box::new(JobWorkerStatisticsFilter {
from: Default::default(),
to: Default::default(),
job_type: "payment-service".to_string(),
}),
..Default::default()
},
})
.await?;
println!("{result:#?}");

Ok(())
}

get_license​

pub async fn get_license(&self) -> Result<models::LicenseResponse>

Get license status (GET /license).

Example

async fn get_license() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client.get_license().await?;
println!("{}", result.license_type);

Ok(())
}

get_mapping_rule​

pub async fn get_mapping_rule(&self, params: GetMappingRuleParams) -> Result<models::MappingRuleResult>

Get a mapping rule (GET /mapping-rules/{mappingRuleId}).

Example

async fn get_mapping_rule(mapping_rule_id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_mapping_rule(GetMappingRuleParams { mapping_rule_id })
.await?;
println!("{}", result.mapping_rule_id);

Ok(())
}

get_process_definition​

pub async fn get_process_definition(&self, params: GetProcessDefinitionParams) -> Result<models::ProcessDefinitionResult>

Get process definition (GET /process-definitions/{processDefinitionKey}).

Example

async fn get_process_definition(
process_definition_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_process_definition(GetProcessDefinitionParams {
process_definition_key,
})
.await?;
println!("{}", result.process_definition_id);

Ok(())
}

get_process_definition_instance_statistics​

pub async fn get_process_definition_instance_statistics(&self, params: GetProcessDefinitionInstanceStatisticsParams) -> Result<models::ProcessDefinitionInstanceStatisticsQueryResult>

Get process instance statistics (POST /process-definitions/statistics/process-instances).

Example

async fn get_process_definition_instance_statistics() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_process_definition_instance_statistics(GetProcessDefinitionInstanceStatisticsParams {
process_definition_instance_statistics_query: Some(
ProcessDefinitionInstanceStatisticsQuery::default(),
),
})
.await?;
println!("{result:#?}");

Ok(())
}

get_process_definition_instance_version_statistics​

pub async fn get_process_definition_instance_version_statistics(&self, params: GetProcessDefinitionInstanceVersionStatisticsParams) -> Result<models::ProcessDefinitionInstanceVersionStatisticsQueryResult>

Get process instance statistics by version (POST /process-definitions/statistics/process-instances-by-version).

Example

async fn get_process_definition_instance_version_statistics(
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_process_definition_instance_version_statistics(
GetProcessDefinitionInstanceVersionStatisticsParams {
process_definition_instance_version_statistics_query:
ProcessDefinitionInstanceVersionStatisticsQuery {
filter: Box::new(ProcessDefinitionInstanceVersionStatisticsFilter {
process_definition_id: ProcessDefinitionId::assume_exists("my-process"),
..Default::default()
}),
..Default::default()
},
},
)
.await?;
println!("{result:#?}");

Ok(())
}

get_process_definition_message_subscription_statistics​

pub async fn get_process_definition_message_subscription_statistics(&self, params: GetProcessDefinitionMessageSubscriptionStatisticsParams) -> Result<models::ProcessDefinitionMessageSubscriptionStatisticsQueryResult>

Get message subscription statistics (POST /process-definitions/statistics/message-subscriptions).

Example

async fn get_process_definition_message_subscription_statistics(
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_process_definition_message_subscription_statistics(
GetProcessDefinitionMessageSubscriptionStatisticsParams {
process_definition_message_subscription_statistics_query: Some(
ProcessDefinitionMessageSubscriptionStatisticsQuery::default(),
),
},
)
.await?;
println!("{result:#?}");

Ok(())
}

get_process_definition_statistics​

pub async fn get_process_definition_statistics(&self, params: GetProcessDefinitionStatisticsParams) -> Result<models::ProcessDefinitionElementStatisticsQueryResult>

Get process definition statistics (POST /process-definitions/{processDefinitionKey}/statistics/element-instances).

Example

async fn get_process_definition_statistics(
process_definition_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_process_definition_statistics(GetProcessDefinitionStatisticsParams {
process_definition_key,
process_definition_element_statistics_query: Some(
ProcessDefinitionElementStatisticsQuery::default(),
),
})
.await?;
println!("{result:#?}");

Ok(())
}

get_process_definition_xml​

pub async fn get_process_definition_xml(&self, params: GetProcessDefinitionXmlParams) -> Result<String>

Get process definition XML (GET /process-definitions/{processDefinitionKey}/xml).

Example

async fn get_process_definition_xml(
process_definition_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let xml = client
.get_process_definition_xml(GetProcessDefinitionXmlParams {
process_definition_key,
})
.await?;

println!("{xml}");

Ok(())
}

get_process_instance​

pub async fn get_process_instance(&self, process_instance_key: &str) -> Result<models::ProcessInstanceResult>

Fetch a process instance by key (a read; not subject to backpressure). Returns a 404 CamundaError::Api if not yet visible — compose with CamundaClient::eventual to wait through replication lag.

Example

async fn get_process_instance(
process_instance_key: &str,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let instance = client.get_process_instance(process_instance_key).await?;

println!("Process: {}", instance.process_definition_id);
println!("State: {:?}", instance.state);
println!("Incident: {}", instance.has_incident);

Ok(())
}

get_process_instance_call_hierarchy​

pub async fn get_process_instance_call_hierarchy(&self, params: GetProcessInstanceCallHierarchyParams) -> Result<Vec<models::ProcessInstanceCallHierarchyEntry>>

Get call hierarchy (GET /process-instances/{processInstanceKey}/call-hierarchy).

Example

async fn get_process_instance_call_hierarchy(
process_instance_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_process_instance_call_hierarchy(GetProcessInstanceCallHierarchyParams {
process_instance_key,
})
.await?;
println!("{result:#?}");

Ok(())
}

get_process_instance_sequence_flows​

pub async fn get_process_instance_sequence_flows(&self, params: GetProcessInstanceSequenceFlowsParams) -> Result<models::ProcessInstanceSequenceFlowsQueryResult>

Get sequence flows (GET /process-instances/{processInstanceKey}/sequence-flows).

Example

async fn get_process_instance_sequence_flows(
process_instance_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_process_instance_sequence_flows(GetProcessInstanceSequenceFlowsParams {
process_instance_key,
})
.await?;
println!("{result:#?}");

Ok(())
}

get_process_instance_statistics​

pub async fn get_process_instance_statistics(&self, params: GetProcessInstanceStatisticsParams) -> Result<models::ProcessInstanceElementStatisticsQueryResult>

Get element instance statistics (GET /process-instances/{processInstanceKey}/statistics/element-instances).

Example

async fn get_process_instance_statistics(
process_instance_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_process_instance_statistics(GetProcessInstanceStatisticsParams {
process_instance_key,
})
.await?;
println!("{result:#?}");

Ok(())
}

get_process_instance_statistics_by_definition​

pub async fn get_process_instance_statistics_by_definition(&self, params: GetProcessInstanceStatisticsByDefinitionParams) -> Result<models::IncidentProcessInstanceStatisticsByDefinitionQueryResult>

Get process instance statistics by definition (POST /incidents/statistics/process-instances-by-definition).

Example

async fn get_process_instance_statistics_by_definition() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_process_instance_statistics_by_definition(
GetProcessInstanceStatisticsByDefinitionParams {
incident_process_instance_statistics_by_definition_query:
IncidentProcessInstanceStatisticsByDefinitionQuery {
filter: Box::new(IncidentProcessInstanceStatisticsByDefinitionFilter {
error_hash_code: 1,
}),
..Default::default()
},
},
)
.await?;
println!("{result:#?}");

Ok(())
}

get_process_instance_statistics_by_error​

pub async fn get_process_instance_statistics_by_error(&self, params: GetProcessInstanceStatisticsByErrorParams) -> Result<models::IncidentProcessInstanceStatisticsByErrorQueryResult>

Get process instance statistics by error (POST /incidents/statistics/process-instances-by-error).

Example

async fn get_process_instance_statistics_by_error() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_process_instance_statistics_by_error(GetProcessInstanceStatisticsByErrorParams {
incident_process_instance_statistics_by_error_query: Some(
IncidentProcessInstanceStatisticsByErrorQuery::default(),
),
})
.await?;
println!("{result:#?}");

Ok(())
}

get_process_instance_wait_state_statistics​

pub async fn get_process_instance_wait_state_statistics(&self, params: GetProcessInstanceWaitStateStatisticsParams) -> Result<models::ProcessInstanceWaitStateStatisticsQueryResult>

Get wait state statistics (GET /process-instances/{processInstanceKey}/statistics/wait-states).

Example

async fn get_process_instance_wait_state_statistics(
process_instance_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_process_instance_wait_state_statistics(GetProcessInstanceWaitStateStatisticsParams {
process_instance_key,
})
.await?;
println!("{result:#?}");

Ok(())
}

get_resource​

pub async fn get_resource(&self, params: GetResourceParams) -> Result<models::ResourceResult>

Get resource (GET /resources/{resourceKey}).

Example

async fn get_resource(resource_key: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_resource(GetResourceParams { resource_key })
.await?;
println!("{}", result.resource_id);

Ok(())
}

get_resource_content​

pub async fn get_resource_content(&self, params: GetResourceContentParams) -> Result<HashMap<String, Value>>

Get RPA resource content (deprecated) (GET /resources/{resourceKey}/content).

Example

async fn get_resource_content(resource_key: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_resource_content(GetResourceContentParams { resource_key })
.await?;
println!("{result:#?}");

Ok(())
}

get_resource_content_binary​

pub async fn get_resource_content_binary(&self, params: GetResourceContentBinaryParams) -> Result<Response>

Get resource content as binary (GET /resources/{resourceKey}/content/binary).

Example

async fn get_resource_content_binary(
resource_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_resource_content_binary(GetResourceContentBinaryParams { resource_key })
.await?;
println!("{result:#?}");

Ok(())
}

get_restore_status​

pub async fn get_restore_status(&self) -> Result<models::RestoreStatusResponse>

Get the status of the restore that is currently in progress (GET /restore).

Example

async fn get_restore_status() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let status = client.get_restore_status().await?;
println!("{status:#?}");

Ok(())
}

get_role​

pub async fn get_role(&self, params: GetRoleParams) -> Result<models::RoleResult>

Get role (GET /roles/{roleId}).

Example

async fn get_role(role_id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client.get_role(GetRoleParams { role_id }).await?;
println!("{}", result.role_id);

Ok(())
}

get_runtime_backup​

pub async fn get_runtime_backup(&self, params: GetRuntimeBackupParams) -> Result<models::BackupInfo>

Get runtime backup (GET /backups/runtime/{backupId}).

Example

async fn get_runtime_backup() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_runtime_backup(GetRuntimeBackupParams { backup_id: 1 })
.await?;
println!("{result:#?}");

Ok(())
}

get_runtime_backup_as_cluster_admin​

pub async fn get_runtime_backup_as_cluster_admin(&self, params: GetRuntimeBackupAsClusterAdminParams) -> Result<models::ClusterRuntimeBackupInfo>

Get a runtime backup across physical tenants (GET /cluster/v2/backups/runtime/{backupId}).

Example

async fn get_runtime_backup_as_cluster_admin() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_runtime_backup_as_cluster_admin(GetRuntimeBackupAsClusterAdminParams {
backup_id: 1,
physical_tenant_id: None,
})
.await?;
println!("{result:#?}");

Ok(())
}

get_runtime_backup_state​

pub async fn get_runtime_backup_state(&self) -> Result<models::RuntimeBackupState>

Get runtime backup state (GET /backups/runtime/state).

Example

async fn get_runtime_backup_state() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let state = client.get_runtime_backup_state().await?;
println!("{state:#?}");

Ok(())
}

get_runtime_backup_state_as_cluster_admin​

pub async fn get_runtime_backup_state_as_cluster_admin(&self, params: GetRuntimeBackupStateAsClusterAdminParams) -> Result<models::ClusterRuntimeBackupState>

Get runtime backup state across physical tenants (GET /cluster/v2/backups/runtime/state).

Example

async fn get_runtime_backup_state_as_cluster_admin() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let state = client
.get_runtime_backup_state_as_cluster_admin(GetRuntimeBackupStateAsClusterAdminParams {
physical_tenant_id: None,
})
.await?;
println!("{state:#?}");

Ok(())
}

get_start_process_form​

pub async fn get_start_process_form(&self, params: GetStartProcessFormParams) -> Result<models::FormResult>

Get process start form (GET /process-definitions/{processDefinitionKey}/form).

Example

async fn get_start_process_form(
process_definition_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_start_process_form(GetStartProcessFormParams {
process_definition_key,
})
.await?;
println!("{}", result.form_id);

Ok(())
}

get_status​

pub async fn get_status(&self) -> Result<()>

Get physical tenant status (GET /status).

Example

async fn get_status() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client.get_status().await?;
println!("Get cluster status: done");

Ok(())
}

get_system_configuration​

pub async fn get_system_configuration(&self) -> Result<models::SystemConfigurationResponse>

System configuration (alpha) (GET /system/configuration).

Example

async fn get_system_configuration() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client.get_system_configuration().await?;
println!("{result:#?}");

Ok(())
}

get_tenant​

pub async fn get_tenant(&self, params: GetTenantParams) -> Result<models::TenantResult>

Get tenant (GET /tenants/{tenantId}).

Example

async fn get_tenant(tenant_id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client.get_tenant(GetTenantParams { tenant_id }).await?;
println!("{}", result.name);

Ok(())
}

get_tenant_cluster_variable​

pub async fn get_tenant_cluster_variable(&self, params: GetTenantClusterVariableParams) -> Result<models::ClusterVariableResult>

Get a tenant-scoped cluster variable (GET /cluster-variables/tenants/{tenantId}/{name}).

Example

async fn get_tenant_cluster_variable(
tenant_id: String,
name: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_tenant_cluster_variable(GetTenantClusterVariableParams { tenant_id, name })
.await?;
println!("{}", result.name);

Ok(())
}

get_usage_metrics​

pub async fn get_usage_metrics(&self, params: GetUsageMetricsParams) -> Result<models::UsageMetricsResponse>

Get usage metrics (GET /system/usage-metrics).

Example

async fn get_usage_metrics() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_usage_metrics(GetUsageMetricsParams {
start_time: Default::default(),
end_time: Default::default(),
tenant_id: None,
with_tenants: None,
})
.await?;
println!("{}", result.active_tenants);

Ok(())
}

get_user​

pub async fn get_user(&self, params: GetUserParams) -> Result<models::UserResult>

Get user (GET /users/{username}).

Example

async fn get_user(username: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client.get_user(GetUserParams { username }).await?;
println!("{}", result.username);

Ok(())
}

get_user_task​

pub async fn get_user_task(&self, params: GetUserTaskParams) -> Result<models::UserTaskResult>

Get user task (GET /user-tasks/{userTaskKey}).

Example

async fn get_user_task(user_task_key: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_user_task(GetUserTaskParams { user_task_key })
.await?;
println!("{}", result.element_id);

Ok(())
}

get_user_task_form​

pub async fn get_user_task_form(&self, params: GetUserTaskFormParams) -> Result<models::FormResult>

Get user task form (GET /user-tasks/{userTaskKey}/form).

Example

async fn get_user_task_form(user_task_key: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_user_task_form(GetUserTaskFormParams { user_task_key })
.await?;
println!("{}", result.form_id);

Ok(())
}

get_variable​

pub async fn get_variable(&self, params: GetVariableParams) -> Result<models::VariableResult>

Get variable (GET /variables/{variableKey}).

Example

async fn get_variable(variable_key: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.get_variable(GetVariableParams { variable_key })
.await?;
println!("{}", result.name);

Ok(())
}

init_logging​

pub fn init_logging(&self) -> bool

Install a formatting tracing subscriber filtered to the configured CAMUNDA_SDK_LOG_LEVEL. No-op if a global subscriber is already set or logging is off. Returns true if this call installed the subscriber.

list_history_backups​

pub async fn list_history_backups(&self, params: ListHistoryBackupsParams) -> Result<Vec<models::HistoryBackupInfo>>

List history backups (GET /backups/history).

Example

async fn list_history_backups() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

// `prefix` must end in a single '*'. Setting `verbose` to false makes the
// query cheaper, at the cost of snapshot-level detail.
let backups = client
.list_history_backups(ListHistoryBackupsParams {
prefix: None,
verbose: None,
})
.await?;
for backup in backups {
println!("{backup:#?}");
}

Ok(())
}

list_history_backups_as_cluster_admin​

pub async fn list_history_backups_as_cluster_admin(&self, params: ListHistoryBackupsAsClusterAdminParams) -> Result<Vec<models::ClusterHistoryBackupInfo>>

List history backups across physical tenants (GET /cluster/v2/backups/history).

Example

async fn list_history_backups_as_cluster_admin() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

// `prefix` must end in a single '*'. Setting `verbose` to false makes the
// query cheaper, at the cost of snapshot-level detail.
let backups = client
.list_history_backups_as_cluster_admin(ListHistoryBackupsAsClusterAdminParams {
physical_tenant_id: None,
prefix: None,
verbose: None,
})
.await?;
for backup in backups {
println!("{backup:#?}");
}

Ok(())
}

list_runtime_backups​

pub async fn list_runtime_backups(&self, params: ListRuntimeBackupsParams) -> Result<Vec<models::BackupInfo>>

List runtime backups (GET /backups/runtime).

Example

async fn list_runtime_backups() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let backups = client
.list_runtime_backups(ListRuntimeBackupsParams { prefix: None })
.await?;
for backup in backups {
println!("{backup:#?}");
}

Ok(())
}

list_runtime_backups_as_cluster_admin​

pub async fn list_runtime_backups_as_cluster_admin(&self, params: ListRuntimeBackupsAsClusterAdminParams) -> Result<Vec<models::ClusterRuntimeBackupInfo>>

List runtime backups across physical tenants (GET /cluster/v2/backups/runtime).

Example

async fn list_runtime_backups_as_cluster_admin() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let backups = client
.list_runtime_backups_as_cluster_admin(ListRuntimeBackupsAsClusterAdminParams {
physical_tenant_id: None,
prefix: None,
})
.await?;
for backup in backups {
println!("{backup:#?}");
}

Ok(())
}

list_secrets​

pub async fn list_secrets(&self, params: ListSecretsParams) -> Result<models::SecretListResult>

List secrets (alpha) (POST /secrets/list).

Example

async fn list_secrets() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.list_secrets(ListSecretsParams { body: None })
.await?;
println!("{result:#?}");

Ok(())
}

migrate_process_instance​

pub async fn migrate_process_instance(&self, params: MigrateProcessInstanceParams) -> Result<()>

Migrate process instance (POST /process-instances/{processInstanceKey}/migration).

Example

async fn migrate_process_instance(
process_instance_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.migrate_process_instance(MigrateProcessInstanceParams {
process_instance_key,
process_instance_migration_instruction: ProcessInstanceMigrationInstruction {
target_process_definition_key: Box::new(ProcessDefinitionKey::assume_exists(
"my-target-process-definition",
)),
mapping_instructions: vec![MigrateProcessInstanceMappingInstruction {
source_element_id: ElementId::assume_exists("my-source-element"),
target_element_id: ElementId::assume_exists("my-target-element"),
}],
..Default::default()
},
})
.await?;
println!("Migrate process instance: done");

Ok(())
}

migrate_process_instances_batch_operation​

pub async fn migrate_process_instances_batch_operation(&self, params: MigrateProcessInstancesBatchOperationParams) -> Result<models::BatchOperationCreatedResult>

Migrate process instances (batch) (POST /process-instances/migration).

Example

async fn migrate_process_instances_batch_operation() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.migrate_process_instances_batch_operation(MigrateProcessInstancesBatchOperationParams {
process_instance_migration_batch_operation_request:
ProcessInstanceMigrationBatchOperationRequest {
filter: Box::new(ProcessInstanceFilter::default()),
migration_plan: Box::new(ProcessInstanceMigrationBatchOperationPlan {
target_process_definition_key: Box::new(
ProcessDefinitionKey::assume_exists("my-target-process-definition"),
),
mapping_instructions: vec![Default::default()],
}),
..Default::default()
},
})
.await?;
println!("{}", result.batch_operation_key);

Ok(())
}

modify_process_instance​

pub async fn modify_process_instance(&self, params: ModifyProcessInstanceParams) -> Result<()>

Modify process instance (POST /process-instances/{processInstanceKey}/modification).

Example

async fn modify_process_instance(
process_instance_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.modify_process_instance(ModifyProcessInstanceParams {
process_instance_key,
process_instance_modification_instruction:
ProcessInstanceModificationInstruction::default(),
})
.await?;
println!("Modify process instance: done");

Ok(())
}

modify_process_instances_batch_operation​

pub async fn modify_process_instances_batch_operation(&self, params: ModifyProcessInstancesBatchOperationParams) -> Result<models::BatchOperationCreatedResult>

Modify process instances (batch) (POST /process-instances/modification).

Example

async fn modify_process_instances_batch_operation() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.modify_process_instances_batch_operation(ModifyProcessInstancesBatchOperationParams {
process_instance_modification_batch_operation_request:
ProcessInstanceModificationBatchOperationRequest {
filter: Box::new(ProcessInstanceFilter::default()),
move_instructions: vec![
ProcessInstanceModificationMoveBatchOperationInstruction {
source_element_id: ElementId::assume_exists("my-source-element"),
target_element_id: ElementId::assume_exists("my-target-element"),
},
],
..Default::default()
},
})
.await?;
println!("{}", result.batch_operation_key);

Ok(())
}

new​

pub fn new(options: CamundaOptions) -> Result<Self>

Construct a client from CamundaOptions (environment + overrides).

pause_cluster_exporting​

pub async fn pause_cluster_exporting(&self, params: PauseClusterExportingParams) -> Result<()>

Pause exporting across the whole cluster (POST /cluster/v2/exporting/pause).

Example

async fn pause_cluster_exporting() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.pause_cluster_exporting(PauseClusterExportingParams { soft: Some(true) })
.await?;
println!("Pause cluster exporting: done");

Ok(())
}

pause_exporting​

pub async fn pause_exporting(&self, params: PauseExportingParams) -> Result<()>

Pause exporting (POST /exporting/pause).

Example

async fn pause_exporting() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.pause_exporting(PauseExportingParams { soft: Some(true) })
.await?;
println!("Pause exporting: done");

Ok(())
}

pin_clock​

pub async fn pin_clock(&self, params: PinClockParams) -> Result<()>

Pin internal clock (alpha) (PUT /clock).

Example

async fn pin_clock() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.pin_clock(PinClockParams {
clock_pin_request: ClockPinRequest { timestamp: 1 },
})
.await?;
println!("Pin internal clock (alpha): done");

Ok(())
}

publish_message​

pub async fn publish_message(&self, request: models::MessagePublicationRequest) -> Result<models::MessagePublicationResult>

Publish a message (no correlation key matching against active subscriptions only — buffered). The configured default tenant id is applied when unset.

Example

async fn publish_message() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let published = client
.publish_message(MessagePublicationRequest {
name: "order-received".to_string(),
correlation_key: Some("ORD-4711".to_string()),
time_to_live: Some(60_000),
variables: Some(
[("total".to_string(), serde_json::json!(99.5))]
.into_iter()
.collect(),
),
..Default::default()
})
.await?;

println!("Published message {}", published.message_key);

Ok(())
}

reset_clock​

pub async fn reset_clock(&self) -> Result<()>

Reset internal clock (alpha) (POST /clock/reset).

Example

async fn reset_clock() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client.reset_clock().await?;
println!("Reset internal clock (alpha): done");

Ok(())
}

resolve_incident​

pub async fn resolve_incident(&self, params: ResolveIncidentParams) -> Result<()>

Resolve incident (POST /incidents/{incidentKey}/resolution).

Example

async fn resolve_incident(incident_key: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.resolve_incident(ResolveIncidentParams {
incident_key,
incident_resolution_request: Some(IncidentResolutionRequest::default()),
})
.await?;
println!("Resolve incident: done");

Ok(())
}

resolve_incidents_batch_operation​

pub async fn resolve_incidents_batch_operation(&self, params: ResolveIncidentsBatchOperationParams) -> Result<models::BatchOperationCreatedResult>

Resolve related incidents (batch) (POST /process-instances/incident-resolution).

Example

async fn resolve_incidents_batch_operation() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.resolve_incidents_batch_operation(ResolveIncidentsBatchOperationParams {
process_instance_incident_resolution_batch_operation_request: Some(
ProcessInstanceIncidentResolutionBatchOperationRequest {
filter: Box::new(ProcessInstanceFilter::default()),
..Default::default()
},
),
})
.await?;
println!("{}", result.batch_operation_key);

Ok(())
}

resolve_process_instance_incidents​

pub async fn resolve_process_instance_incidents(&self, params: ResolveProcessInstanceIncidentsParams) -> Result<models::BatchOperationCreatedResult>

Resolve related incidents (POST /process-instances/{processInstanceKey}/incident-resolution).

Example

async fn resolve_process_instance_incidents(
process_instance_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.resolve_process_instance_incidents(ResolveProcessInstanceIncidentsParams {
process_instance_key,
})
.await?;
println!("{}", result.batch_operation_key);

Ok(())
}

resolve_secrets​

pub async fn resolve_secrets(&self, params: ResolveSecretsParams) -> Result<models::SecretResolveResult>

Resolve secrets (alpha) (POST /secrets/resolve).

Example

async fn resolve_secrets() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.resolve_secrets(ResolveSecretsParams {
secret_resolve_request: SecretResolveRequest {
references: vec!["camunda.secrets.my-secret".to_string()],
},
})
.await?;
println!("{result:#?}");

Ok(())
}

restore​

pub async fn restore(&self, params: RestoreParams) -> Result<models::ClusterRestoreResponse>

Restore from a backup (POST /restore).

Example

async fn restore() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.restore(RestoreParams {
restore_request: RestoreRequest::default(),
dry_run: None,
})
.await?;
println!("{}", result.change_id);

Ok(())
}

restore_as_cluster_admin​

pub async fn restore_as_cluster_admin(&self, params: RestoreAsClusterAdminParams) -> Result<models::ClusterRestoreResponse>

Restore one or every physical tenant from a backup (POST /cluster/v2/restore).

Example

async fn restore_as_cluster_admin() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

// Omitting `physical_tenant_id` restores the whole cluster. A cluster-wide
// restore may also set `overrides` to pick a different backup per physical
// tenant.
let result = client
.restore_as_cluster_admin(RestoreAsClusterAdminParams {
cluster_restore_request: ClusterRestoreRequest {
backup_ids: Some(Some(vec![1])),
..Default::default()
},
physical_tenant_id: None,
dry_run: Some(true),
})
.await?;
println!("{result:#?}");

Ok(())
}

resume_batch_operation​

pub async fn resume_batch_operation(&self, params: ResumeBatchOperationParams) -> Result<()>

Resume Batch operation (POST /batch-operations/{batchOperationKey}/resumption).

Example

async fn resume_batch_operation(
batch_operation_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.resume_batch_operation(ResumeBatchOperationParams {
batch_operation_key,
})
.await?;
println!("Resume Batch operation: done");

Ok(())
}

resume_cluster_exporting​

pub async fn resume_cluster_exporting(&self) -> Result<()>

Resume exporting across the whole cluster (POST /cluster/v2/exporting/resume).

Example

async fn resume_cluster_exporting() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client.resume_cluster_exporting().await?;
println!("Resume cluster exporting: done");

Ok(())
}

resume_exporting​

pub async fn resume_exporting(&self) -> Result<()>

Resume exporting (POST /exporting/resume).

Example

async fn resume_exporting() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client.resume_exporting().await?;
println!("Resume exporting: done");

Ok(())
}

resume_process_instance​

pub async fn resume_process_instance(&self, params: ResumeProcessInstanceParams) -> Result<()>

Resume process instance (POST /process-instances/{processInstanceKey}/resumption).

Example

async fn resume_process_instance(
process_instance_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.resume_process_instance(ResumeProcessInstanceParams {
process_instance_key,
resume_process_instance_request: Some(ResumeProcessInstanceRequest::default()),
})
.await?;
println!("Resume process instance: done");

Ok(())
}

resume_process_instances_batch_operation​

pub async fn resume_process_instances_batch_operation(&self, params: ResumeProcessInstancesBatchOperationParams) -> Result<models::BatchOperationCreatedResult>

Resume process instances (batch) (POST /process-instances/resumption).

Example

async fn resume_process_instances_batch_operation() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.resume_process_instances_batch_operation(ResumeProcessInstancesBatchOperationParams {
process_instance_resumption_batch_operation_request:
ProcessInstanceResumptionBatchOperationRequest {
filter: Box::new(ProcessInstanceFilter::default()),
..Default::default()
},
})
.await?;
println!("{}", result.batch_operation_key);

Ok(())
}

running_workers​

pub fn running_workers(&self) -> Vec<String>

The job types of all currently-registered workers that are still running.

search_agent_definitions​

pub async fn search_agent_definitions(&self, params: SearchAgentDefinitionsParams) -> Result<models::AgentDefinitionSearchQueryResult>

Search agent definitions (POST /agent-definitions/search).

Example

async fn search_agent_definitions() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_agent_definitions(SearchAgentDefinitionsParams {
agent_definition_search_query: Some(AgentDefinitionSearchQuery::default()),
})
.await?;
println!("{result:#?}");

Ok(())
}

search_agent_instance_history​

pub async fn search_agent_instance_history(&self, params: SearchAgentInstanceHistoryParams) -> Result<models::AgentInstanceHistorySearchQueryResult>

Search agent instance history (POST /agent-instances/{agentInstanceKey}/history/search).

Example

async fn search_agent_instance_history(
agent_instance_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_agent_instance_history(SearchAgentInstanceHistoryParams {
agent_instance_key,
agent_instance_history_search_query: Some(AgentInstanceHistorySearchQuery::default()),
})
.await?;
for item in result.items {
println!("{}", item.job_lease);
}

Ok(())
}

search_agent_instances​

pub async fn search_agent_instances(&self, params: SearchAgentInstancesParams) -> Result<models::AgentInstanceSearchQueryResult>

Search agent instances (POST /agent-instances/search).

Example

async fn search_agent_instances() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_agent_instances(SearchAgentInstancesParams {
agent_instance_search_query: Some(AgentInstanceSearchQuery::default()),
})
.await?;
for item in result.items {
println!("{}", item.element_id);
}

Ok(())
}

search_audit_logs​

pub async fn search_audit_logs(&self, params: SearchAuditLogsParams) -> Result<models::AuditLogSearchQueryResult>

Search audit logs (POST /audit-logs/search).

Example

async fn search_audit_logs() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_audit_logs(SearchAuditLogsParams {
audit_log_search_query_request: Some(AuditLogSearchQueryRequest::default()),
})
.await?;
for item in result.items {
println!("{}", item.entity_key);
}

Ok(())
}

search_authorizations​

pub async fn search_authorizations(&self, params: SearchAuthorizationsParams) -> Result<models::AuthorizationSearchResult>

Search authorizations (POST /authorizations/search).

Example

async fn search_authorizations() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_authorizations(SearchAuthorizationsParams {
authorization_search_query: Some(AuthorizationSearchQuery::default()),
})
.await?;
println!("{result:#?}");

Ok(())
}

search_batch_operation_items​

pub async fn search_batch_operation_items(&self, params: SearchBatchOperationItemsParams) -> Result<models::BatchOperationItemSearchQueryResult>

Search batch operation items (POST /batch-operation-items/search).

Example

async fn search_batch_operation_items() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_batch_operation_items(SearchBatchOperationItemsParams {
batch_operation_item_search_query: Some(BatchOperationItemSearchQuery::default()),
})
.await?;
for item in result.items {
println!("{}", item.batch_operation_key);
}

Ok(())
}

search_batch_operations​

pub async fn search_batch_operations(&self, params: SearchBatchOperationsParams) -> Result<models::BatchOperationSearchQueryResult>

Search batch operations (POST /batch-operations/search).

Example

async fn search_batch_operations() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_batch_operations(SearchBatchOperationsParams {
batch_operation_search_query: Some(BatchOperationSearchQuery::default()),
})
.await?;
for item in result.items {
println!("{}", item.batch_operation_key);
}

Ok(())
}

search_clients_for_group​

pub async fn search_clients_for_group(&self, params: SearchClientsForGroupParams) -> Result<models::GroupClientSearchResult>

Search group clients (POST /groups/{groupId}/clients/search).

Example

async fn search_clients_for_group(group_id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_clients_for_group(SearchClientsForGroupParams {
group_id,
group_client_search_query_request: Some(GroupClientSearchQueryRequest::default()),
})
.await?;
println!("{result:#?}");

Ok(())
}

search_clients_for_role​

pub async fn search_clients_for_role(&self, params: SearchClientsForRoleParams) -> Result<models::RoleClientSearchResult>

Search role clients (POST /roles/{roleId}/clients/search).

Example

async fn search_clients_for_role(role_id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_clients_for_role(SearchClientsForRoleParams {
role_id,
role_client_search_query_request: Some(RoleClientSearchQueryRequest::default()),
})
.await?;
println!("{result:#?}");

Ok(())
}

search_clients_for_tenant​

pub async fn search_clients_for_tenant(&self, params: SearchClientsForTenantParams) -> Result<models::TenantClientSearchResult>

Search clients for tenant (POST /tenants/{tenantId}/clients/search).

Example

async fn search_clients_for_tenant(tenant_id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_clients_for_tenant(SearchClientsForTenantParams {
tenant_id,
tenant_client_search_query_request: Some(TenantClientSearchQueryRequest::default()),
})
.await?;
println!("{result:#?}");

Ok(())
}

search_cluster_variables​

pub async fn search_cluster_variables(&self, params: SearchClusterVariablesParams) -> Result<models::ClusterVariableSearchQueryResult>

Search for cluster variables based on given criteria (POST /cluster-variables/search).

Example

async fn search_cluster_variables() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_cluster_variables(SearchClusterVariablesParams {
truncate_values: None,
cluster_variable_search_query_request: Some(
ClusterVariableSearchQueryRequest::default(),
),
})
.await?;
for item in result.items {
println!("{}", item.name);
}

Ok(())
}

search_correlated_message_subscriptions​

pub async fn search_correlated_message_subscriptions(&self, params: SearchCorrelatedMessageSubscriptionsParams) -> Result<models::CorrelatedMessageSubscriptionSearchQueryResult>

Search correlated message subscriptions (POST /correlated-message-subscriptions/search).

Example

async fn search_correlated_message_subscriptions() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_correlated_message_subscriptions(SearchCorrelatedMessageSubscriptionsParams {
correlated_message_subscription_search_query: Some(
CorrelatedMessageSubscriptionSearchQuery::default(),
),
})
.await?;
for item in result.items {
println!("{}", item.process_definition_id);
}

Ok(())
}

search_decision_definitions​

pub async fn search_decision_definitions(&self, params: SearchDecisionDefinitionsParams) -> Result<models::DecisionDefinitionSearchQueryResult>

Search decision definitions (POST /decision-definitions/search).

Example

async fn search_decision_definitions() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_decision_definitions(SearchDecisionDefinitionsParams {
decision_definition_search_query: Some(DecisionDefinitionSearchQuery::default()),
})
.await?;
for item in result.items {
println!("{}", item.decision_definition_id);
}

Ok(())
}

search_decision_instances​

pub async fn search_decision_instances(&self, params: SearchDecisionInstancesParams) -> Result<models::DecisionInstanceSearchQueryResult>

Search decision instances (POST /decision-instances/search).

Example

async fn search_decision_instances() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_decision_instances(SearchDecisionInstancesParams {
decision_instance_search_query: Some(DecisionInstanceSearchQuery::default()),
})
.await?;
for item in result.items {
println!("{}", item.decision_evaluation_instance_key);
}

Ok(())
}

search_decision_requirements​

pub async fn search_decision_requirements(&self, params: SearchDecisionRequirementsParams) -> Result<models::DecisionRequirementsSearchQueryResult>

Search decision requirements (POST /decision-requirements/search).

Example

async fn search_decision_requirements() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_decision_requirements(SearchDecisionRequirementsParams {
decision_requirements_search_query: Some(DecisionRequirementsSearchQuery::default()),
})
.await?;
for item in result.items {
println!("{}", item.decision_requirements_id);
}

Ok(())
}

search_element_instance_incidents​

pub async fn search_element_instance_incidents(&self, params: SearchElementInstanceIncidentsParams) -> Result<models::IncidentSearchQueryResult>

Search for incidents of a specific element instance (POST /element-instances/{elementInstanceKey}/incidents/search).

Example

async fn search_element_instance_incidents(
element_instance_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_element_instance_incidents(SearchElementInstanceIncidentsParams {
element_instance_key,
incident_search_query: IncidentSearchQuery::default(),
})
.await?;
for item in result.items {
println!("{}", item.element_id);
}

Ok(())
}

search_element_instance_wait_states​

pub async fn search_element_instance_wait_states(&self, params: SearchElementInstanceWaitStatesParams) -> Result<models::ElementInstanceWaitStateQueryResult>

Search element instance wait states (POST /element-instances/wait-states/search).

Example

async fn search_element_instance_wait_states() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_element_instance_wait_states(SearchElementInstanceWaitStatesParams {
element_instance_wait_state_query: Some(ElementInstanceWaitStateQuery::default()),
})
.await?;
println!("{result:#?}");

Ok(())
}

search_element_instances​

pub async fn search_element_instances(&self, params: SearchElementInstancesParams) -> Result<models::ElementInstanceSearchQueryResult>

Search element instances (POST /element-instances/search).

Example

async fn search_element_instances() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_element_instances(SearchElementInstancesParams {
element_instance_search_query: Some(ElementInstanceSearchQuery::default()),
})
.await?;
for item in result.items {
println!("{}", item.element_id);
}

Ok(())
}

search_global_task_listeners​

pub async fn search_global_task_listeners(&self, params: SearchGlobalTaskListenersParams) -> Result<models::GlobalTaskListenerSearchQueryResult>

Search global user task listeners (POST /global-task-listeners/search).

Example

async fn search_global_task_listeners() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_global_task_listeners(SearchGlobalTaskListenersParams {
global_task_listener_search_query_request: Some(
GlobalTaskListenerSearchQueryRequest::default(),
),
})
.await?;
for item in result.items {
println!("{}", item.id);
}

Ok(())
}

search_group_ids_for_tenant​

pub async fn search_group_ids_for_tenant(&self, params: SearchGroupIdsForTenantParams) -> Result<models::TenantGroupSearchResult>

Search groups for tenant (POST /tenants/{tenantId}/groups/search).

Example

async fn search_group_ids_for_tenant(tenant_id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_group_ids_for_tenant(SearchGroupIdsForTenantParams {
tenant_id,
tenant_group_search_query_request: Some(TenantGroupSearchQueryRequest::default()),
})
.await?;
println!("{result:#?}");

Ok(())
}

search_groups​

pub async fn search_groups(&self, params: SearchGroupsParams) -> Result<models::GroupSearchQueryResult>

Search groups (POST /groups/search).

Example

async fn search_groups() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_groups(SearchGroupsParams {
group_search_query_request: Some(GroupSearchQueryRequest::default()),
})
.await?;
for item in result.items {
println!("{}", item.group_id);
}

Ok(())
}

search_groups_for_role​

pub async fn search_groups_for_role(&self, params: SearchGroupsForRoleParams) -> Result<models::RoleGroupSearchResult>

Search role groups (POST /roles/{roleId}/groups/search).

Example

async fn search_groups_for_role(role_id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_groups_for_role(SearchGroupsForRoleParams {
role_id,
role_group_search_query_request: Some(RoleGroupSearchQueryRequest::default()),
})
.await?;
println!("{result:#?}");

Ok(())
}

search_incidents​

pub async fn search_incidents(&self, params: SearchIncidentsParams) -> Result<models::IncidentSearchQueryResult>

Search incidents (POST /incidents/search).

Example

async fn search_incidents() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_incidents(SearchIncidentsParams {
incident_search_query: Some(IncidentSearchQuery::default()),
})
.await?;
for item in result.items {
println!("{}", item.element_id);
}

Ok(())
}

search_jobs​

pub async fn search_jobs(&self, params: SearchJobsParams) -> Result<models::JobSearchQueryResult>

Search jobs (POST /jobs/search).

Example

async fn search_jobs() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_jobs(SearchJobsParams {
job_search_query: Some(JobSearchQuery::default()),
})
.await?;
for item in result.items {
println!("{}", item.process_definition_id);
}

Ok(())
}

search_mapping_rule​

pub async fn search_mapping_rule(&self, params: SearchMappingRuleParams) -> Result<models::MappingRuleSearchQueryResult>

Search mapping rules (POST /mapping-rules/search).

Example

async fn search_mapping_rule() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_mapping_rule(SearchMappingRuleParams {
mapping_rule_search_query_request: Some(MappingRuleSearchQueryRequest::default()),
})
.await?;
for item in result.items {
println!("{}", item.mapping_rule_id);
}

Ok(())
}

search_mapping_rules_for_group​

pub async fn search_mapping_rules_for_group(&self, params: SearchMappingRulesForGroupParams) -> Result<models::GroupMappingRuleSearchResult>

Search group mapping rules (POST /groups/{groupId}/mapping-rules/search).

Example

async fn search_mapping_rules_for_group(
group_id: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_mapping_rules_for_group(SearchMappingRulesForGroupParams {
group_id,
mapping_rule_search_query_request: Some(MappingRuleSearchQueryRequest::default()),
})
.await?;
println!("{result:#?}");

Ok(())
}

search_mapping_rules_for_role​

pub async fn search_mapping_rules_for_role(&self, params: SearchMappingRulesForRoleParams) -> Result<models::RoleMappingRuleSearchResult>

Search role mapping rules (POST /roles/{roleId}/mapping-rules/search).

Example

async fn search_mapping_rules_for_role(role_id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_mapping_rules_for_role(SearchMappingRulesForRoleParams {
role_id,
mapping_rule_search_query_request: Some(MappingRuleSearchQueryRequest::default()),
})
.await?;
println!("{result:#?}");

Ok(())
}

search_mapping_rules_for_tenant​

pub async fn search_mapping_rules_for_tenant(&self, params: SearchMappingRulesForTenantParams) -> Result<models::TenantMappingRuleSearchResult>

Search mapping rules for tenant (POST /tenants/{tenantId}/mapping-rules/search).

Example

async fn search_mapping_rules_for_tenant(
tenant_id: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_mapping_rules_for_tenant(SearchMappingRulesForTenantParams {
tenant_id,
mapping_rule_search_query_request: Some(MappingRuleSearchQueryRequest::default()),
})
.await?;
println!("{result:#?}");

Ok(())
}

search_message_subscriptions​

pub async fn search_message_subscriptions(&self, params: SearchMessageSubscriptionsParams) -> Result<models::MessageSubscriptionSearchQueryResult>

Search message subscriptions (POST /message-subscriptions/search).

Example

async fn search_message_subscriptions() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_message_subscriptions(SearchMessageSubscriptionsParams {
message_subscription_search_query: Some(MessageSubscriptionSearchQuery::default()),
})
.await?;
for item in result.items {
println!("{}", item.element_id);
}

Ok(())
}

search_own_authorizations​

pub async fn search_own_authorizations(&self, params: SearchOwnAuthorizationsParams) -> Result<models::OwnAuthorizationSearchResult>

Search own authorizations (POST /authentication/me/authorizations/search).

Example

async fn search_own_authorizations() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_own_authorizations(SearchOwnAuthorizationsParams {
authorization_search_query: Some(AuthorizationSearchQuery::default()),
})
.await?;
println!("{result:#?}");

Ok(())
}

search_process_definition_variable_names​

pub async fn search_process_definition_variable_names(&self, params: SearchProcessDefinitionVariableNamesParams) -> Result<models::ProcessDefinitionVariableNameSearchQueryResult>

Search process definition variable names (POST /process-definitions/{processDefinitionKey}/variable-names/search).

Example

async fn search_process_definition_variable_names(
process_definition_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_process_definition_variable_names(SearchProcessDefinitionVariableNamesParams {
process_definition_key,
process_definition_variable_name_search_query: Some(
ProcessDefinitionVariableNameSearchQuery::default(),
),
})
.await?;
for item in result.items {
println!("{}", item.name);
}

Ok(())
}

search_process_definitions​

pub async fn search_process_definitions(&self, params: SearchProcessDefinitionsParams) -> Result<models::ProcessDefinitionSearchQueryResult>

Search process definitions (POST /process-definitions/search).

Example

async fn search_process_definitions() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_process_definitions(SearchProcessDefinitionsParams {
process_definition_search_query: Some(ProcessDefinitionSearchQuery::default()),
})
.await?;
for item in result.items {
println!("{}", item.process_definition_id);
}

Ok(())
}

search_process_instance_incidents​

pub async fn search_process_instance_incidents(&self, params: SearchProcessInstanceIncidentsParams) -> Result<models::IncidentSearchQueryResult>

Search related incidents (POST /process-instances/{processInstanceKey}/incidents/search).

Example

async fn search_process_instance_incidents(
process_instance_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_process_instance_incidents(SearchProcessInstanceIncidentsParams {
process_instance_key,
incident_search_query: Some(IncidentSearchQuery::default()),
})
.await?;
for item in result.items {
println!("{}", item.element_id);
}

Ok(())
}

search_process_instances​

pub async fn search_process_instances(&self, params: SearchProcessInstancesParams) -> Result<models::ProcessInstanceSearchQueryResult>

Search process instances (POST /process-instances/search).

Example

async fn search_process_instances() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_process_instances(SearchProcessInstancesParams {
process_instance_search_query: Some(ProcessInstanceSearchQuery::default()),
})
.await?;
for item in result.items {
println!("{}", item.process_definition_id);
}

Ok(())
}

search_resources​

pub async fn search_resources(&self, params: SearchResourcesParams) -> Result<models::ResourceSearchQueryResult>

Search resources (POST /resources/search).

Example

async fn search_resources() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_resources(SearchResourcesParams {
resource_search_query: Some(ResourceSearchQuery::default()),
})
.await?;
for item in result.items {
println!("{}", item.resource_id);
}

Ok(())
}

search_roles​

pub async fn search_roles(&self, params: SearchRolesParams) -> Result<models::RoleSearchQueryResult>

Search roles (POST /roles/search).

Example

async fn search_roles() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_roles(SearchRolesParams {
role_search_query_request: Some(RoleSearchQueryRequest::default()),
})
.await?;
for item in result.items {
println!("{}", item.role_id);
}

Ok(())
}

search_roles_for_group​

pub async fn search_roles_for_group(&self, params: SearchRolesForGroupParams) -> Result<models::GroupRoleSearchResult>

Search group roles (POST /groups/{groupId}/roles/search).

Example

async fn search_roles_for_group(group_id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_roles_for_group(SearchRolesForGroupParams {
group_id,
role_search_query_request: Some(RoleSearchQueryRequest::default()),
})
.await?;
println!("{result:#?}");

Ok(())
}

search_roles_for_tenant​

pub async fn search_roles_for_tenant(&self, params: SearchRolesForTenantParams) -> Result<models::TenantRoleSearchResult>

Search roles for tenant (POST /tenants/{tenantId}/roles/search).

Example

async fn search_roles_for_tenant(tenant_id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_roles_for_tenant(SearchRolesForTenantParams {
tenant_id,
role_search_query_request: Some(RoleSearchQueryRequest::default()),
})
.await?;
println!("{result:#?}");

Ok(())
}

search_tenants​

pub async fn search_tenants(&self, params: SearchTenantsParams) -> Result<models::TenantSearchQueryResult>

Search tenants (POST /tenants/search).

Example

async fn search_tenants() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_tenants(SearchTenantsParams {
tenant_search_query_request: Some(TenantSearchQueryRequest::default()),
})
.await?;
for item in result.items {
println!("{}", item.name);
}

Ok(())
}

search_user_task_audit_logs​

pub async fn search_user_task_audit_logs(&self, params: SearchUserTaskAuditLogsParams) -> Result<models::AuditLogSearchQueryResult>

Search user task audit logs (POST /user-tasks/{userTaskKey}/audit-logs/search).

Example

async fn search_user_task_audit_logs(
user_task_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_user_task_audit_logs(SearchUserTaskAuditLogsParams {
user_task_key,
user_task_audit_log_search_query_request: Some(
UserTaskAuditLogSearchQueryRequest::default(),
),
})
.await?;
for item in result.items {
println!("{}", item.entity_key);
}

Ok(())
}

search_user_task_effective_variables​

pub async fn search_user_task_effective_variables(&self, params: SearchUserTaskEffectiveVariablesParams) -> Result<models::VariableSearchQueryResult>

Search user task effective variables (POST /user-tasks/{userTaskKey}/effective-variables/search).

Example

async fn search_user_task_effective_variables(
user_task_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_user_task_effective_variables(SearchUserTaskEffectiveVariablesParams {
user_task_key,
truncate_values: None,
user_task_effective_variable_search_query_request: Some(
UserTaskEffectiveVariableSearchQueryRequest::default(),
),
})
.await?;
for item in result.items {
println!("{}", item.name);
}

Ok(())
}

search_user_task_variables​

pub async fn search_user_task_variables(&self, params: SearchUserTaskVariablesParams) -> Result<models::VariableSearchQueryResult>

Search user task variables (POST /user-tasks/{userTaskKey}/variables/search).

Example

async fn search_user_task_variables(
user_task_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_user_task_variables(SearchUserTaskVariablesParams {
user_task_key,
truncate_values: None,
user_task_variable_search_query_request: Some(
UserTaskVariableSearchQueryRequest::default(),
),
})
.await?;
for item in result.items {
println!("{}", item.name);
}

Ok(())
}

search_user_tasks​

pub async fn search_user_tasks(&self, params: SearchUserTasksParams) -> Result<models::UserTaskSearchQueryResult>

Search user tasks (POST /user-tasks/search).

Example

async fn search_user_tasks() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_user_tasks(SearchUserTasksParams {
user_task_search_query: Some(UserTaskSearchQuery::default()),
})
.await?;
for item in result.items {
println!("{}", item.element_id);
}

Ok(())
}

search_users​

pub async fn search_users(&self, params: SearchUsersParams) -> Result<models::UserSearchResult>

Search users (POST /users/search).

Example

async fn search_users() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_users(SearchUsersParams {
user_search_query_request: Some(UserSearchQueryRequest::default()),
})
.await?;
println!("{result:#?}");

Ok(())
}

search_users_for_group​

pub async fn search_users_for_group(&self, params: SearchUsersForGroupParams) -> Result<models::GroupUserSearchResult>

Search group users (POST /groups/{groupId}/users/search).

Example

async fn search_users_for_group(group_id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_users_for_group(SearchUsersForGroupParams {
group_id,
group_user_search_query_request: Some(GroupUserSearchQueryRequest::default()),
})
.await?;
println!("{result:#?}");

Ok(())
}

search_users_for_role​

pub async fn search_users_for_role(&self, params: SearchUsersForRoleParams) -> Result<models::RoleUserSearchResult>

Search role users (POST /roles/{roleId}/users/search).

Example

async fn search_users_for_role(role_id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_users_for_role(SearchUsersForRoleParams {
role_id,
role_user_search_query_request: Some(RoleUserSearchQueryRequest::default()),
})
.await?;
println!("{result:#?}");

Ok(())
}

search_users_for_tenant​

pub async fn search_users_for_tenant(&self, params: SearchUsersForTenantParams) -> Result<models::TenantUserSearchResult>

Search users for tenant (POST /tenants/{tenantId}/users/search).

Example

async fn search_users_for_tenant(tenant_id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.search_users_for_tenant(SearchUsersForTenantParams {
tenant_id,
tenant_user_search_query_request: Some(TenantUserSearchQueryRequest::default()),
})
.await?;
println!("{result:#?}");

Ok(())
}

search_variables​

pub async fn search_variables(&self, request: models::VariableSearchQuery) -> Result<models::VariableSearchQueryResult>

Search variables, returning the raw generated result.

Example

async fn search_variables() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

// An empty query returns the first page of all variables. Set `filter` to narrow
// by process instance, scope, name, or value.
let results = client
.search_variables(VariableSearchQuery::default())
.await?;

for variable in results.items {
println!("{} = {}", variable.name, variable.value);
}

Ok(())
}

search_variables_as​

pub async fn search_variables_as<T>(&self, request: models::VariableSearchQuery) -> Result<Vec<T>>

Search variables and deserialize each variable's JSON value into a typed T.

Returns the deserialized values in result order; variables whose value is absent are skipped.

spawn_worker​

pub fn spawn_worker<F, Fut>(&self, config: JobWorkerConfig, handler: F)

Spawn a managed job worker and register it for lifecycle control. The returned handle can stop the individual worker; CamundaClient::stop_all_workers stops every registered worker. The worker is also retained by the client so it keeps running even if the returned handle is dropped.

stop_all_workers​

pub async fn stop_all_workers(&self) -> Result<()>

Gracefully stop every registered worker, letting in-flight jobs drain, and await their completion. Clears the registry.

suspend_batch_operation​

pub async fn suspend_batch_operation(&self, params: SuspendBatchOperationParams) -> Result<()>

Suspend Batch operation (POST /batch-operations/{batchOperationKey}/suspension).

Example

async fn suspend_batch_operation(
batch_operation_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.suspend_batch_operation(SuspendBatchOperationParams {
batch_operation_key,
})
.await?;
println!("Suspend Batch operation: done");

Ok(())
}

suspend_process_instance​

pub async fn suspend_process_instance(&self, params: SuspendProcessInstanceParams) -> Result<()>

Suspend process instance (POST /process-instances/{processInstanceKey}/suspension).

Example

async fn suspend_process_instance(
process_instance_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.suspend_process_instance(SuspendProcessInstanceParams {
process_instance_key,
suspend_process_instance_request: Some(SuspendProcessInstanceRequest::default()),
})
.await?;
println!("Suspend process instance: done");

Ok(())
}

suspend_process_instances_batch_operation​

pub async fn suspend_process_instances_batch_operation(&self, params: SuspendProcessInstancesBatchOperationParams) -> Result<models::BatchOperationCreatedResult>

Suspend process instances (batch) (POST /process-instances/suspension).

Example

async fn suspend_process_instances_batch_operation() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.suspend_process_instances_batch_operation(SuspendProcessInstancesBatchOperationParams {
process_instance_suspension_batch_operation_request:
ProcessInstanceSuspensionBatchOperationRequest {
filter: Box::new(ProcessInstanceFilter::default()),
..Default::default()
},
})
.await?;
println!("{}", result.batch_operation_key);

Ok(())
}

sync_runtime_backup_state​

pub async fn sync_runtime_backup_state(&self) -> Result<models::RuntimeBackupState>

Force-write runtime backup state (POST /backups/runtime/state/sync).

Example

async fn sync_runtime_backup_state() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let state = client.sync_runtime_backup_state().await?;
println!("{state:#?}");

Ok(())
}

sync_runtime_backup_state_as_cluster_admin​

pub async fn sync_runtime_backup_state_as_cluster_admin(&self, params: SyncRuntimeBackupStateAsClusterAdminParams) -> Result<models::ClusterRuntimeBackupState>

Force-write runtime backup state across physical tenants (POST /cluster/v2/backups/runtime/state/sync).

Example

async fn sync_runtime_backup_state_as_cluster_admin() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let state = client
.sync_runtime_backup_state_as_cluster_admin(SyncRuntimeBackupStateAsClusterAdminParams {
physical_tenant_id: None,
})
.await?;
println!("{state:#?}");

Ok(())
}

take_history_backup​

pub async fn take_history_backup(&self, params: TakeHistoryBackupParams) -> Result<models::TakeHistoryBackupResponse>

Take a history backup (POST /backups/history).

Example

async fn take_history_backup() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.take_history_backup(TakeHistoryBackupParams {
take_history_backup_request: TakeHistoryBackupRequest { backup_id: 1 },
})
.await?;
println!("{result:#?}");

Ok(())
}

take_history_backup_as_cluster_admin​

pub async fn take_history_backup_as_cluster_admin(&self, params: TakeHistoryBackupAsClusterAdminParams) -> Result<models::ClusterTakeHistoryBackupResponse>

Take a history backup on one or every physical tenant (POST /cluster/v2/backups/history).

Example

async fn take_history_backup_as_cluster_admin() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.take_history_backup_as_cluster_admin(TakeHistoryBackupAsClusterAdminParams {
take_history_backup_request: TakeHistoryBackupRequest { backup_id: 1 },
physical_tenant_id: None,
})
.await?;
println!("{result:#?}");

Ok(())
}

take_runtime_backup​

pub async fn take_runtime_backup(&self, params: TakeRuntimeBackupParams) -> Result<models::TakeRuntimeBackupResponse>

Take a runtime backup (POST /backups/runtime).

Example

async fn take_runtime_backup() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.take_runtime_backup(TakeRuntimeBackupParams {
take_runtime_backup_request: Some(TakeRuntimeBackupRequest {
backup_id: Some(Some(1)),
}),
})
.await?;
println!("{result:#?}");

Ok(())
}

take_runtime_backup_as_cluster_admin​

pub async fn take_runtime_backup_as_cluster_admin(&self, params: TakeRuntimeBackupAsClusterAdminParams) -> Result<models::ClusterTakeRuntimeBackupResponse>

Take a runtime backup on one or every physical tenant (POST /cluster/v2/backups/runtime).

Example

async fn take_runtime_backup_as_cluster_admin() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

// Setting `physical_tenant_id` scopes the backup to one physical tenant; omit
// it to back up every physical tenant of the cluster.
let result = client
.take_runtime_backup_as_cluster_admin(TakeRuntimeBackupAsClusterAdminParams {
physical_tenant_id: Some("default".to_string()),
take_runtime_backup_request: Some(TakeRuntimeBackupRequest {
backup_id: Some(Some(1)),
}),
})
.await?;
println!("{result:#?}");

Ok(())
}

throw_job_error​

pub async fn throw_job_error(&self, job_key: &str, request: models::JobErrorRequest) -> Result<()>

Throw a BPMN error from a job.

Example

async fn throw_job_error(job_key: &str) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

// Routes the token to a matching BPMN error boundary event, rather than
// failing the job technically.
client
.throw_job_error(
job_key,
JobErrorRequest {
error_code: "PAYMENT_DECLINED".to_string(),
error_message: Some(Some("card declined by issuer".to_string())),
..Default::default()
},
)
.await?;

println!("Threw BPMN error for job {job_key}");

Ok(())
}

topology​

pub async fn topology(&self) -> Result<models::TopologyResponse>

Fetch the cluster topology.

Example

async fn get_topology() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let topology = client.topology().await?;

println!("Gateway version: {}", topology.gateway_version);
println!("Cluster size: {}", topology.cluster_size);
println!("Partitions: {}", topology.partitions_count);
println!("Replication factor: {}", topology.replication_factor);

for broker in topology.brokers {
println!(
" broker {} at {}:{}",
broker.node_id, broker.host, broker.port
);
}

Ok(())
}

trigger_cluster_rebalance​

pub async fn trigger_cluster_rebalance(&self, params: TriggerClusterRebalanceParams) -> Result<models::ClusterBalanceResponse>

Trigger a cluster-wide leadership rebalance (POST /cluster/v2/rebalance).

Example

async fn trigger_cluster_rebalance() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

// Every setting is optional; an absent request body means "use the configured
// settings". Set `dry_run` to report the plan without moving any leadership.
let result = client
.trigger_cluster_rebalance(TriggerClusterRebalanceParams {
dry_run: Some(true),
cluster_rebalance_request: Some(ClusterRebalanceRequest {
replication_timeout: Some("PT30S".to_string()),
..Default::default()
}),
})
.await?;
println!("{result:#?}");

Ok(())
}

unassign_client_from_group​

pub async fn unassign_client_from_group(&self, params: UnassignClientFromGroupParams) -> Result<()>

Unassign a client from a group (DELETE /groups/{groupId}/clients/{clientId}).

Example

async fn unassign_client_from_group(
group_id: String,
client_id: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.unassign_client_from_group(UnassignClientFromGroupParams {
group_id,
client_id,
})
.await?;
println!("Unassign a client from a group: done");

Ok(())
}

unassign_client_from_tenant​

pub async fn unassign_client_from_tenant(&self, params: UnassignClientFromTenantParams) -> Result<()>

Unassign a client from a tenant (DELETE /tenants/{tenantId}/clients/{clientId}).

Example

async fn unassign_client_from_tenant(
tenant_id: String,
client_id: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.unassign_client_from_tenant(UnassignClientFromTenantParams {
tenant_id,
client_id,
})
.await?;
println!("Unassign a client from a tenant: done");

Ok(())
}

unassign_group_from_tenant​

pub async fn unassign_group_from_tenant(&self, params: UnassignGroupFromTenantParams) -> Result<()>

Unassign a group from a tenant (DELETE /tenants/{tenantId}/groups/{groupId}).

Example

async fn unassign_group_from_tenant(
tenant_id: String,
group_id: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.unassign_group_from_tenant(UnassignGroupFromTenantParams {
tenant_id,
group_id,
})
.await?;
println!("Unassign a group from a tenant: done");

Ok(())
}

unassign_mapping_rule_from_group​

pub async fn unassign_mapping_rule_from_group(&self, params: UnassignMappingRuleFromGroupParams) -> Result<()>

Unassign a mapping rule from a group (DELETE /groups/{groupId}/mapping-rules/{mappingRuleId}).

Example

async fn unassign_mapping_rule_from_group(
group_id: String,
mapping_rule_id: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.unassign_mapping_rule_from_group(UnassignMappingRuleFromGroupParams {
group_id,
mapping_rule_id,
})
.await?;
println!("Unassign a mapping rule from a group: done");

Ok(())
}

unassign_mapping_rule_from_tenant​

pub async fn unassign_mapping_rule_from_tenant(&self, params: UnassignMappingRuleFromTenantParams) -> Result<()>

Unassign a mapping rule from a tenant (DELETE /tenants/{tenantId}/mapping-rules/{mappingRuleId}).

Example

async fn unassign_mapping_rule_from_tenant(
tenant_id: String,
mapping_rule_id: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.unassign_mapping_rule_from_tenant(UnassignMappingRuleFromTenantParams {
tenant_id,
mapping_rule_id,
})
.await?;
println!("Unassign a mapping rule from a tenant: done");

Ok(())
}

unassign_role_from_client​

pub async fn unassign_role_from_client(&self, params: UnassignRoleFromClientParams) -> Result<()>

Unassign a role from a client (DELETE /roles/{roleId}/clients/{clientId}).

Example

async fn unassign_role_from_client(
role_id: String,
client_id: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.unassign_role_from_client(UnassignRoleFromClientParams { role_id, client_id })
.await?;
println!("Unassign a role from a client: done");

Ok(())
}

unassign_role_from_group​

pub async fn unassign_role_from_group(&self, params: UnassignRoleFromGroupParams) -> Result<()>

Unassign a role from a group (DELETE /roles/{roleId}/groups/{groupId}).

Example

async fn unassign_role_from_group(
role_id: String,
group_id: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.unassign_role_from_group(UnassignRoleFromGroupParams { role_id, group_id })
.await?;
println!("Unassign a role from a group: done");

Ok(())
}

unassign_role_from_mapping_rule​

pub async fn unassign_role_from_mapping_rule(&self, params: UnassignRoleFromMappingRuleParams) -> Result<()>

Unassign a role from a mapping rule (DELETE /roles/{roleId}/mapping-rules/{mappingRuleId}).

Example

async fn unassign_role_from_mapping_rule(
role_id: String,
mapping_rule_id: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.unassign_role_from_mapping_rule(UnassignRoleFromMappingRuleParams {
role_id,
mapping_rule_id,
})
.await?;
println!("Unassign a role from a mapping rule: done");

Ok(())
}

unassign_role_from_tenant​

pub async fn unassign_role_from_tenant(&self, params: UnassignRoleFromTenantParams) -> Result<()>

Unassign a role from a tenant (DELETE /tenants/{tenantId}/roles/{roleId}).

Example

async fn unassign_role_from_tenant(
tenant_id: String,
role_id: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.unassign_role_from_tenant(UnassignRoleFromTenantParams { tenant_id, role_id })
.await?;
println!("Unassign a role from a tenant: done");

Ok(())
}

unassign_role_from_user​

pub async fn unassign_role_from_user(&self, params: UnassignRoleFromUserParams) -> Result<()>

Unassign a role from a user (DELETE /roles/{roleId}/users/{username}).

Example

async fn unassign_role_from_user(
role_id: String,
username: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.unassign_role_from_user(UnassignRoleFromUserParams { role_id, username })
.await?;
println!("Unassign a role from a user: done");

Ok(())
}

unassign_user_from_group​

pub async fn unassign_user_from_group(&self, params: UnassignUserFromGroupParams) -> Result<()>

Unassign a user from a group (DELETE /groups/{groupId}/users/{username}).

Example

async fn unassign_user_from_group(
group_id: String,
username: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.unassign_user_from_group(UnassignUserFromGroupParams { group_id, username })
.await?;
println!("Unassign a user from a group: done");

Ok(())
}

unassign_user_from_tenant​

pub async fn unassign_user_from_tenant(&self, params: UnassignUserFromTenantParams) -> Result<()>

Unassign a user from a tenant (DELETE /tenants/{tenantId}/users/{username}).

Example

async fn unassign_user_from_tenant(
tenant_id: String,
username: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.unassign_user_from_tenant(UnassignUserFromTenantParams {
tenant_id,
username,
})
.await?;
println!("Unassign a user from a tenant: done");

Ok(())
}

unassign_user_task​

pub async fn unassign_user_task(&self, params: UnassignUserTaskParams) -> Result<()>

Unassign user task (DELETE /user-tasks/{userTaskKey}/assignee).

Example

async fn unassign_user_task(user_task_key: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.unassign_user_task(UnassignUserTaskParams { user_task_key })
.await?;
println!("Unassign user task: done");

Ok(())
}

update_agent_instance​

pub async fn update_agent_instance(&self, params: UpdateAgentInstanceParams) -> Result<models::AgentInstanceUpdateResult>

Update agent instance (PATCH /agent-instances/{agentInstanceKey}).

Example

async fn update_agent_instance(
agent_instance_key: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.update_agent_instance(UpdateAgentInstanceParams {
agent_instance_key,
agent_instance_update_request: AgentInstanceUpdateRequest {
element_instance_key: Box::new(ElementInstanceKey::assume_exists(
"my-element-instance",
)),
job_key: Box::new(JobKey::assume_exists("my-job")),
job_lease: "my-job-lease".to_string(),
..Default::default()
},
})
.await?;
println!("Update agent instance: done");

Ok(())
}

update_authorization​

pub async fn update_authorization(&self, params: UpdateAuthorizationParams) -> Result<()>

Update authorization (PUT /authorizations/{authorizationKey}).

Example

async fn update_authorization(authorization_key: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.update_authorization(UpdateAuthorizationParams {
authorization_key,
authorization_request: AuthorizationRequest::AuthorizationIdBasedRequest(Box::new(
AuthorizationIdBasedRequest {
owner_id: "my-owner".to_string(),
owner_type: OwnerTypeEnum::User,
resource_id: "my-resource".to_string(),
resource_type: ResourceTypeEnum::AuditLog,
permission_types: vec![PermissionTypeEnum::Access],
},
)),
})
.await?;
println!("Update authorization: done");

Ok(())
}

update_global_cluster_variable​

pub async fn update_global_cluster_variable(&self, params: UpdateGlobalClusterVariableParams) -> Result<models::ClusterVariableResult>

Update a global-scoped cluster variable (PUT /cluster-variables/global/{name}).

Example

async fn update_global_cluster_variable(name: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.update_global_cluster_variable(UpdateGlobalClusterVariableParams {
name,
update_cluster_variable_request: UpdateClusterVariableRequest {
value: serde_json::json!({"key": "value"}),
..Default::default()
},
})
.await?;
println!("{}", result.name);

Ok(())
}

update_global_task_listener​

pub async fn update_global_task_listener(&self, params: UpdateGlobalTaskListenerParams) -> Result<models::GlobalTaskListenerResult>

Update global user task listener (PUT /global-task-listeners/{id}).

Example

async fn update_global_task_listener(id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.update_global_task_listener(UpdateGlobalTaskListenerParams {
id,
update_global_task_listener_request: UpdateGlobalTaskListenerRequest {
r#type: "my-type".to_string(),
event_types: vec![GlobalTaskListenerEventTypeEnum::All],
..Default::default()
},
})
.await?;
println!("{}", result.id);

Ok(())
}

update_group​

pub async fn update_group(&self, params: UpdateGroupParams) -> Result<models::GroupUpdateResult>

Update group (PUT /groups/{groupId}).

Example

async fn update_group(group_id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.update_group(UpdateGroupParams {
group_id,
group_update_request: GroupUpdateRequest {
name: "my-variable".to_string(),
..Default::default()
},
})
.await?;
println!("{}", result.group_id);

Ok(())
}

update_job​

pub async fn update_job(&self, params: UpdateJobParams) -> Result<()>

Update job (PATCH /jobs/{jobKey}).

Example

async fn update_job(job_key: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.update_job(UpdateJobParams {
job_key,
job_update_request: JobUpdateRequest {
changeset: Box::new(JobChangeset::default()),
..Default::default()
},
})
.await?;
println!("Update job: done");

Ok(())
}

update_jobs_batch_operation​

pub async fn update_jobs_batch_operation(&self, params: UpdateJobsBatchOperationParams) -> Result<models::BatchOperationCreatedResult>

Update jobs (batch) (POST /jobs/batch-update).

Example

async fn update_jobs_batch_operation() -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.update_jobs_batch_operation(UpdateJobsBatchOperationParams {
job_batch_update_request: JobBatchUpdateRequest {
filter: Box::new(JobFilter::default()),
changeset: Box::new(JobChangeset::default()),
..Default::default()
},
})
.await?;
println!("{}", result.batch_operation_key);

Ok(())
}

update_mapping_rule​

pub async fn update_mapping_rule(&self, params: UpdateMappingRuleParams) -> Result<models::MappingRuleUpdateResult>

Update mapping rule (PUT /mapping-rules/{mappingRuleId}).

Example

async fn update_mapping_rule(mapping_rule_id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.update_mapping_rule(UpdateMappingRuleParams {
mapping_rule_id,
mapping_rule_update_request: Some(MappingRuleUpdateRequest {
claim_name: "my-claim-name".to_string(),
claim_value: "my-claim-value".to_string(),
name: "my-variable".to_string(),
}),
})
.await?;
println!("{}", result.mapping_rule_id);

Ok(())
}

update_role​

pub async fn update_role(&self, params: UpdateRoleParams) -> Result<models::RoleUpdateResult>

Update role (PUT /roles/{roleId}).

Example

async fn update_role(role_id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.update_role(UpdateRoleParams {
role_id,
role_update_request: RoleUpdateRequest {
name: "my-variable".to_string(),
..Default::default()
},
})
.await?;
println!("{}", result.role_id);

Ok(())
}

update_tenant​

pub async fn update_tenant(&self, params: UpdateTenantParams) -> Result<models::TenantUpdateResult>

Update tenant (PUT /tenants/{tenantId}).

Example

async fn update_tenant(tenant_id: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.update_tenant(UpdateTenantParams {
tenant_id,
tenant_update_request: TenantUpdateRequest {
name: "my-variable".to_string(),
..Default::default()
},
})
.await?;
println!("{}", result.name);

Ok(())
}

update_tenant_cluster_variable​

pub async fn update_tenant_cluster_variable(&self, params: UpdateTenantClusterVariableParams) -> Result<models::ClusterVariableResult>

Update a tenant-scoped cluster variable (PUT /cluster-variables/tenants/{tenantId}/{name}).

Example

async fn update_tenant_cluster_variable(
tenant_id: String,
name: String,
) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.update_tenant_cluster_variable(UpdateTenantClusterVariableParams {
tenant_id,
name,
update_cluster_variable_request: UpdateClusterVariableRequest {
value: serde_json::json!({"key": "value"}),
..Default::default()
},
})
.await?;
println!("{}", result.name);

Ok(())
}

update_user​

pub async fn update_user(&self, params: UpdateUserParams) -> Result<models::UserUpdateResult>

Update user (PUT /users/{username}).

Example

async fn update_user(username: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

let result = client
.update_user(UpdateUserParams {
username,
user_update_request: UserUpdateRequest::default(),
})
.await?;
println!("{}", result.username);

Ok(())
}

update_user_task​

pub async fn update_user_task(&self, params: UpdateUserTaskParams) -> Result<()>

Update user task (PATCH /user-tasks/{userTaskKey}).

Example

async fn update_user_task(user_task_key: String) -> Result<(), Box<dyn std::error::Error>> {
let client = CamundaClient::from_env()?;

client
.update_user_task(UpdateUserTaskParams {
user_task_key,
user_task_update_request: Some(UserTaskUpdateRequest::default()),
})
.await?;
println!("Update user task: done");

Ok(())
}

worker_config​

pub fn worker_config(&self, job_type: impl Into<String>) -> JobWorkerConfig

Build a JobWorkerConfig for job_type pre-seeded from the SDK's resolved worker defaults (env-driven: CAMUNDA_WORKER_*). Builder methods override fields.

CamundaOptions​

Options for constructing a CamundaClient.

Non-exhaustive: construct with CamundaOptions::new and the with_* builders, so that later additions here are not breaking changes for callers.

Fields​

FieldTypeDescription
configHashMap<String, String>Programmatic overrides for CAMUNDA_* configuration keys. These take precedence over environment variables.
http_clientOption<Client>A pre-built reqwest::Client to use for all requests (including OAuth token fetches). When None, a default client is created.
clockOption<Arc<dyn Clock>>The clock the client's cadence resolves through. When None, real time is used.

Methods​

MethodDescription
newCreate empty options.
withAdd a single CAMUNDA_* configuration override.
with_clockResolve the client's cadence through clock instead of real time.
with_http_clientUse a custom reqwest::Client.