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

Configuration

Configuration and authentication types for the Camunda C# SDK.

CamundaOptions​

Options for constructing a CamundaClient.

Mirrors the JS SDK's CamundaOptions with idiomatic C# conventions.

public sealed class CamundaOptions

Properties​

PropertyTypeDescription
ConfigDictionary<String, String>Strongly typed env-style overrides (CAMUNDA_* keys).
ConfigurationIConfigurationAn Configuration.IConfiguration section (typically configuration.GetSection("Camunda")) to bind settings from appsettings.json or any other configuration provider. Keys use PascalCase property names (e.g. RestAddress, Auth:Strategy) and are mapped to the canonical CAMUNDA_* env-var names internally. Precedence (highest wins): CamundaOptions.Config > CamundaOptions.Configuration > environment variables > defaults.
HttpClientHttpClientCustom HttpClient factory. If not provided, a default HttpClient is created.
HttpMessageHandlerHttpMessageHandlerCustom HttpMessageHandler for the internal HttpClient (ignored if HttpClient is set). Useful for tests (e.g., MockHttpMessageHandler).
EnvDictionary<String, String>Provide a custom env map (mainly for tests). Defaults to Environment.GetEnvironmentVariable.
LoggerFactoryILoggerFactoryLogger factory for SDK logging.
TimeProviderTimeProviderClock used for all SDK runtime cadence: worker poll loops, eventual consistency polling, retry backoff, backpressure decay, and OAuth refresh. Defaults to CamundaTimeProvider.Live — the system clock, clamped so it cannot move backwards. Supply a FakeTimeProvider to make the client's own timing virtual in tests. Note that this pins the client clock only; pinning the engine clock is a separate, explicit step via PinClockAsync.

CamundaConfig​

Hydrated Camunda configuration. Immutable after construction.

public sealed class CamundaConfig

Properties​

PropertyTypeDescription
RestAddressString
TokenAudienceString
DefaultTenantIdString
TenantIdsIReadOnlyList<String>Tenant ids job workers activate for, from CAMUNDA_TENANT_IDS (comma-separated) or the TenantIds configuration path. null when unset, in which case activation falls back to CamundaConfig.DefaultTenantId.
HttpRetryHttpRetryConfig
BackpressureBackpressureConfig
OAuthOAuthConfig
AuthAuthConfig
ValidationValidationConfig
LogLevelString
EventualEventualConfig
WorkerDefaultsWorkerDefaultsConfig
TlsTlsConfig

ConfigurationHydrator​

Hydrates a CamundaConfig from environment variables and overrides. Mirrors the JS SDK's hydrateConfig function.

public static class ConfigurationHydrator

AuthConfig​

public sealed class AuthConfig

Properties​

PropertyTypeDescription
StrategyAuthStrategy
BasicBasicAuthConfig

AuthStrategy​

Supported authentication strategies.

public enum AuthStrategy
ValueDescription
None
OAuth
Basic

BasicAuthConfig​

public sealed class BasicAuthConfig

Properties​

PropertyTypeDescription
UsernameString
PasswordString

OAuthConfig​

public sealed class OAuthConfig

Properties​

PropertyTypeDescription
ClientIdString
ClientSecretString
OAuthUrlString
GrantTypeString
ScopeString
TimeoutMsInt32
RetryOAuthRetryConfig

OAuthRetryConfig​

public sealed class OAuthRetryConfig

Properties​

PropertyTypeDescription
MaxInt32
BaseDelayMsInt32

HttpRetryConfig​

public sealed class HttpRetryConfig

Properties​

PropertyTypeDescription
MaxAttemptsInt32
BaseDelayMsInt32
MaxDelayMsInt32

BackpressureConfig​

public sealed class BackpressureConfig

Properties​

PropertyTypeDescription
EnabledBoolean
ProfileString
ObserveOnlyBoolean
InitialMaxInt32
SoftFactorDouble
SevereFactorDouble
RecoveryIntervalMsInt32
RecoveryStepInt32
DecayQuietMsInt32
FloorInt32
SevereThresholdInt32

EventualConfig​

public sealed class EventualConfig

Properties​

PropertyTypeDescription
PollDefaultMsInt32

ValidationConfig​

public sealed class ValidationConfig

Properties​

PropertyTypeDescription
RequestValidationMode
ResponseValidationMode
RawString

