Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Distributed Recurring Workflow Scheduler

Design an Airflow-like service that materializes recurring DAG runs, dispatches ready tasks, and recovers safely from failures.

Problem statement

For this exercise, assume a multi-tenant workflow platform where an authorized user defines a versioned directed acyclic graph of tasks, assigns it a cron schedule, pauses or resumes future runs, and inspects each workflow run and task attempt.

At every due schedule time, the platform should create one logical run for the selected workflow version, release tasks only after their dependencies succeed, retry eligible failures, and preserve one authoritative terminal outcome despite duplicate delivery or stale workers.

Users may cancel a run or manually trigger a run from a chosen workflow version. A task may call an external system, so the scheduler must not claim impossible exactly-once business effects.

Treat arbitrary cyclic workflows, sub-second schedules, interactive notebook execution, task code packaging, and cross-region active-active scheduling as outside the first version.

What to build

  1. An authorized user can create an immutable workflow version containing a valid task DAG and cron schedule, activate that version for future runs, and pause or resume scheduling.
  2. For each due schedule occurrence, the platform creates at most one logical workflow run for the active version and makes it observable even if scheduling work is retried.
  3. The platform dispatches ready tasks only after required predecessors succeed, records attempts, and applies bounded retry and terminal-failure policy.
  4. A user can inspect run and task status, cancel a non-terminal run, and manually trigger a run from a selected immutable workflow version.

At scale

  • For this exercise, assume 200,000 active workflow schedules and peaks of 50,000 due workflow runs per minute, with up to 100 tasks in one DAG.
  • For this exercise, assume peaks of 500,000 task starts per minute and a normal target of materializing and beginning eligible work within 30 seconds of its due time.
  • For this exercise, assume run and task delivery is at least once; stable run, task, and attempt identities plus leases or fencing must prevent stale attempts from changing authoritative state.
  • For this exercise, assume acknowledged definitions and run state survive a process or single-zone failure, retain run metadata for 30 days, and retain task logs or artifact references for 7 days.