Arazzo-Specification icon indicating copy to clipboard operation
Arazzo-Specification copied to clipboard

Workflow variations & sharing steps between workflows

Open 0xMostafa opened this issue 11 months ago • 2 comments

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!

0xMostafa avatar Jan 23 '25 07:01 0xMostafa

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.

ndenny avatar Jan 24 '25 16:01 ndenny

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).

frankkilcommins avatar Feb 05 '25 14:02 frankkilcommins