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
| Property | Type | Description |
|---|---|---|
Config | Dictionary<String, String> | Strongly typed env-style overrides (CAMUNDA_* keys). |
Configuration | IConfiguration | An 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. |
HttpClient | HttpClient | Custom HttpClient factory. If not provided, a default HttpClient is created. |
HttpMessageHandler | HttpMessageHandler | Custom HttpMessageHandler for the internal HttpClient (ignored if HttpClient is set). Useful for tests (e.g., MockHttpMessageHandler). |
Env | Dictionary<String, String> | Provide a custom env map (mainly for tests). Defaults to Environment.GetEnvironmentVariable. |
LoggerFactory | ILoggerFactory | Logger factory for SDK logging. |
CamundaConfig
Hydrated Camunda configuration. Immutable after construction.
public sealed class CamundaConfig
Properties
| Property | Type | Description |
|---|---|---|
RestAddress | String | |
TokenAudience | String | |
DefaultTenantId | String | |
HttpRetry | HttpRetryConfig | |
Backpressure | BackpressureConfig | |
OAuth | OAuthConfig | |
Auth | AuthConfig | |
Validation | ValidationConfig | |
LogLevel | String | |
Eventual | EventualConfig | |
WorkerDefaults | WorkerDefaultsConfig | |
Tls | TlsConfig |
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
| Property | Type | Description |
|---|---|---|
Strategy | AuthStrategy | |
Basic | BasicAuthConfig |
AuthStrategy
Supported authentication strategies.
public enum AuthStrategy
| Value | Description |
|---|---|
None | |
OAuth | |
Basic |
BasicAuthConfig
public sealed class BasicAuthConfig
Properties
| Property | Type | Description |
|---|---|---|
Username | String | |
Password | String |
OAuthConfig
public sealed class OAuthConfig
Properties
| Property | Type | Description |
|---|---|---|
ClientId | String | |
ClientSecret | String | |
OAuthUrl | String | |
GrantType | String | |
Scope | String | |
TimeoutMs | Int32 | |
Retry | OAuthRetryConfig |
OAuthRetryConfig
public sealed class OAuthRetryConfig
Properties
| Property | Type | Description |
|---|---|---|
Max | Int32 | |
BaseDelayMs | Int32 |
HttpRetryConfig
public sealed class HttpRetryConfig
Properties
| Property | Type | Description |
|---|---|---|
MaxAttempts | Int32 | |
BaseDelayMs | Int32 | |
MaxDelayMs | Int32 |
BackpressureConfig
public sealed class BackpressureConfig
Properties
| Property | Type | Description |
|---|---|---|
Enabled | Boolean | |
Profile | String | |
ObserveOnly | Boolean | |
InitialMax | Int32 | |
SoftFactor | Double | |
SevereFactor | Double | |
RecoveryIntervalMs | Int32 | |
RecoveryStep | Int32 | |
DecayQuietMs | Int32 | |
Floor | Int32 | |
SevereThreshold | Int32 |
EventualConfig
public sealed class EventualConfig
Properties
| Property | Type | Description |
|---|---|---|
PollDefaultMs | Int32 |
ValidationConfig
public sealed class ValidationConfig
Properties
| Property | Type | Description |
|---|---|---|
Request | ValidationMode | |
Response | ValidationMode | |
Raw | String |
ValidationMode
Validation modes for request/response validation.
public enum ValidationMode
| Value | Description |
|---|---|
None | |
Warn | |
Strict | |
Fanatical |
JobWorkerConfig
Configuration for a JobWorker.
public sealed class JobWorkerConfig
Properties
| Property | Type | Description |
|---|---|---|
JobType | String | The BPMN job type to subscribe to (e.g. "payment-service"). |
JobTimeoutMs | Nullable<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. |
MaxConcurrentJobs | Nullable<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. |
PollIntervalMs | Int32 | Delay (in ms) between poll cycles when no jobs are available or when at capacity. Default: 500 ms. |
PollTimeoutMs | Nullable<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. |
FetchVariables | List<String> | Variable names to fetch from the process instance scope. null = fetch all. |
WorkerName | String | Worker name sent to the broker for logging and diagnostics. Auto-generated if not set. |
AutoStart | Boolean | Whether to start polling immediately on creation. Default: true. |
StartupJitterMaxSeconds | Double | Maximum 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. |
TenantIds | IReadOnlyList<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.DefaultTenantId] (which itself defaults to "" and can be overridden via the CAMUNDA_DEFAULT_TENANT_ID environment variable). |
TenantId | String | Convenience for the common single-tenant case. Equivalent to setting JobWorkerConfig.TenantIds to [TenantId]. Cannot be combined with JobWorkerConfig.TenantIds. |
ConfigErrorCode
Configuration hydration errors.
public enum ConfigErrorCode
| Value | Description |
|---|---|
MissingRequired | |
InvalidEnum | |
InvalidBoolean | |
InvalidInteger | |
InvalidValidationSyntax |
ConfigErrorDetail
public sealed class ConfigErrorDetail
Properties
| Property | Type | Description |
|---|---|---|
Key | String | |
Code | ConfigErrorCode | |
Message | String |