Make the first event added to a workflow its startup task (#16344) - #19896
Open
RAJEEV2510 wants to merge 3 commits into
Open
RAJEEV2510 wants to merge 3 commits into
RAJEEV2510 wants to merge 3 commits into
Conversation
RAJEEV2510
force-pushed
the
feature/16344-workflow-default-startup-task
branch
from
September 16, 2026 18:09
dd81b81 to
7b51997
Compare
…#16344) A workflow never runs without a startup task, and it's easy to forget to set one. Adding the first event to a workflow now marks it as the startup task automatically. Saving a workflow that has activities but no startup task shows a warning, and the workflow list shows a "No startup task" badge.
RAJEEV2510
force-pushed
the
feature/16344-workflow-default-startup-task
branch
from
September 16, 2026 18:10
7b51997 to
3849518
Compare
Contributor
Author
|
@Piedone @MikeAlhayek @gvkries, could you please review this when you have a moment? It adds both parts agreed on in #16344 (and #18220): the first event becomes the startup task automatically, and there's a warning plus a list badge when a workflow has no startup task. CI is green and the branch has no conflicts. Thanks! |
gvkries
reviewed
Sep 17, 2026
Adds a HasStartActivity extension, reuses it from IsMissingStartActivity, and uses it when adding an activity so the activity library lookup is no longer needed.
gvkries
approved these changes
Sep 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #16344
Background
A workflow only runs if one of its events is marked as the startup task. With a single event it's obvious which one that is, but you still have to set it by hand, and forgetting it leaves the workflow silently doing nothing (see also #18220, closed in favor of this issue). The issue discussion agreed on both an automatic default and a warning.
Change
ActivityController.Create): when an event is added and the workflow has no other events, the new activity is saved withIsStart = true. You can still turn it off with the existing start toggle. Tasks and later events are unaffected.WorkflowTypeController.EditPOST): if the saved workflow has activities but no startup task, a warning notification is shown next to "Workflow has been saved."WorkflowTypeExtensions.IsMissingStartActivity()(Workflows.Abstractions): a single check shared by the save warning and the list badge, with unit tests.Views/WorkflowType/Index.cshtml): workflows with activities but no startup task get a "No startup task" badge next to the existing "Disabled" badge.The editor keeps unsaved canvas changes in session storage. A newly added activity is taken from the server when the editor reloads, so its start flag shows up right away without any client-side script changes.
Testing
OrchardCore.Workflowsbuilds with no warnings or errors (.NET SDK 10.0.401).