Workflows calling other workflows
# 🌱|help-and-getting-started
a
Is there a reason why workflows can't have the command
run workflow XXX
We have one workflow specifically designed for BuildKite and it could use calling other workflow instead of having to duplicate the steps there and copying them over... I think we can all agree copying is bad, will break the single source of truth concept. Thank you.
b
Hey @aloof-lamp-69262 let me give this a try today and come back to you! Hope you have a great day!
a
Thanks
I know this can't be done now, for the time being.
b
Yes, tested it and sadly you are right, however this feature definitely would be a NICE to have.
Would you like to push a Feature request for it and then we can add this in the RoadMap after our Bonsai release goes live?❤️
c
It would also be lovely if you could describe the use case that requires Workflows to call other workflows. I am curious to know what you are trying to achieve.
b
Definitely, thanks a lot for using Garden in such a beautiful way, you are always out there discovering new features and fixes that help massively Garden! @aloof-lamp-69262
a
Sure, I will explain that shortly.
Alright sorry for the delay, so this is our use case. We have a project/library called
rules-engine
that has a set of kafka consumers. Each module that is a consumer has a predefined set of env variables, so a template here makes sense. Let's call this template
rules-engine-generic-consumer-template
. Now when we want to get a project into garden based on rules engine, let's take an example and call it
rules-engine-project-x
rules-engine-project-x
will use the base template
rules-engine-generic-consumer
but will define some of needed env variables specific for
project-x
So we will have a new template, more specialized for project-x, let's call that
rules-engine-project-x-consumer-template
which we will use for project-x consumers. Without this feature, we are now copying the generic template into a new one (the project specific one) instead of inheriting from it. It's a nice to have feature, not a blocker. @chilly-gigabyte-83853 @bright-policeman-43626 If you have any questions let me know!
b
Hey @aloof-lamp-69262 thanks a lot for the clear explanation! I think this workflow you are trying to achieve is valid and makes sense, I can feel that is definitely going to reduce a lot of code duplication. This feature could open a lot of opportunities for more complex use cases. I'd say we should convert this into a Feature request and see if it makes sense for the Core team to introduce this in later versions as a really nice to have. Thanks a lot for being so active!
a
Thank you so much
b
Please don't hesitate to reach out if you need help creating the feature request @aloof-lamp-69262 thanks a lot!
5 Views