Skip to content
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

feat(core): restarting Subflow #6571

Merged
merged 1 commit into from
Jan 7, 2025
Merged

feat(core): restarting Subflow #6571

merged 1 commit into from
Jan 7, 2025

Conversation

loicmathieu
Copy link
Member

@loicmathieu loicmathieu commented Dec 24, 2024

When restarting an execution, each Subflow and ForEachItem tasks will restart failing subflow executions instead of creating a new one. This behavior is manageable via the new restartBehavior property, configuring to NEW_EXECUTION will create new executions as before. If the subflow executions was in SUCCESS, it will not be restarted nor a new execution will be created, this is important for ForEachItem.

Fixes https://github.com/kestra-io/kestra-ee/issues/1399

Two changes:

  • When restarting an execution, a system label is added so we know from the Subflow or ForEachItem task that we need to restart the child execution: system.restarted: true.
  • Inside the subflow execution, the execution trigger variables have been enhanced with taskRun ID and taskRun value and taskRun iteration so we can find the correct execution to restart in case the Subflow is inside a ForEach
    image

@loicmathieu loicmathieu force-pushed the feat/restart-subflow branch 2 times, most recently from 4829ba5 to e5441f0 Compare January 6, 2025 14:22
@loicmathieu loicmathieu force-pushed the feat/restart-subflow branch from a824232 to 990de46 Compare January 7, 2025 09:30
@loicmathieu loicmathieu added the kind/breaking-change Code modifications needed before upgrading label Jan 7, 2025
@loicmathieu
Copy link
Member Author

Breaking Change

When restarting an execution, Subflowor ForEachItem tasks will restart the existing failed subflow instead of creating new ones.
This behavior is manageable via a new restartBehavior property, configure it to NEW_EXECUTION to go back to the previous behavior of creating new subflow executions on restart.

@loicmathieu loicmathieu marked this pull request as ready for review January 7, 2025 09:36
@loicmathieu loicmathieu force-pushed the feat/restart-subflow branch from 990de46 to 2c9b784 Compare January 7, 2025 09:52
@loicmathieu loicmathieu merged commit 1e36d1e into develop Jan 7, 2025
7 of 9 checks passed
@loicmathieu loicmathieu deleted the feat/restart-subflow branch January 7, 2025 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/breaking-change Code modifications needed before upgrading
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant