-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: suggest multilevel parameters #155
chore: suggest multilevel parameters #155
Conversation
ba766c6
to
4134bfa
Compare
I had a bit of a dig through the slack channel history because I know I've seen this conversation before and to summarise: the expectation is that the same flows might be used with different parameters, so these would be supplied by the tool that uses the workflow rather than being coupled to the workflow. So if you describe a flow where a user gets a list of items and edits the first one, you'd then execute the flow using parameters that are: a list, an empty list, an invalid user token, users with different access levels, etc. My questions:
|
I'll also note that there's some connection with |
@lornajane - I'll try to answer below.
I don't see a problem here, this would just be that the calling code would invoke the workflow with a different Inputs object instance
Here I would imagine that the workflow would have a defined Inputs object that takes an array of whatever and a string for the user token, then you run the workflow with different combinations of data for the Inputs object. Example Inputs Object:
I believe the use case you laid out is possible by supplying the appropriate Input object values to the workflow (e.g. to run with different datasets). Theoretically, you could even pass in an Input object with counter property and a nested array containing all datasets and set up the workflow such that it loops through the data by defining an imaginative successCriteria to force iteration and setting the inputs data. Not sure such dark arts are warranted however.
One goal is to ensure that we can be very deterministic about what parameters on a step MUST be mappable to an API operation. Finding the scenario where 100% of the steps use a parameter might not be overly common. If indeed it's the case, defining the parameter with the components section and having a $ref to the parameter explicitly where it's applicable IMO is a verboseness we can live with for now.
I'd like to dive deeper to understand what is the true use case / gap here that cannot be achieved using a combination of the reusable Inputs, reusable parameters, and chained workflows (see https://github.com/OAI/sig-workflows/blob/main/versions/1.0.0.md#components-object). Then we can determine if this is in/out of scope and a decision on your own extension can then be taken. |
One use case is to to provide an authorization header for all the steps in a whole workflows file. This is similar to how |
OK - I understand. Let me do some analysis so see what ratio of OAD's I can find that utilize params at the path item object level. |
@RomanHotsiy @lornajane @DmitryAnansky I'm supportive of the proposal to have the ability to define parameters at the workflow level which will then be automatically applied to each step in the workflow should the need arise to have this behaviour. I'd opt to hold off on the root level parameters to be used by all steps in all workflows for now until we have more feedback from the community on whether such a situation is very common. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. As suggested in last PR comment, let's limit to Workflow.parameters for now.
I'll submited a PR on your branch to adjust the Step.Parameters verbiage to align with the changes - See DmitryAnansky#1
Co-authored-by: Frank Kilcommins <fkilcommins@gmail.com>
Co-authored-by: Frank Kilcommins <fkilcommins@gmail.com>
Co-authored-by: Frank Kilcommins <fkilcommins@gmail.com>
@DmitryAnansky thanks for committing the changes. Could you merge DmitryAnansky#1 into your fork so that it's included in this PR? |
I will create a separate PR to merge changes in DmitryAnansky#1 to the workflows main branch (issue #167 ) |
…170) * chore: suggest multilevel parameters (#155) * chore: suggest multilevel parameters * Update versions/1.0.0.md Co-authored-by: Frank Kilcommins <fkilcommins@gmail.com> * Update examples/1.0.0/ExtendedParametersExample.workflow.yaml Co-authored-by: Frank Kilcommins <fkilcommins@gmail.com> * Update versions/1.0.0.md Co-authored-by: Frank Kilcommins <fkilcommins@gmail.com> --------- Co-authored-by: Frank Kilcommins <fkilcommins@gmail.com> * Remove references to WHATWG to avoid confusion (#145) * Remove references to WHATWG to avoid confusion * Correct relative reference wording * Section 4.2 not 4.1! * Simplify URI wording * Adjust Step Parameters desc to cater for Workflow parameters addition (#169) * feat: add `dependsOn` capability for workflow level (#164) * feat: add `dependsOn` capability for workflow level * chore: typo fix * chore: grammer fix * feat: Add Request Body Object (#162) * feat: Add Request Body Object * chore: fix typos in examples * Clarity on referencing Components Parameters (#149) * Clarity on referencing Components Parameters * Remove Reference Object to avoid clash with JSON Schema keyword. Replace with expression based referencing * chore: keep fixed field link names consistent * chore: Name component parameters as type Reusable Parameter Object * chore: adjust Workflow level parameters to use Reusable Parameter Objects --------- Co-authored-by: Dmytro Anansky <dmytro@redocly.com> Co-authored-by: Nick Denny <nick@apimetrics.com>
* feat: adding support for share success and failure actions * Merging latest 'main' changes in to Action Object Extensions branch (#170) * chore: suggest multilevel parameters (#155) * chore: suggest multilevel parameters * Update versions/1.0.0.md Co-authored-by: Frank Kilcommins <fkilcommins@gmail.com> * Update examples/1.0.0/ExtendedParametersExample.workflow.yaml Co-authored-by: Frank Kilcommins <fkilcommins@gmail.com> * Update versions/1.0.0.md Co-authored-by: Frank Kilcommins <fkilcommins@gmail.com> --------- Co-authored-by: Frank Kilcommins <fkilcommins@gmail.com> * Remove references to WHATWG to avoid confusion (#145) * Remove references to WHATWG to avoid confusion * Correct relative reference wording * Section 4.2 not 4.1! * Simplify URI wording * Adjust Step Parameters desc to cater for Workflow parameters addition (#169) * feat: add `dependsOn` capability for workflow level (#164) * feat: add `dependsOn` capability for workflow level * chore: typo fix * chore: grammer fix * feat: Add Request Body Object (#162) * feat: Add Request Body Object * chore: fix typos in examples * Clarity on referencing Components Parameters (#149) * Clarity on referencing Components Parameters * Remove Reference Object to avoid clash with JSON Schema keyword. Replace with expression based referencing * chore: keep fixed field link names consistent * chore: Name component parameters as type Reusable Parameter Object * chore: adjust Workflow level parameters to use Reusable Parameter Objects --------- Co-authored-by: Dmytro Anansky <dmytro@redocly.com> Co-authored-by: Nick Denny <nick@apimetrics.com> * Add Reusable Object and referencing ability * chore: fix yaml example indentation * chore: fix JSON examples * chore: fix typo in `workflowStepActions` --------- Co-authored-by: Dmytro Anansky <dmytro@redocly.com> Co-authored-by: Nick Denny <nick@apimetrics.com>
This pull request proposes the introduction of additional options for defining
parameters
at different levels within the workflow specification.According to current suggestion the only level that can have parameters defined is Step level.
This suggestion aims to provide more flexibility by allowing
parameters
definitions at the root and workflow levels as well.The particular use-case can be found in the
ExtendedParametersExample.workflow.yaml
with JWT authentication token applied to all the Step API calls. This modification eliminates the need for duplicating parameters across individual steps, enhancing overall maintainability.Same can be applied to
Workflow
level parameters.Please let me know what do you think about this idea,
Thanks.