Skip to content

Commit c5e6652

Browse files
Merge pull request #416 from frankkilcommins/pass-workflow-parameters
Allow workflow inputs to be passed in success and failure actions
2 parents 5c34696 + f5a0823 commit c5e6652

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/arazzo.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ Describes a single step parameter. A unique parameter is defined by the combinat
393393
| Field Name | Type | Description |
394394
| --- | :---: | --- |
395395
| <a name="parameterName"></a> name | `string` | **REQUIRED**. The name of the parameter. Parameter names are _case sensitive_. |
396-
| <a name="parameterIn"></a> in | `string` | The location of the parameter. Possible values are `"path"`, `"query"`, `"header"`, or `"cookie"`. When the step in context specifies a `workflowId`, then all parameters map to workflow inputs. In all other scenarios (e.g., a step specifies an `operationId`), the `in` field MUST be specified. |
396+
| <a name="parameterIn"></a> in | `string` | The location of the parameter. Possible values are `"path"`, `"query"`, `"header"`, or `"cookie"`. When the step, success action, or failure action in context specifies a `workflowId`, then all parameters map to workflow inputs. In all other scenarios (e.g., a step specifies an `operationId`), the `in` field MUST be specified. |
397397
| <a name="parameterValue"></a> value | Any \| {expression} \| [Selector Object](#selector-object) | **REQUIRED**. The value to pass in the parameter. The value can be a constant, a [Runtime Expression](#runtime-expressions), or a [Selector Object](#selector-object) to be evaluated and passed to the referenced operation or workflow. |
398398

399399
This object MAY be extended with [Specification Extensions](#specification-extensions).
@@ -436,6 +436,7 @@ A single success action which describes an action to take upon success of a work
436436
| <a name="successActionType"></a> type | `string` | **REQUIRED**. The type of action to take. Possible values are `"end"` or `"goto"`. |
437437
| <a name="successWorkflowId"></a> workflowId | `string` | The [workflowId](#fixed-fields-2) referencing an existing workflow within the Arazzo Description to transfer to upon success of the step. This field is only relevant when the `type` field value is `"goto"`. If the referenced workflow is contained within an `arazzo` type `sourceDescription`, then the `workflowId` MUST be specified using a [Runtime Expression](#runtime-expressions) (e.g., `$sourceDescriptions.<name>.<workflowId>`) to avoid ambiguity or potential clashes. This field is mutually exclusive to `stepId`. |
438438
| <a name="successStepId"></a> stepId | `string` | The `stepId` to transfer to upon success of the step. This field is only relevant when the `type` field value is `"goto"`. The referenced `stepId` MUST be within the current workflow. This field is mutually exclusive to `workflowId`. |
439+
| <a name="successParameters"></a>parameters | [[Parameter Object](#parameter-object) \| [Reusable Object](#reusable-object)] | A list of parameters that MUST be passed to a workflow as referenced by `workflowId`. If a Reusable Object is provided, it MUST link to a parameter defined in the [components/parameters](#components-object) of the current Arazzo document. The list MUST NOT include duplicate parameters. The `in` field MUST NOT be used. |
439440
| <a name="successCriteria"></a> criteria | [[Criterion Object](#criterion-object)] | A list of assertions to determine if this action SHALL be executed. Each assertion is described using a [Criterion Object](#criterion-object). All criteria assertions `MUST` be satisfied for the action to be executed. |
440441

441442
This object MAY be extended with [Specification Extensions](#specification-extensions).
@@ -469,6 +470,7 @@ A single failure action which describes an action to take upon failure of a work
469470
| <a name="failureActionType"></a> type | `string` | **REQUIRED**. The type of action to take. Possible values are `"end"`, `"retry"`, or `"goto"`. |
470471
| <a name="failureWorkflowId"></a> workflowId | `string` | The [workflowId](#fixed-fields-2) referencing an existing workflow within the Arazzo Description to transfer to upon failure of the step. This field is only relevant when the `type` field value is `"goto"` or `"retry"`. If the referenced workflow is contained within an `arazzo` type `sourceDescription`, then the `workflowId` MUST be specified using a [Runtime Expression](#runtime-expressions) (e.g., `$sourceDescriptions.<name>.<workflowId>`) to avoid ambiguity or potential clashes. This field is mutually exclusive to `stepId`. When used with `"retry"`, context transfers back upon completion of the specified workflow. |
471472
| <a name="failureStepId"></a> stepId | `string` | The `stepId` to transfer to upon failure of the step. This field is only relevant when the `type` field value is `"goto"` or `"retry"`. The referenced `stepId` MUST be within the current workflow. This field is mutually exclusive to `workflowId`. When used with `"retry"`, context transfers back upon completion of the specified step. |
473+
| <a name="failureParameters"></a>parameters | [[Parameter Object](#parameter-object) \| [Reusable Object](#reusable-object)] | A list of parameters that MUST be passed to a workflow as referenced by `workflowId`. If a Reusable Object is provided, it MUST link to a parameter defined in the [components/parameters](#components-object) of the current Arazzo document. The list MUST NOT include duplicate parameters. The `in` field MUST NOT be used. |
472474
| <a name="failureRetryAfter"></a> retryAfter | `number` | A non-negative decimal indicating the seconds to delay after the step failure before another attempt SHALL be made. **Note:** if an HTTP [Retry-After](https://tools.ietf.org/html/rfc9110.html#name-retry-after) response header was returned to a step from a targeted operation, then it SHOULD overrule this particular field value. This field only applies when the `type` field value is `"retry"`. |
473475
| <a name="failureRetryLimit"></a> retryLimit | `integer` | A non-negative integer indicating how many attempts to retry the step MAY be attempted before failing the overall step. If not specified then a single retry SHALL be attempted. This field only applies when the `type` field value is `"retry"`. The `retryLimit` MUST be exhausted prior to executing subsequent failure actions. |
474476
| <a name="failureCriteria"></a> criteria | [[Criterion Object](#criterion-object)] | A list of assertions to determine if this action SHALL be executed. Each assertion is described using a [Criterion Object](#criterion-object). |

src/schemas/validation/schema.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,11 @@ $defs:
377377
stepId:
378378
description: The stepId to transfer to upon success of the step
379379
$ref: '#stepId'
380+
parameters:
381+
description: A list of parameters that MUST be passed to a workflow as referenced by workflowId
382+
type: array
383+
uniqueItems: true
384+
items: true
380385
criteria:
381386
description: A list of assertions to determine if this action SHALL be executed
382387
type: array
@@ -395,6 +400,12 @@ $defs:
395400
- workflowId
396401
- required:
397402
- stepId
403+
- if:
404+
required:
405+
- parameters
406+
then:
407+
required:
408+
- workflowId
398409
required:
399410
- name
400411
- type
@@ -420,6 +431,11 @@ $defs:
420431
stepId:
421432
description: The stepId to transfer to upon failure of the step
422433
$ref: '#stepId'
434+
parameters:
435+
description: A list of parameters that MUST be passed to a workflow as referenced by workflowId
436+
type: array
437+
uniqueItems: true
438+
items: true
423439
retryAfter:
424440
description: A non-negative decimal indicating the seconds to delay after the step failure before another attempt SHALL be made
425441
type: number
@@ -454,6 +470,12 @@ $defs:
454470
then:
455471
required:
456472
- retryAfter
473+
- if:
474+
required:
475+
- parameters
476+
then:
477+
required:
478+
- workflowId
457479
required:
458480
- name
459481
- type

0 commit comments

Comments
 (0)