Please bear with me as I find this tricky to articulate exactly what I am after (probably not a good sign..).
I have several services set up which can be combined in a particular order to create workflows. For example, imagine I have the following services:
- 1) HTTP -> File Store (takes a file over HTTP and stores it)
- 2) FTP -> File Store
- 3) File Store-> FTP (takes a file over HTTP and pushes to FTP)
- 4) File Store-> Transformation -> File Store(applies a transformation to a file in File Store).
I might want to combine services to create a particular workflow, for example.
1) -> 4) -> 3)
2) -> 4) -> 3)
And it might be the case that I perform exactly the same operation e.g. in the workflows above, step 4 could be applied on the same item twice, if the same item is sent over HTTP and FTP. I might also want to trigger subworkflows for example:
4) -> 3)
Would be a valid workflow. Is there a design pattern/known approach to handling these 'cascading' workflows? I would like to avoid duplicate operations where possible but also design workflows in a separate, contained manner. The only thing that comes to mind for me is some sort of composition based approach where workflows are composed of several sub-workflows.
I hope this makes sense!