Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Bug][API] Switching workflow versions leaves schedules online

Open Beginner friendly
#18,731 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@zhuangchong is already working on this.

Since Oct 23, 2026.

  • #18732 by @zhuangchong — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java
Domain
backend

Research direction

Start with WorkflowDefinitionServiceImpl.switchWorkflowDefinitionVersion and compare it with WorkflowDefinitionServiceImpl.offlineWorkflowDefinition. Inspect ProcessServiceImpl.switchVersion to confirm why the schedule remains online, then reuse schedulerService.offlineSchedulerByWorkflowCode after a successful version switch. Verify through the workflow version-switch API that the workflow, schedule, and Quartz job become offline or are removed immediately.

Written by the indexing model from the issue text.

Description

Search before asking
  • I searched the existing issues and did not find an issue describing this behavior.
What happened

Switching an online workflow to another definition version marks the workflow definition as OFFLINE, but leaves its schedule ONLINE and its Quartz job registered.

This differs from the normal workflow offline action, which immediately offlines the associated schedule and removes its Quartz job. With version switching, schedule cleanup is delayed until the next scheduled trigger detects that the workflow is offline.

What you expected to happen

Switching workflow definition versions should offline the associated schedule and remove its Quartz job immediately, just like the normal workflow offline action. It should not wait for the next scheduled trigger.

How to reproduce
  1. Create a workflow with at least two definition versions.
  2. Publish the workflow and enable its schedule, with the next trigger sufficiently far in the future.
  3. Open the workflow version list and switch to a different version, or call the workflow version-switch API.
  4. Observe that the workflow is OFFLINE, while its schedule remains ONLINE and its Quartz job still exists.
  5. At the next scheduled trigger, the schedule task detects the offline workflow and cleans up the schedule.
Root cause

WorkflowDefinitionServiceImpl.switchWorkflowDefinitionVersion delegates to ProcessServiceImpl.switchVersion. The latter writes the target workflow version with ReleaseState.OFFLINE, but does not offline its schedule.

By contrast, WorkflowDefinitionServiceImpl.offlineWorkflowDefinition calls schedulerService.offlineSchedulerByWorkflowCode, which updates the schedule state and removes its Quartz job.

Suggested fix

After switching the workflow version successfully, call the existing offlineSchedulerByWorkflowCode method from the API service. Reuse the existing behavior for workflows without schedules and for schedules that are already offline.

Version

Current dev branch, inspected at commit 751ed0352.

Are you willing to submit a PR?
  • Yes, I am willing to submit a PR.
Dominant language
Java
Stars
14.5k
Forks
5.1k
Avg merge
2d 10h
Merged PRs (30d)
22

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/dolphinscheduler

All issues in apache/dolphinscheduler

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.