ValidationMode​

Validation modes for request/response validation.

public enum ValidationMode
ValueDescription
None
Warn
Strict
Fanatical

JobWorkerConfig​

Configuration for a JobWorker.

public sealed class JobWorkerConfig

Properties​

PropertyTypeDescription
JobTypeStringThe BPMN job type to subscribe to (e.g. "payment-service").
JobTimeoutMsNullable<Int64>How long (in ms) the job is reserved for this worker before the broker makes it available to other workers. Falls back to CAMUNDA_WORKER_TIMEOUT environment variable.
MaxConcurrentJobsNullable<Int32>Maximum number of jobs that may be in-flight (activated and being handled) concurrently by this worker. Controls how many jobs are requested per poll and how many handler tasks run in parallel. For I/O-bound handlers (HTTP calls, database queries), higher values (32–128) improve throughput because async handlers release threads during awaits. For CPU-bound handlers, set to Environment.ProcessorCount or lower to avoid over-subscribing the thread pool. Set to 1 for sequential (single-job-at-a-time) processing. Falls back to CAMUNDA_WORKER_MAX_CONCURRENT_JOBS environment variable, then 10.
PollIntervalMsInt32Delay (in ms) between poll cycles when no jobs are available or when at capacity. Default: 500 ms.
PollTimeoutMsNullable<Int64>Long-poll timeout (in ms) sent to the broker. The broker holds the activation request open until jobs are available or this timeout elapses. null or 0 = broker default; negative = long polling disabled.
FetchVariablesList<String>Variable names to fetch from the process instance scope. null = fetch all.
WorkerNameStringWorker name sent to the broker for logging and diagnostics. Auto-generated if not set.
AutoStartBooleanWhether to start polling immediately on creation. Default: true.
StartupJitterMaxSecondsDoubleMaximum random delay (in seconds) before the worker starts polling. When multiple application instances restart simultaneously, this spreads out initial activation requests to avoid saturating the server. 0 (the default) means no delay.
TenantIdsIReadOnlyList<String>Restrict job activation to the given tenant IDs (multi-tenant setups). Cannot be combined with JobWorkerConfig.TenantId — setting both is rejected with ArgumentException. If neither JobWorkerConfig.TenantIds nor JobWorkerConfig.TenantId is set (or JobWorkerConfig.TenantIds is empty), the activation request falls back to CamundaConfig.TenantIds (from the CAMUNDA_TENANT_IDS environment variable, comma-separated), then to [CamundaConfig.DefaultTenantId] (which itself defaults to "" and can be overridden via the CAMUNDA_DEFAULT_TENANT_ID environment variable).
TenantIdStringConvenience for the common single-tenant case. Equivalent to setting JobWorkerConfig.TenantIds to [TenantId]. Cannot be combined with JobWorkerConfig.TenantIds.
TenantFilterNullable<TenantFilterEnum>Tenant filtering strategy for job activation. TenantFilterEnum.PROVIDED (the server default when this is null) activates jobs for the tenants named in JobWorkerConfig.TenantIds / JobWorkerConfig.TenantId, falling back to the default tenant. TenantFilterEnum.ASSIGNED activates jobs for whichever tenants are currently assigned to the authenticated client, re-evaluated by the server on every activation request — so tenant assignment changes take effect without restarting the worker. No tenant IDs are sent, and JobWorkerConfig.TenantIds / JobWorkerConfig.TenantId must not be set (the server would silently ignore them). Requires multi-tenancy to be enabled on the cluster; otherwise the server rejects the activation request with HTTP 400. Requires Camunda 8.9 or later.
WithLeaseBooleanActivate 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 (for example after the job timed out and another worker picked it up). Off by default, matching the engine. Requires a server that returns lease tokens: rather than degrade to unfenced commands, a worker that asked for a lease and is handed a job whose token is missing or invalid stops with LeaseNotHonoredException, surfaced through CamundaClient.RunWorkersAsync.

ConfigErrorCode​

Configuration hydration errors.

public enum ConfigErrorCode
ValueDescription
MissingRequired
InvalidEnum
InvalidBoolean
InvalidInteger
InvalidValidationSyntax

ConfigErrorDetail​

public sealed class ConfigErrorDetail

Properties​

PropertyTypeDescription
KeyString
CodeConfigErrorCode
MessageString