Runtime#
Authentication#
- class AsyncAuthProvider(*args, **kwargs)#
Bases:
ProtocolAsync auth provider variant.
If an auth provider implements this protocol, async clients will prefer it.
- async aget_headers()#
- Return type:
Mapping[str, str]
- class AsyncOAuthClientCredentialsAuthProvider(*, oauth_url, client_id, client_secret, audience, cache_dir=None, disk_cache_disable=False, saas_401_cooldown_s=30.0, transport=None, timeout=None, logger=None, clock=None, user_agent=None)#
Bases:
objectOAuth 2.0 Client Credentials provider with in-memory caching.
This is designed for async clients.
- Parameters:
oauth_url (str)
client_id (str)
client_secret (str)
audience (str)
cache_dir (str | None)
disk_cache_disable (bool)
saas_401_cooldown_s (float)
transport (httpx.AsyncBaseTransport | None)
timeout (float | None)
logger (SdkLogger | None)
clock (Clock | None)
user_agent (str | None)
- async aclose()#
Close the underlying async HTTP client used for token requests.
- Return type:
None
- async aget_headers()#
- Return type:
Mapping[str, str]
- get_headers()#
Sync fallback satisfying the
AuthProviderprotocol.Returns cached token headers if a valid token is already held, otherwise returns empty headers (the next async request hook will call
aget_headersto fetch a fresh token).- Return type:
Mapping[str, str]
- class AuthProvider(*args, **kwargs)#
Bases:
ProtocolProvides per-request authentication headers.
Implementations are expected to be lightweight and safe to call for every request.
- get_headers()#
- Return type:
Mapping[str, str]
- class BasicAuthProvider(*, username, password)#
Bases:
objectHTTP Basic auth provider.
- Parameters:
username (str)
password (str)
- get_headers()#
- Return type:
Mapping[str, str]
- class NullAuthProvider#
Bases:
objectDefault auth provider that adds no headers.
- get_headers()#
- Return type:
dict[str, str]
- class OAuthClientCredentialsAuthProvider(*, oauth_url, client_id, client_secret, audience, cache_dir=None, disk_cache_disable=False, saas_401_cooldown_s=30.0, transport=None, timeout=None, logger=None, clock=None, user_agent=None)#
Bases:
objectOAuth 2.0 Client Credentials provider with in-memory caching.
This is designed for sync clients.
- Parameters:
oauth_url (str)
client_id (str)
client_secret (str)
audience (str)
cache_dir (str | None)
disk_cache_disable (bool)
saas_401_cooldown_s (float)
transport (httpx.BaseTransport | None)
timeout (float | None)
logger (SdkLogger | None)
clock (Clock | None)
user_agent (str | None)
- close()#
Close the underlying HTTP client used for token requests.
Call this when the application is shutting down if you created a provider instance yourself (or if you want deterministic cleanup in tests).
- Return type:
None
- get_headers()#
- Return type:
Mapping[str, str]
- inject_auth_event_hooks(httpx_args, auth_provider, *, async_client=False, log_level=None, logger=None)#
Return a copy of httpx_args with a request hook that applies auth headers.
This uses httpx event hooks so we don’t have to inject headers in every generated API call.
- Parameters:
httpx_args (dict[str, Any] | None)
auth_provider (object)
async_client (bool)
log_level (str | None)
logger (SdkLogger | None)
- Return type:
dict[str, Any]
Logging#
Pluggable logger abstraction for the Camunda SDK.
Users can inject any logger that implements CamundaLogger (stdlib
logging.Logger, loguru.logger, or a custom object with
debug/info/warning/error methods).
When no logger is provided, loguru is used if installed, otherwise logging is silently disabled.
- class CamundaLogger(*args, **kwargs)#
Bases:
ProtocolProtocol for a logger injectable into the SDK.
Compatible with Python’s
logging.Logger,loguru.logger, or any object that exposes these four methods.- debug(msg, *args, **kwargs)#
- Parameters:
msg (str)
args (Any)
kwargs (Any)
- Return type:
None
- error(msg, *args, **kwargs)#
- Parameters:
msg (str)
args (Any)
kwargs (Any)
- Return type:
None
- info(msg, *args, **kwargs)#
- Parameters:
msg (str)
args (Any)
kwargs (Any)
- Return type:
None
- warning(msg, *args, **kwargs)#
- Parameters:
msg (str)
args (Any)
kwargs (Any)
- Return type:
None
- class NullLogger#
Bases:
objectLogger that silently discards all messages.
- debug(msg, *args, **kwargs)#
- Parameters:
msg (str)
args (Any)
kwargs (Any)
- Return type:
None
- error(msg, *args, **kwargs)#
- Parameters:
msg (str)
args (Any)
kwargs (Any)
- Return type:
None
- info(msg, *args, **kwargs)#
- Parameters:
msg (str)
args (Any)
kwargs (Any)
- Return type:
None
- trace(msg, *args, **kwargs)#
- Parameters:
msg (str)
args (Any)
kwargs (Any)
- Return type:
None
- warning(msg, *args, **kwargs)#
- Parameters:
msg (str)
args (Any)
kwargs (Any)
- Return type:
None
- class SdkLogger(logger, prefix='')#
Bases:
objectInternal wrapper that normalises logger implementations.
Adds
trace()support (falls back todebug()on loggers that lack it) andbind()support (uses loguru’s nativebindwhen available, otherwise prepends a[key=value ...]prefix to messages).- Parameters:
logger (CamundaLogger)
prefix (str)
- bind(**kwargs)#
Create a child logger with additional context.
If the underlying logger supports
bind()(e.g. loguru), the native method is used. Otherwise context is rendered as a[k=v ...]prefix on each message.- Parameters:
kwargs (str)
- Return type:
- debug(msg, *args, **kwargs)#
- Parameters:
msg (str)
args (Any)
kwargs (Any)
- Return type:
None
- error(msg, *args, **kwargs)#
- Parameters:
msg (str)
args (Any)
kwargs (Any)
- Return type:
None
- info(msg, *args, **kwargs)#
- Parameters:
msg (str)
args (Any)
kwargs (Any)
- Return type:
None
- trace(msg)#
- Parameters:
msg (str)
- Return type:
None
- warning(msg, *args, **kwargs)#
- Parameters:
msg (str)
args (Any)
kwargs (Any)
- Return type:
None
- create_logger(logger=None)#
Create an
SdkLogger.- Parameters:
logger (CamundaLogger | None) – A user-supplied logger. When
None, loguru is used if installed, otherwise aNullLoggeris used.- Return type:
Job Worker#
- AsyncJobContext#
alias of
ConnectedJobContext
- class ConnectedJobContext(type_, process_definition_id, process_definition_version, element_id, custom_headers, worker, retries, deadline, variables, tenant_id, physical_tenant_id, job_key, process_instance_key, process_definition_key, element_instance_key, kind, listener_event_type, user_task, tags, root_process_instance_key, business_id, priority, job_lease_token, log=NOTHING, *, client, clock)#
Bases:
JobContextContext for async handlers — includes an async client reference.
Extends
JobContextwith aclientattribute that provides access to the Camunda API from within an async job handler. Useawait job.client.method(...)to call API methods.This context is provided when the execution strategy is
"async". For"thread"handlers, seeSyncJobContext. For"process"handlers, seeJobContext.- Parameters:
type_ (str)
process_definition_id (ProcessDefinitionId)
process_definition_version (int)
element_id (ElementId)
custom_headers (ActivatedJobResultCustomHeaders)
worker (str)
retries (int)
deadline (int)
variables (ActivatedJobResultVariables)
tenant_id (TenantId)
physical_tenant_id (str)
job_key (JobKey)
process_instance_key (ProcessInstanceKey)
process_definition_key (ProcessDefinitionKey)
element_instance_key (ElementInstanceKey)
kind (JobKindEnum)
listener_event_type (JobListenerEventTypeEnum)
user_task (ActivatedJobResultUserTask | None)
tags (list[str])
root_process_instance_key (None | ProcessInstanceKey)
business_id (None | BusinessId)
priority (int)
job_lease_token (None | JobLeaseToken)
log (SdkLogger)
client (CamundaAsyncClient)
clock (Clock)
- clock#
The worker’s clock. Await
job.clock.sleep(...)rather thanasyncio.sleep(...)so a handler that waits follows engine time when the engine’s clock is pinned, instead of stalling on the real one.For short in-handler coordination only – spacing a retry, waiting on a resource to settle. A long or business wait belongs in the process as a BPMN timer event: a handler holding a job for minutes occupies a worker slot, risks the job timeout expiring underneath it, and hides the wait from the process model where it cannot be seen or changed.
- Type:
Clock
- client: CamundaAsyncClient#
- clock: Clock#
- exception JobCommandError(command, job_key, cause, msg)#
Bases:
ExceptionAn error raised by one of the worker’s own job commands (complete / fail / throw error), as opposed to an error raised by the handler. The worker never answers one of these with
fail_job: the command may have landed, or the engine is unreachable.- Parameters:
command (str)
job_key (object)
cause (BaseException)
msg (str)
- Return type:
None
- exception JobCommandJobNotFound(command, job_key, cause)#
Bases:
JobCommandErrorA job command got 404: the job was already completed, failed or timed out.
- Parameters:
command (str)
job_key (object)
cause (BaseException)
- Return type:
None
- exception JobCommandOutcomeUnknown(command, job_key, cause)#
Bases:
JobCommandErrorA job command’s outcome is unknown: it may or may not have been applied.
- Parameters:
command (str)
job_key (object)
cause (BaseException)
- Return type:
None
- exception JobCommandRejected(command, job_key, cause)#
Bases:
JobCommandErrorA job command was definitely rejected (e.g. 400, 409 on a first attempt).
- Parameters:
command (str)
job_key (object)
cause (BaseException)
- Return type:
None
- exception JobCommandRetriesExhausted(command, job_key, cause, attempts)#
Bases:
JobCommandErrorA job command was retried until its budget ran out without a definite outcome.
- Parameters:
command (str)
job_key (object)
cause (BaseException)
attempts (int)
- Return type:
None
- class JobContext(type_, process_definition_id, process_definition_version, element_id, custom_headers, worker, retries, deadline, variables, tenant_id, physical_tenant_id, job_key, process_instance_key, process_definition_key, element_instance_key, kind, listener_event_type, user_task, tags, root_process_instance_key, business_id, priority, job_lease_token, log=NOTHING)#
Bases:
ActivatedJobResultRead-only context for a job execution.
Deliberately has no
clock. This is the context handed toprocesshandlers, so it is pickled across a process boundary, and a clock owns a lock (and, once pinned, a live connection to an engine) – neither of which survives the trip. Handlers that need the injected clock run under theasyncorthreadstrategies, whose contexts carry one; seeConnectedJobContextandSyncJobContext.Trust model of the
processstrategy. Pickle is used across that boundary, and nowhere else in the SDK. Both ends are worker processes the SDK itself starts, linked only by the private queues of theProcessPoolExecutorthat connects them:Parent to child: the handler and this context. The context is built from the server’s activated-job JSON, but that JSON is parsed with
jsonand only the parsed result is pickled. Job variables and custom headers stay plaindict/list/str/int/float/bool/Nonevalues; they are never deserialised into arbitrary classes. Everything else in the context is an SDK model, an enum, a semantic-type string (such asJobKey) or the logger (which pickles as a silentNullLogger). Which classes unpickling instantiates is decided by the types of the objects the worker built, never by what the job data says.Child to parent: the handler’s result, which is whatever the handler returns (or the failure or error details it raised). This is the one place pickle carries data that user code controls: a handler’s return value is pickled in the child and unpickled in the worker’s parent process. The handler, and every library it uses, is therefore inside the trust boundary. Return a
dictof JSON-compatible values or aJobCompletionRequest, not arbitrary objects.Never unpickled: bytes from the server, the OAuth token cache (JSON), configuration or environment files, or any other source outside the worker’s own process pool.
The SDK’s acceptance tests guard these properties: they fail if the SDK gains a pickle loader or its own inter-process channel, if a process pool is configured with anything but a worker count, or if a
JobContextholds anything but JSON data and SDK types.- Parameters:
type_ (str)
process_definition_id (ProcessDefinitionId)
process_definition_version (int)
element_id (ElementId)
custom_headers (ActivatedJobResultCustomHeaders)
worker (str)
retries (int)
deadline (int)
variables (ActivatedJobResultVariables)
tenant_id (TenantId)
physical_tenant_id (str)
job_key (JobKey)
process_instance_key (ProcessInstanceKey)
process_definition_key (ProcessDefinitionKey)
element_instance_key (ElementInstanceKey)
kind (JobKindEnum)
listener_event_type (JobListenerEventTypeEnum)
user_task (ActivatedJobResultUserTask | None)
tags (list[str])
root_process_instance_key (None | ProcessInstanceKey)
business_id (None | BusinessId)
priority (int)
job_lease_token (None | JobLeaseToken)
log (SdkLogger)
- log#
A scoped logger bound to this job’s context (job type, job key). Use
job.log.info(...)etc. inside your handler to emit structured log messages.- Type:
- variables#
The variables visible to the task scope. Untrusted input: their content is set by whoever started or advanced the process instance. The SDK parses them with
jsoninto plaindict/list/str/int/float/bool/Nonevalues and never instantiates a class from the payload, and each job gets its own context – but it enforces no size or depth limit and validates nothing against a schema. Bound what a worker receives withWorkerConfig.fetch_variables, bound your own recursion if you walk a variable, and validate withMyModel.model_validate(job.variables.to_dict()). See “Job Variables Are Untrusted Input” in the README.
- custom_headers#
The task headers defined in the BPMN model at modelling time. Not caller-supplied like
variables, so they are trustworthy as far as control over who may deploy a process definition goes; the SDK checks them no more than it checks variables.
- exception JobError(error_code, message='', variables=None)#
Bases:
ExceptionRaise this exception to throw a BPMN error.
- Parameters:
error_code (str)
message (str)
variables (dict[str, Any] | None)
- exception JobFailure(message, retries=None, retry_back_off=0, variables=None)#
Bases:
ExceptionRaise this exception to explicitly fail a job with custom retries/backoff.
- Parameters:
message (str)
retries (int | None)
retry_back_off (int)
variables (dict[str, Any] | None)
- class JobWorker(client, callback, config, logger=None, execution_strategy='auto', startup_jitter_max_seconds=0, clock=None, random=None)#
Bases:
object- Parameters:
client (CamundaAsyncClient)
callback (JobHandler)
config (WorkerConfig)
logger (SdkLogger | None)
execution_strategy (EXECUTION_STRATEGY)
startup_jitter_max_seconds (float)
clock (Clock | None)
random (RandomSource | None)
- async aclose()#
Async-aware teardown.
Cancels any in-flight job tasks and awaits their cancellation (bounded by a timeout) before delegating to the synchronous
close(). Prefer this overstop()/close()from inside a running event loop — it gives cancelled tasks a chance to propagate before the pools they depend on are shut down, which prevents ‘cannot schedule new futures after shutdown’ (and the post-#150 ‘JobWorker is closed’) errors from surfacing as task exceptions.- Return type:
None
- close()#
Release any resources this worker lazily allocated.
Safe to call multiple times and from multiple threads concurrently. Use as a context manager (
with JobWorker(...) as worker:) or in a pytest fixture teardown to avoid leaking file descriptors across many short-lived worker instances (see issue #148).Blocks until pools have finished shutdown so file descriptors and worker processes are reliably released before the references are cleared. If invoked from inside a pool worker thread, falls back to a non-waiting shutdown for that pool to avoid a self-join deadlock. If invoked from the worker loop thread, skips joining the worker thread (same self-join hazard).
After
close()returns, accessingthread_pool,process_pool, orworker_loopraisesRuntimeError; a closed JobWorker cannot be reused.- Return type:
None
- async poll_loop()#
Background polling loop - always async
- property process_pool: ProcessPoolExecutor#
- start()#
- stop()#
- property thread_pool: ThreadPoolExecutor#
- property worker_loop: AbstractEventLoop#
- class SyncJobContext(type_, process_definition_id, process_definition_version, element_id, custom_headers, worker, retries, deadline, variables, tenant_id, physical_tenant_id, job_key, process_instance_key, process_definition_key, element_instance_key, kind, listener_event_type, user_task, tags, root_process_instance_key, business_id, priority, job_lease_token, log=NOTHING, *, client, clock)#
Bases:
JobContextContext for thread handlers — includes a sync client reference.
Extends
JobContextwith aclientattribute that provides access to the Camunda API from within a synchronous (thread) handler. Calljob.client.method(...)directly — noawaitneeded.This context is provided when the execution strategy is
"thread". For"async"handlers, seeConnectedJobContext. For"process"handlers, seeJobContext.- Parameters:
type_ (str)
process_definition_id (ProcessDefinitionId)
process_definition_version (int)
element_id (ElementId)
custom_headers (ActivatedJobResultCustomHeaders)
worker (str)
retries (int)
deadline (int)
variables (ActivatedJobResultVariables)
tenant_id (TenantId)
physical_tenant_id (str)
job_key (JobKey)
process_instance_key (ProcessInstanceKey)
process_definition_key (ProcessDefinitionKey)
element_instance_key (ElementInstanceKey)
kind (JobKindEnum)
listener_event_type (JobListenerEventTypeEnum)
user_task (ActivatedJobResultUserTask | None)
tags (list[str])
root_process_instance_key (None | ProcessInstanceKey)
business_id (None | BusinessId)
priority (int)
job_lease_token (None | JobLeaseToken)
log (SdkLogger)
client (CamundaClient)
clock (Clock)
- clock#
The worker’s clock. Call
job.clock.sleep_sync(...)rather thantime.sleep(...)so a handler that waits follows engine time when the engine’s clock is pinned, instead of stalling on the real one.For short in-handler coordination only – spacing a retry, waiting on a resource to settle. A long or business wait belongs in the process as a BPMN timer event: a handler holding a job for minutes occupies a worker slot, risks the job timeout expiring underneath it, and hides the wait from the process model where it cannot be seen or changed.
- Type:
Clock
- client: CamundaClient#
- clock: Clock#
- UnfencedFailAndErrorRetry#
Retry policy for
fail_job/throw_job_errorsent WITHOUT a job lease token after an unknown outcome (issue #501)."off"never retries them;"within-lease"retries them only until the job’s deadline minus the lease margin.alias of
Literal[‘off’, ‘within-lease’]
- class WorkerConfig(job_type, job_timeout_milliseconds=None, request_timeout_milliseconds=None, max_concurrent_jobs=None, fetch_variables=None, worker_name=None, with_lease=False, job_command_retry_unfenced_fail_and_error=None, job_command_retry_lease_margin_ms=None)#
Bases:
objectUser-facing configuration.
Fields left as
Noneinherit the global default fromCAMUNDA_WORKER_*environment variables (or the client constructor), falling back to the hardcoded SDK default when neither is set.- Parameters:
job_type (str)
job_timeout_milliseconds (int | None)
request_timeout_milliseconds (int | None)
max_concurrent_jobs (int | None)
fetch_variables (list[str] | None)
worker_name (str | None)
with_lease (bool)
job_command_retry_unfenced_fail_and_error (Literal['off', 'within-lease'] | None)
job_command_retry_lease_margin_ms (int | None)
- fetch_variables: list[str] | None = None#
- job_command_retry_lease_margin_ms: int | None = None#
With
"within-lease", retries stop at the job deadline minus this margin. Falls back toCAMUNDA_JOB_COMMAND_RETRY_LEASE_MARGIN_MS, then2000.
- job_command_retry_unfenced_fail_and_error: Literal['off', 'within-lease'] | None = None#
Whether
fail_job/throw_job_errorsent without a lease token are retried after an unknown outcome:"off"or"within-lease". Falls back toCAMUNDA_JOB_COMMAND_RETRY_UNFENCED(client config, then env), then"off".
- job_timeout_milliseconds: int | None = None#
How long the job is reserved for this worker only. Falls back to
CAMUNDA_WORKER_TIMEOUTenv var if not set.
- job_type: str#
Job type to activate and process.
- max_concurrent_jobs: int | None = None#
Max jobs executing at once. Falls back to
CAMUNDA_WORKER_MAX_CONCURRENT_JOBSenv var, then10.
- request_timeout_milliseconds: int | None = None#
Long-poll request timeout in milliseconds. Falls back to
CAMUNDA_WORKER_REQUEST_TIMEOUTenv var, then0.
- with_lease: bool = False#
Activate jobs with a lease. Each job then carries a lease token that the worker sends back on complete, fail, and throw-error, so the engine can fence the command against a superseded activation. Off by default, matching the engine. Requires a server that supports job leases: rather than degrade to unfenced commands, a worker that asked for a lease and is handed a job without a token raises
LeaseNotHonoredError.
- worker_name: str | None = None#
Worker identifier. Falls back to
CAMUNDA_WORKER_NAMEenv var, then"camunda-python-sdk-worker".
- classify_job_command_error(exc)#
Classify a job command failure:
"retry"(not applied, safe to retry),"unknown"(may have been applied, never retry),"not_found"(404) or"other"(a definite rejection or a non-transport error).- Parameters:
exc (BaseException)
- Return type:
str
- resolve_worker_config(config, configuration)#
Return a new WorkerConfig with
Nonefields filled from configuration.Precedence: explicit field value >
CAMUNDA_WORKER_*config > hardcoded default. RaisesValueErrorifjob_timeout_millisecondsis still unset after merging.- Parameters:
config (WorkerConfig)
configuration (Any)
- Return type:
Configuration Resolver#
- class CamundaSdkConfigPartial#
Bases:
TypedDict- CAMUNDA_AUTH_STRATEGY: Literal['NONE', 'OAUTH', 'BASIC']#
- CAMUNDA_BASIC_AUTH_PASSWORD: str#
- CAMUNDA_BASIC_AUTH_USERNAME: str#
- CAMUNDA_CLIENT_AUTH_CLIENTID: str#
- CAMUNDA_CLIENT_AUTH_CLIENTSECRET: str#
- CAMUNDA_CLIENT_ID: str#
- CAMUNDA_CLIENT_SECRET: str#
- CAMUNDA_HTTP_MAX_CONNECTIONS: str#
- CAMUNDA_JOB_COMMAND_RETRY_LEASE_MARGIN_MS: str#
- CAMUNDA_JOB_COMMAND_RETRY_UNFENCED: str#
- CAMUNDA_LOAD_ENVFILE: str#
- CAMUNDA_MTLS_CA: str#
- CAMUNDA_MTLS_CA_PATH: str#
- CAMUNDA_MTLS_CERT: str#
- CAMUNDA_MTLS_CERT_PATH: str#
- CAMUNDA_MTLS_KEY: str#
- CAMUNDA_MTLS_KEY_PASSPHRASE: str#
- CAMUNDA_MTLS_KEY_PATH: str#
- CAMUNDA_OAUTH_URL: str#
- CAMUNDA_REST_ADDRESS: str#
- CAMUNDA_REST_ADDRESS_EXACT: str | bool#
- CAMUNDA_SDK_BACKPRESSURE_PROFILE: str#
- CAMUNDA_SDK_LOG_LEVEL: Literal['silent', 'error', 'warn', 'info', 'debug', 'trace', 'silly']#
- CAMUNDA_TENANT_ID: str#
- CAMUNDA_TENANT_IDS: str | list[str]#
- CAMUNDA_TOKEN_AUDIENCE: str#
- CAMUNDA_TOKEN_CACHE_DIR: str#
- CAMUNDA_TOKEN_DISK_CACHE_DISABLE: str#
- CAMUNDA_USER_AGENT: str#
- CAMUNDA_WORKER_MAX_CONCURRENT_JOBS: str#
- CAMUNDA_WORKER_NAME: str#
- CAMUNDA_WORKER_REQUEST_TIMEOUT: str#
- CAMUNDA_WORKER_STARTUP_JITTER_MAX_SECONDS: str#
- CAMUNDA_WORKER_TIMEOUT: str#
- ZEEBE_REST_ADDRESS: str#
- class CamundaSdkConfiguration(*, ZEEBE_REST_ADDRESS='http://localhost:8080/v2', CAMUNDA_REST_ADDRESS='http://localhost:8080/v2', CAMUNDA_REST_ADDRESS_EXACT=False, CAMUNDA_TOKEN_AUDIENCE='zeebe.camunda.io', CAMUNDA_OAUTH_URL='https://login.cloud.camunda.io/oauth/token', CAMUNDA_CLIENT_ID=None, CAMUNDA_CLIENT_SECRET=None, CAMUNDA_CLIENT_AUTH_CLIENTID=None, CAMUNDA_CLIENT_AUTH_CLIENTSECRET=None, CAMUNDA_AUTH_STRATEGY='NONE', CAMUNDA_BASIC_AUTH_USERNAME=None, CAMUNDA_BASIC_AUTH_PASSWORD=None, CAMUNDA_SDK_LOG_LEVEL='error', CAMUNDA_TOKEN_CACHE_DIR=None, CAMUNDA_TOKEN_DISK_CACHE_DISABLE=False, CAMUNDA_SDK_BACKPRESSURE_PROFILE='BALANCED', CAMUNDA_TENANT_ID=None, CAMUNDA_TENANT_IDS=None, CAMUNDA_WORKER_TIMEOUT=None, CAMUNDA_WORKER_MAX_CONCURRENT_JOBS=None, CAMUNDA_WORKER_REQUEST_TIMEOUT=None, CAMUNDA_WORKER_NAME=None, CAMUNDA_WORKER_STARTUP_JITTER_MAX_SECONDS=None, CAMUNDA_JOB_COMMAND_RETRY_UNFENCED=None, CAMUNDA_JOB_COMMAND_RETRY_LEASE_MARGIN_MS=None, CAMUNDA_HTTP_MAX_CONNECTIONS=None, CAMUNDA_USER_AGENT=None, CAMUNDA_MTLS_CERT_PATH=None, CAMUNDA_MTLS_KEY_PATH=None, CAMUNDA_MTLS_CA_PATH=None, CAMUNDA_MTLS_CERT=None, CAMUNDA_MTLS_KEY=None, CAMUNDA_MTLS_CA=None, CAMUNDA_MTLS_KEY_PASSPHRASE=None)#
Bases:
BaseModel- Parameters:
ZEEBE_REST_ADDRESS (str)
CAMUNDA_REST_ADDRESS (str)
CAMUNDA_REST_ADDRESS_EXACT (bool)
CAMUNDA_TOKEN_AUDIENCE (str)
CAMUNDA_OAUTH_URL (str)
CAMUNDA_CLIENT_ID (str | None)
CAMUNDA_CLIENT_SECRET (str | None)
CAMUNDA_CLIENT_AUTH_CLIENTID (str | None)
CAMUNDA_CLIENT_AUTH_CLIENTSECRET (str | None)
CAMUNDA_AUTH_STRATEGY (Literal['NONE', 'OAUTH', 'BASIC'])
CAMUNDA_BASIC_AUTH_USERNAME (str | None)
CAMUNDA_BASIC_AUTH_PASSWORD (str | None)
CAMUNDA_SDK_LOG_LEVEL (Literal['silent', 'error', 'warn', 'info', 'debug', 'trace', 'silly'])
CAMUNDA_TOKEN_CACHE_DIR (str | None)
CAMUNDA_TOKEN_DISK_CACHE_DISABLE (bool)
CAMUNDA_SDK_BACKPRESSURE_PROFILE (Literal['BALANCED', 'LEGACY'])
CAMUNDA_TENANT_ID (str | None)
CAMUNDA_TENANT_IDS (list[str] | None)
CAMUNDA_WORKER_TIMEOUT (int | None)
CAMUNDA_WORKER_MAX_CONCURRENT_JOBS (int | None)
CAMUNDA_WORKER_REQUEST_TIMEOUT (int | None)
CAMUNDA_WORKER_NAME (str | None)
CAMUNDA_WORKER_STARTUP_JITTER_MAX_SECONDS (float | None)
CAMUNDA_JOB_COMMAND_RETRY_UNFENCED (Literal['off', 'within-lease'] | None)
CAMUNDA_JOB_COMMAND_RETRY_LEASE_MARGIN_MS (int | None)
CAMUNDA_HTTP_MAX_CONNECTIONS (int | None)
CAMUNDA_USER_AGENT (str | None)
CAMUNDA_MTLS_CERT_PATH (str | None)
CAMUNDA_MTLS_KEY_PATH (str | None)
CAMUNDA_MTLS_CA_PATH (str | None)
CAMUNDA_MTLS_CERT (str | None)
CAMUNDA_MTLS_KEY (str | None)
CAMUNDA_MTLS_CA (str | None)
CAMUNDA_MTLS_KEY_PASSPHRASE (str | None)
- CAMUNDA_AUTH_STRATEGY: CamundaAuthStrategy#
- CAMUNDA_BASIC_AUTH_PASSWORD: str | None#
- CAMUNDA_BASIC_AUTH_USERNAME: str | None#
- CAMUNDA_CLIENT_AUTH_CLIENTID: str | None#
- CAMUNDA_CLIENT_AUTH_CLIENTSECRET: str | None#
- CAMUNDA_CLIENT_ID: str | None#
- CAMUNDA_CLIENT_SECRET: str | None#
- CAMUNDA_HTTP_MAX_CONNECTIONS: int | None#
- CAMUNDA_JOB_COMMAND_RETRY_LEASE_MARGIN_MS: int | None#
- CAMUNDA_JOB_COMMAND_RETRY_UNFENCED: Literal['off', 'within-lease'] | None#
- CAMUNDA_MTLS_CA: str | None#
- CAMUNDA_MTLS_CA_PATH: str | None#
- CAMUNDA_MTLS_CERT: str | None#
- CAMUNDA_MTLS_CERT_PATH: str | None#
- CAMUNDA_MTLS_KEY: str | None#
- CAMUNDA_MTLS_KEY_PASSPHRASE: str | None#
- CAMUNDA_MTLS_KEY_PATH: str | None#
- CAMUNDA_OAUTH_URL: str#
- CAMUNDA_REST_ADDRESS: str#
- CAMUNDA_REST_ADDRESS_EXACT: bool#
- CAMUNDA_SDK_BACKPRESSURE_PROFILE: CamundaBackpressureProfile#
- CAMUNDA_SDK_LOG_LEVEL: CamundaSdkLogLevel#
- CAMUNDA_TENANT_ID: str | None#
- CAMUNDA_TENANT_IDS: list[str] | None#
- CAMUNDA_TOKEN_AUDIENCE: str#
- CAMUNDA_TOKEN_CACHE_DIR: str | None#
- CAMUNDA_TOKEN_DISK_CACHE_DISABLE: bool#
- CAMUNDA_USER_AGENT: str | None#
- CAMUNDA_WORKER_MAX_CONCURRENT_JOBS: int | None#
- CAMUNDA_WORKER_NAME: str | None#
- CAMUNDA_WORKER_REQUEST_TIMEOUT: int | None#
- CAMUNDA_WORKER_STARTUP_JITTER_MAX_SECONDS: float | None#
- CAMUNDA_WORKER_TIMEOUT: int | None#
- ZEEBE_REST_ADDRESS: str#
- model_config = {'extra': 'forbid'}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ConfigurationResolver(environment, explicit_configuration=None)#
Bases:
objectResolves an effective configuration from environment + explicit overrides.
- Parameters:
environment (CamundaSdkConfigPartial | Mapping[str, Any])
explicit_configuration (CamundaSdkConfigPartial | Mapping[str, Any] | None)
- resolve()#
- Return type:
- DEFAULT_TENANT_ID = '<default>'#
Tenant identifier used when no default tenant is configured. Matches the Camunda Java client’s
CommandWithTenantStep.DEFAULT_TENANT_IDENTIFIER. Tenant-scoped commands (deploy, create process instance, publish/correlate message, broadcast signal, evaluate decision/expression/conditionals) send this value — or the configuredCAMUNDA_TENANT_ID— when the caller does not pass a tenant.activate_jobssends[DEFAULT_TENANT_ID]likewise.
- class ResolvedCamundaSdkConfiguration(effective: 'CamundaSdkConfiguration', environment: 'CamundaSdkConfigPartial', explicit: 'CamundaSdkConfigPartial | None')#
Bases:
object- Parameters:
effective (CamundaSdkConfiguration)
environment (CamundaSdkConfigPartial)
explicit (CamundaSdkConfigPartial | None)
- effective: CamundaSdkConfiguration#
- environment: CamundaSdkConfigPartial#
- explicit: CamundaSdkConfigPartial | None#
- SECRET_CONFIG_KEYS: frozenset[str] = frozenset({'CAMUNDA_BASIC_AUTH_PASSWORD', 'CAMUNDA_CLIENT_AUTH_CLIENTSECRET', 'CAMUNDA_CLIENT_SECRET', 'CAMUNDA_MTLS_KEY', 'CAMUNDA_MTLS_KEY_PASSPHRASE'})#
Configuration keys whose value is a credential. Configuration errors fire at client construction, so their messages land in application logs and crash reporters; these values are replaced with a placeholder before any error text is built from them.
- read_environment(environ=None)#
- Parameters:
environ (Mapping[str, str] | None)
- Return type: