Skip to content

Select steps by exact ids, prefixes, infixes and suffixes, drop the regex - #237

Merged
akashdw merged 5 commits into
mainfrom
ad/step-selection-ids-and-pattern-validation
Aug 25, 2026
Merged

akashdw merged 5 commits into
mainfrom
ad/step-selection-ids-and-pattern-validation

Conversation

@akashdw

@akashdw akashdw commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Pull Request type

  • Bugfix
  • Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes (Please run ./gradlew build --write-locks to refresh dependencies)
  • Other (please describe):

Changes in this PR

Follow up to #236.

include and exclude each take four criteria now:

"step_selection": {
  "include": {"step_ids": ["load_users", "transform"], "step_id_prefixes": ["load_"]},
  "exclude": {"step_id_infixes": ["region"], "step_id_suffixes": ["_child"]}
}

step_ids matches the whole step id. step_id_prefixes, step_id_infixes and step_id_suffixes match the start, the middle and the end. A step matches when any one criterion hits. exclude still beats include.

This drops regex support, because a user regex can hang the engine thread that evaluates it.

Excluding a foreach step skips the whole loop and starts no iterations. Excluding a step inside the loop skips it in every iteration, because the inline workflow keeps the same step ids.

include and exclude are optional, but each one that is set needs at least one value, and no value can be blank. These return 400:

{}                                        Step selection must set include or exclude or both
{"include": {}}                           include must set at least one step id, prefix, infix or suffix
{"include": {"step_ids": []}}             include must set at least one step id, prefix, infix or suffix
{"include": {"step_id_prefixes": [""]}}   stepSelection.include.stepIdPrefixes[] must not be blank

A restart that sends no step_selection keeps the selection of the run it restarts. A restart that sends one replaces it.

The instance timeline names the selection once, and each skipped step names the criterion that skipped it:

Run excludes steps matching ids [report_child, report_region].
Step is skipped because it matches the excluded ids [report_child, report_region].
Step is skipped because it does not match the included prefixes [load_].

Foreach inline workflows and subworkflows get the same lines.

step_ids is not checked against the workflow definition, because a subworkflow resolves its definition at runtime from the subworkflow_id param.

Verified on a local server across 59 cases, checking step statuses and exact timeline text on the parent workflow, both foreach iterations and the child workflow, plus a restart instance with three runs.

@akashdw akashdw changed the title Add exact step ids to step selection and validate the pattern up front Select steps by exact ids, prefixes, infixes and postfixes Aug 24, 2026
@akashdw akashdw changed the title Select steps by exact ids, prefixes, infixes and postfixes Drop the step id regex, select steps by exact ids, prefixes, infixes and postfixes Aug 24, 2026
@akashdw akashdw changed the title Drop the step id regex, select steps by exact ids, prefixes, infixes and postfixes Select steps by exact ids, prefixes, infixes and postfixes, drop the regex Aug 24, 2026
@akashdw akashdw changed the title Select steps by exact ids, prefixes, infixes and postfixes, drop the regex Select steps by exact ids, prefixes, infixes and suffixes, drop the regex Aug 24, 2026

@praneethy91 praneethy91 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, thanks for the simplification and removing regexes

@akashdw
akashdw merged commit 7250c66 into main Aug 25, 2026
1 check passed
@akashdw
akashdw deleted the ad/step-selection-ids-and-pattern-validation branch August 25, 2026 00:55
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.

3 participants