-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add a flowable EmbeddedSubflow allowing to run subflow's tasks within the same parent execution #6518
Labels
area/backend
Needs backend code changes
area/frontend
Needs frontend code changes
enhancement
New feature or request
Comments
anna-geller
added
area/backend
Needs backend code changes
enhancement
New feature or request
area/frontend
Needs frontend code changes
labels
Dec 18, 2024
anna-geller
changed the title
Add a flowable TaskGroup allowing to include subflow's tasks within the same parent execution without copy
Add a flowable TaskGroup allowing to include subflow's tasks within the same parent execution
Dec 18, 2024
loicmathieu
added a commit
that referenced
this issue
Jan 2, 2025
Adds an EmbeddedFlow that allow to embed subflow tasks into a parent tasks. Fixes #6518
loicmathieu
added a commit
that referenced
this issue
Jan 6, 2025
Adds an EmbeddedFlow that allow to embed subflow tasks into a parent tasks. Fixes #6518
loicmathieu
added a commit
that referenced
this issue
Jan 7, 2025
Adds an EmbeddedFlow that allow to embed subflow tasks into a parent tasks. Fixes #6518
Embedded Subflow Requirements
|
anna-geller
changed the title
Add a flowable TaskGroup allowing to include subflow's tasks within the same parent execution
Add a flowable EmbeddedSubflow allowing to include subflow's tasks within the same parent execution
Jan 7, 2025
anna-geller
changed the title
Add a flowable EmbeddedSubflow allowing to include subflow's tasks within the same parent execution
Add a flowable EmbeddedSubflow allowing to run subflow's tasks within the same parent execution
Jan 7, 2025
loicmathieu
added a commit
that referenced
this issue
Jan 8, 2025
Adds an EmbeddedFlow that allow to embed subflow tasks into a parent tasks. Fixes #6518
loicmathieu
added a commit
that referenced
this issue
Jan 8, 2025
Adds an EmbeddedFlow that allow to embed subflow tasks into a parent tasks. Fixes #6518
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/backend
Needs backend code changes
area/frontend
Needs frontend code changes
enhancement
New feature or request
Kestra initially supported Templates, which provided functionality similar to Subflows but lacked parameterization. This overlap caused frequent user confusion:
"What’s the difference between these? When should I use one over the other?"
Templates had several limitations:
For these reasons, Templates were [deprecated in Kestra v0.11](https://kestra.io/docs/migration-guide/0.11.0/templates) in August 2023. Subflows became the recommended approach for reusable workflow logic.
Remaining Gaps in Subflows
While Subflows addressed many limitations, certain gaps remained:
Proposal: EmbeddedSubflow
EmbeddedSubflow addresses these gaps by embedding a Subflow's tasks directly into the parent flow at runtime, avoiding the need for separate executions while resolving the challenges described above.
Example Use Case
Flow
f1
(reusable Subflow):Flow
f2
embeddingf1
using EmbeddedSubflow:In the topology, the tasks from
f1
appear directly inf2
, prefixed by the EmbeddedSubflow task ID for clarity, while using namespace-specific secrets, KV pairs, and variables fromf2
.Requirements for EmbeddedSubflow
No Task ID Collisions
Task IDs in the parent flow are prefixed with the EmbeddedSubflow task ID to avoid conflicts.
No New Executions
EmbeddedSubflows run within the parent flow's execution context, eliminating the need for separate executions.
Restart Behavior
Restarting a parent flow only restarts failed tasks within the EmbeddedSubflow rather than rerunning all tasks from scratch.
Privacy and Security
Task-level outputs are not returned directly. Only explicitly defined flow-level outputs are available to the parent.
Versioning
Allow specifying which revision of the Subflow to use, with the default set to
latest
.Topology Integration
Tasks embedded from a Subflow are visually linked in the topology, allowing navigation to their source flow while keeping them uneditable in the parent.
Namespace Context
Additional Considerations
Documentation
Performance Constraints
maxDepth
to mitigate performance issues.Templates Removal
Templates will be removed entirely from the codebase, and users must migrate to Subflows or EmbeddedSubflows.
The text was updated successfully, but these errors were encountered: