Workflow variations & sharing steps between workflows
I've a workflow that varies:
- if user is an undergrad, form will ask for university name
- if user is a graduate, form will ask for company name
but all other steps all the same, how to implement variations?
should I define a workflow per variation? or there is some way to define variations in one workflow?
Also, if i settled for workflow-per-variation, how to share steps between workflows/variations and use their input & output dynamically?
Thank you!
Hi @0xMostafa - this question might be better suited to our Slack channel on the OAI's Slack - https://www.openapis.org/ > Participate > Join our Slack - then join the #arazzo channel. I'm a little rusty on the exact details, but I think that because you can have a step in a workflow that is itself a workflow means you could have two sub-workflows and an if statement to control which one is called to handle this case.
Hi @0xMostafa,
Arazzo has the concept of branching (both upon step success and/or failure). This ability allows you to go down certain paths depending upon various conditions.
If your workflow was along the lines of calling a student API to retrieve certain details and if successfully retrieved, you could then check the details and move to a conditional step based on the student being an undergrad or a postgraduate using the 'goto` ability.
Alternatively as @ndenny pointed out you could keep the common part in one workflow and then have two separate workflows both leverage the common part and be called based on the student classification (that would be determined by the calling software).