https://garden.io logo
#🌱|help-and-getting-started
Workflows calling other workflows
# 🌱|help-and-getting-started
a

aloof-lamp-69262

04/25/2023, 3:13 PM
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

bright-policeman-43626

04/26/2023, 8:09 AM
Hey @aloof-lamp-69262 let me give this a try today and come back to you! Hope you have a great day!
a

aloof-lamp-69262

04/26/2023, 8:34 PM
Thanks
I know this can't be done now, for the time being.
b

bright-policeman-43626

04/26/2023, 8:52 PM
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

chilly-gigabyte-83853

04/27/2023, 8:51 AM
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

bright-policeman-43626

04/27/2023, 9:22 AM
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

aloof-lamp-69262

04/27/2023, 8:53 PM
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

bright-policeman-43626

05/02/2023, 5:18 AM
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

aloof-lamp-69262

05/02/2023, 3:43 PM
Thank you so much
b

bright-policeman-43626

05/04/2023, 6:55 AM
Please don't hesitate to reach out if you need help creating the feature request @aloof-lamp-69262 thanks a lot!
5 Views