Skip to content

Generalize workflow system. #1061

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jul 18, 2025
Merged

Generalize workflow system. #1061

merged 10 commits into from
Jul 18, 2025

Conversation

apognu
Copy link
Contributor

@apognu apognu commented Jun 21, 2025

This PR improves the decision workflow feature to make it more expandable and useful. It allows the user to create an ordered series of rules on a scenario, of which the first one which conditions all evaluate to true will execute all actions.

This first version does not implement any further actions than those that were already there, so we have CREATE_CASE and ADD_TO_CASE_IF_POSSIBLE and three conditions, always, never and outcome_in.

So far, it only implement actual executions, not the management API or any kind of validation for the conditions and actions.


Outstanding TODOs:

  • Backfill stable IDs for all iteration rules
  • Do proper error handling and logging for workflow rules

@apognu apognu self-assigned this Jun 21, 2025
@apognu apognu added enhancement New feature or request WIP go Pull requests that update Go code labels Jun 21, 2025
@apognu apognu force-pushed the feat/advanced-workflows branch 3 times, most recently from 14ea632 to e7162c8 Compare June 21, 2025 13:49
@apognu
Copy link
Contributor Author

apognu commented Jun 21, 2025

We need the migration to convert the old column-based workflows into the new system. Luckily, it should be quite straightforward side there weren't lots of options.

@apognu apognu force-pushed the feat/advanced-workflows branch 2 times, most recently from f6000c8 to 4fac571 Compare June 21, 2025 20:23
@apognu
Copy link
Contributor Author

apognu commented Jun 23, 2025

FYI @siiick @Pascal-Delange.

@apognu apognu force-pushed the feat/advanced-workflows branch 3 times, most recently from 88fc4ef to 786c597 Compare June 23, 2025 09:14
@apognu apognu force-pushed the feat/advanced-workflows branch 5 times, most recently from 86440db to 214dc58 Compare June 24, 2025 13:44
Copy link
Contributor

@Pascal-Delange Pascal-Delange left a comment

Choose a reason for hiding this comment

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

first review done !

"github.com/google/uuid"
)

type Workflow struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

pure naming thing but to be in line with my understanding of what we want to call them, how about workflow=>workflowRule and workflowRule=>workflowRuleMetadata in this file ?

@apognu apognu force-pushed the feat/advanced-workflows branch 2 times, most recently from 0f6c919 to 1351cbe Compare June 25, 2025 13:35
@apognu apognu force-pushed the feat/advanced-workflows branch 2 times, most recently from fc47410 to 93f037e Compare July 8, 2025 07:31
@siiick siiick force-pushed the feat/advanced-workflows branch from 93f037e to a0970b0 Compare July 15, 2025 08:55
apognu added 6 commits July 18, 2025 15:37
Before this commit, workflows would only perform the actions listed under the first matching rule.

While this is still the default, a new option on a rule, `fallthrough`, allows defining that workflow evaluation should continue even if this rules matches.
All the actions of of the matching rules up until the first failing or not-fallthrough rule will be executed, in order.

As we can only add a decision to a case once, only the first action of this kind will be executed, the other ones will be noops.
@apognu apognu force-pushed the feat/advanced-workflows branch from 1b06474 to 01080c3 Compare July 18, 2025 13:39
@apognu apognu marked this pull request as ready for review July 18, 2025 13:43
@apognu apognu merged commit bfb9266 into main Jul 18, 2025
4 checks passed
@apognu apognu deleted the feat/advanced-workflows branch July 18, 2025 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request go Pull requests that update Go code WIP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants