Version v1.x

Getting Started

Available in

.NET Node.js Python

Detailed setup with explicit configuration and the most common runtime options.

This guide expands on Quick Start and focuses on the most common production options.

Examples are shown for both .NET and Node.js.

Most teams can rely on defaults for many options. This example sets them explicitly so the behavior is easy to understand.

Option groups that matter most

Worker and throughput

  • WorkerName (default: "{HOSTNAME-or-machine}-{processId}"): unique identity used for lease ownership and diagnostics.
  • PollIntervalSeconds (default: 5): how often workers check for available runs.
  • BatchSize (default: 50): maximum runs claimed per poll cycle.
  • MaxConcurrentRuns (default: 5): concurrency limit per worker instance.
  • LeaseDurationSeconds (default: 30): ownership timeout before another worker can recover a stalled run.

Retry behavior

  • RetryDelay (default: 00:00:05): baseline delay between attempts.
  • RetryMaxDelay (default: 01:00:00): cap for backoff growth.
  • RetryJitterEnabled (default: false) and RetryJitterRatio (default: 0.2): spread retry pressure across time.

Recurring behavior

  • Recurring.CatchUpPolicy (default: SkipMissed): avoids large catch-up bursts after downtime.
  • ExistingJobBehavior (default: KeepDatabase): keeps existing schedule definitions stable by default.
  • OrphanedJobBehavior (default: Disable): safely disables schedules removed from code.

Retention

  • Retention.Enabled (default: true): enables cleanup for terminal runs.
  • RunRetentionSeconds (default: null, effective 86400 for durable DB providers and 3600 for in-memory): how long completed/failed runs remain queryable.
  • SweepIntervalSeconds (default: 300) and DeleteBatchSize (default: 1000): cleanup cadence and batch sizing.

Optional hosted observability

  • Eventing.TenantId (default: null) and Eventing.ClientSecret (default: null): enable ingestion when both are set.

Defaults-first guidance

In most projects, you only need to set:

  • provider selection and connection string
  • optional WorkerName convention
  • any non-default values that match your workload goals

Everything else can stay at defaults until you have data that justifies tuning.

What to tune first in production

  • Increase MaxConcurrentRuns and BatchSize carefully as workload grows.
  • Keep LeaseDurationSeconds longer than normal job execution for your slowest routine jobs.
  • Use retry jitter to reduce synchronized retries during external outages.
  • Set retention windows based on audit/debug needs and database cost profile.

Full options reference

The full option list is runtime-specific. Use the .NET reference below for ASP.NET-style configuration and runtime APIs, and use the Node.js package reference (durablestack-nodejs/README.md) for Node option and method names.

Store helper methods

Use one of these helpers inside the same AddDurableStack callback when you prefer method-based store selection.

Notes

  • Setting both PollInterval and PollIntervalSeconds is redundant; use one style.
  • Setting both LeaseDuration and LeaseDurationSeconds is redundant; use one style.
  • Setting both Eventing.IngestionFlushInterval and Eventing.IngestionFlushIntervalSeconds is redundant; use one style.
  • Event ingestion is automatically enabled when both Eventing.TenantId and Eventing.ClientSecret are set.