Version v1.x

First Job Example

Available in

.NET Node.js Python

Detailed first-job walkthrough including attribute options and enqueue versus schedule behavior.

This walkthrough shows a realistic first job, all options in both job attributes, and why DurableStack separates enqueue metadata from recurring schedule metadata.

Example job

Why there are two attributes

DurableJob defines execution behavior

  • Name: stable job identity used for registration and operations.
  • MaxAttempts: total attempts including initial execution.
  • RetryBehavior: FixedDelay or Backoff.
  • RetryInitialDelaySeconds: per-job retry baseline.

This attribute defines what happens when a run executes and fails.

RecurringJob defines schedule behavior

  • Cron: schedule cadence.
  • TimeZone: IANA timezone used for cron evaluation.
  • Enabled: whether schedule emits new runs.
  • AllowConcurrentRuns: whether overlapping scheduled runs are allowed.

This attribute defines whether and how new runs are created over time.

Enqueue versus schedule

  • Enqueue creates one run immediately.
  • Recurring schedule materializes runs automatically when cron slots are due.
  • A job can be enqueue-only (no RecurringJob) or recurring (both attributes).

Enqueue the same job manually

With this route plus [RecurringJob], the same handler supports both:

  • automatic recurring execution
  • manual run-now execution

Practical guidance

  • Keep DurableJob.Name stable after production adoption.
  • Use AllowConcurrentRuns = false for jobs that mutate shared resources.
  • Prefer RetryBehavior.Backoff for third-party API dependencies.
  • Keep handlers idempotent so retries are safe.

Next step

After this page, review Getting Started for the recommended runtime configuration baseline.