Skip to content

[WF] Add logic to dispatch scheduled workflows#12007

Open
maggie-lou wants to merge 2 commits intomasterfrom
dispatch_scheduled
Open

[WF] Add logic to dispatch scheduled workflows#12007
maggie-lou wants to merge 2 commits intomasterfrom
dispatch_scheduled

Conversation

@maggie-lou
Copy link
Copy Markdown
Collaborator

No description provided.

@maggie-lou maggie-lou force-pushed the dispatch_scheduled branch 2 times, most recently from 3115e86 to f5307a1 Compare April 27, 2026 16:31
@maggie-lou maggie-lou marked this pull request as ready for review April 27, 2026 17:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds server-side support for dispatching workflows on a cron-like schedule by introducing a ScheduledRun table and a WorkflowService entrypoint to claim + dispatch due runs.

Changes:

  • Register ScheduledRun as a DB table and expose RunScheduledWorkflows() on WorkflowService.
  • Implement scheduled-run claiming/leasing, dispatch, and next-run calculation logic in the workflow service.
  • Add tests for scheduled workflow dispatching, including a concurrent-scheduler scenario, and add new cron/time dependencies.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
server/tables/tables.go Registers the ScheduledRun table type for DB migrations/registration.
server/interfaces/interfaces.go Extends WorkflowService with RunScheduledWorkflows(ctx) API.
enterprise/server/workflow/service/service.go Implements scheduled workflow claiming, leasing, dispatch, and cron-based next-run computation.
enterprise/server/workflow/service/service_test.go Adds tests covering scheduling behavior and multi-server concurrency.
go.mod / go.sum Adds github.com/robfig/cron/v3 dependency.
enterprise/server/workflow/service/BUILD Wires new Go deps (cron, clockwork) into Bazel targets.
deps/go_deps.MODULE.bazel Adds Bazel module repo for robfig/cron/v3.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread server/tables/tables.go Outdated
Comment thread deps/go_deps.MODULE.bazel Outdated
Comment thread enterprise/server/workflow/service/service.go Outdated
Comment thread enterprise/server/workflow/service/service.go
Comment thread enterprise/server/workflow/service/service.go Outdated
Comment thread enterprise/server/workflow/service/service.go Outdated
Base automatically changed from cron_table to master April 29, 2026 16:30
@maggie-lou maggie-lou marked this pull request as draft April 29, 2026 17:00
@maggie-lou maggie-lou force-pushed the dispatch_scheduled branch 5 times, most recently from dfab8a6 to e3d0935 Compare April 29, 2026 21:11
@maggie-lou maggie-lou marked this pull request as ready for review April 29, 2026 21:11
@maggie-lou maggie-lou requested a review from Copilot April 29, 2026 21:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread enterprise/server/workflow/service/service.go
Comment thread enterprise/server/workflow/service/service.go Outdated
Comment thread enterprise/server/workflow/service/service.go
Comment thread enterprise/server/workflow/service/service.go Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants