You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: schema/workflow.json
+17-17Lines changed: 17 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -413,13 +413,13 @@
413
413
"description": "References a function to be invoked",
414
414
"$ref": "#/definitions/functionref"
415
415
},
416
-
"produceEventRef": {
417
-
"description": "References a `produce` reusable event definition",
418
-
"$ref": "#/definitions/produceeventref"
416
+
"publish": {
417
+
"description": "Publish an event",
418
+
"$ref": "#/definitions/publish"
419
419
},
420
-
"consumeEventRef": {
421
-
"description": "References a `consume` reusable event definition",
422
-
"$ref": "#/definitions/consumeeventref"
420
+
"subscribe": {
421
+
"description": "Subscribe to an event channel",
422
+
"$ref": "#/definitions/subscribe"
423
423
},
424
424
"subFlowRef": {
425
425
"description": "References a sub-workflow to invoke",
@@ -472,13 +472,13 @@
472
472
{
473
473
"required": [
474
474
"name",
475
-
"produceEventRef"
475
+
"publish"
476
476
]
477
477
},
478
478
{
479
479
"required": [
480
480
"name",
481
-
"consumeEventRef"
481
+
"subscribe"
482
482
]
483
483
},
484
484
{
@@ -531,21 +531,21 @@
531
531
}
532
532
]
533
533
},
534
-
"produceeventref": {
534
+
"publish": {
535
535
"type": "object",
536
536
"description": "Publish an event",
537
537
"properties": {
538
-
"name": {
538
+
"event": {
539
539
"type": "string",
540
-
"description": "Reference to the unique name of a 'produced' event definition",
540
+
"description": "Reference to the unique name of a 'published' event definition",
541
541
"pattern": "^[a-z0-9](-?[a-z0-9])*$"
542
542
},
543
543
"data": {
544
544
"type": [
545
545
"string",
546
546
"object"
547
547
],
548
-
"description": "If string type, an expression which selects parts of the states data output to become the data (payload) of the event referenced by 'produceEventRef'. If object type, a custom object to become the data (payload) of the event referenced by 'produceEventRef'."
548
+
"description": "If string type, an expression which selects parts of the states data output to become the data (payload) of the event referenced by 'publish'. If object type, a custom object to become the data (payload) of the event referenced by 'publish'."
549
549
},
550
550
"contextAttributes": {
551
551
"type": "object",
@@ -560,16 +560,16 @@
560
560
"name", "data"
561
561
]
562
562
},
563
-
"consumeeventref": {
563
+
"subscribe": {
564
564
"type": "object",
565
-
"description": "Waits for an event",
565
+
"description": "Subscribe to an event channel",
566
566
"properties": {
567
-
"name": {
567
+
"event": {
568
568
"type": "string",
569
-
"description": "Reference to the unique name of a 'consumed' event definition",
569
+
"description": "Reference to the unique name of a 'subscribed' event definition",
570
570
"pattern": "^[a-z0-9](-?[a-z0-9])*$"
571
571
},
572
-
"consumeEventTimeout": {
572
+
"timeout": {
573
573
"type": "string",
574
574
"description": "Maximum amount of time (ISO 8601 format) to wait for the result event. If not defined it should default to the actionExecutionTimeout"
Copy file name to clipboardExpand all lines: specification.md
+22-23Lines changed: 22 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -3968,22 +3968,21 @@ functionRef:
3968
3968
3969
3969
</details>
3970
3970
3971
-
Actions specify invocations of services or other workflows during workflow execution.
3972
-
Service invocation can be done in three different ways:
3971
+
An action can:
3973
3972
3974
3973
* Reference [functions definitions](#Function-Definition) by its unique name using the `functionRef` property.
3975
-
* Reference a [event definitions](#Event-Definition) via the `produceEventRef` property in order to publish that event.
3976
-
* Reference a [event definitions](#Event-Definition) via the `consumeEventRef` property in order to consume that event.
3974
+
* Publish an event [event definitions](#Event-Definition) via the `publish` property.
3975
+
* Subscribe to an event [event definitions](#Event-Definition) via the `subscribe` property.
3977
3976
* Reference a sub-workflow invocation via the `subFlowRef` property.
3978
3977
3979
-
Note that `functionRef`, `eventRef`, and `subFlowRef` are mutually exclusive, meaning that only one of them can be
3978
+
Note that `functionRef`, `publish`, `subscribe` and `subFlowRef` are mutually exclusive, meaning that only one of them can be
3980
3979
specified in a single action definition.
3981
3980
3982
3981
The `name` property specifies the action name.
3983
3982
3984
3983
In the event-based scenario a service, or a set of services we want to invoke are not exposed via a specific resource URI for example, but can only be invoked via an event.
3985
-
In that case, an event definition might be referenced via its `produceEventRef` property.
3986
-
Also, if there is the need to consume an event within a set of actions (for example, wait for the result of a previous action invocation) an event definition might be referenced via its `consumeEventRef` property.
3984
+
In that case, an event definition might be referenced via its `publish` property.
3985
+
Also, if there is the need to consume an event within a set of actions (for example, wait for the result of a previous action invocation) an event definition might be referenced via its `susbcribe` property.
3987
3986
3988
3987
The `sleep` property can be used to define time periods that workflow execution should sleep
3989
3988
before and/or after function execution. It can have two properties:
@@ -4110,14 +4109,14 @@ In addition, functions that are invoked async do not propagate their errors to t
4110
4109
workflow state, meaning that any errors that happen during their execution cannot be handled in the workflow states
4111
4110
onErrors definition. Note that errors raised during functions that are invoked async should not fail workflow execution.
4112
4111
4113
-
##### ProduceEventRef Definition
4112
+
##### Publish Definition
4114
4113
4115
4114
Publish an event.
4116
4115
4117
4116
| Parameter | Description | Type | Required |
4118
4117
| --- | --- | --- | --- |
4119
-
| [name](#Event-Definition) | Reference to the unique name of an event definition. Must follow the [Serverless Workflow Naming Convention](#naming-convention) | string | yes |
4120
-
| data | If string type, an expression which selects parts of the states data output to become the data (payload) of the event referenced by `produceEventRef`. If object type, a custom object to become the data (payload) of the event referenced by `produceEventRef`. | string or object | yes |
4118
+
| [event](#Event-Definition) | Reference to the unique name of an event definition. Must follow the [Serverless Workflow Naming Convention](#naming-convention) | string | yes |
4119
+
| data | If string type, an expression which selects parts of the states data output to become the data (payload) of the event referenced by `publish`. If object type, a custom object to become the data (payload) of the event referenced by `publish`. | string or object | yes |
4121
4120
| contextAttributes | Add additional event extension context attributes to the trigger/produced event | object | no |
4122
4121
4123
4122
<details><summary><strong>Click to view example definition</strong></summary>
@@ -4133,8 +4132,8 @@ Publish an event.
4133
4132
4134
4133
```json
4135
4134
{
4136
-
"produceEventRef": {
4137
-
"name": "make-vet-appointment",
4135
+
"publish": {
4136
+
"event": "make-vet-appointment",
4138
4137
"data": "${ .patientInfo }",
4139
4138
}
4140
4139
}
@@ -4144,8 +4143,8 @@ Publish an event.
4144
4143
<td valign="top">
4145
4144
4146
4145
```yaml
4147
-
produceEventRef:
4148
-
name: make-vet-appointment
4146
+
publish:
4147
+
event: make-vet-appointment
4149
4148
data: "${ .patientInfo }"
4150
4149
```
4151
4150
@@ -4155,22 +4154,22 @@ produceEventRef:
4155
4154
4156
4155
</details>
4157
4156
4158
-
Publish an [event definition](#Event-Definition) referenced via the `name` property.
4157
+
Publish an [event definition](#Event-Definition) referenced via the `event` property.
4159
4158
4160
4159
The `data` property can have two types: string or object. If it is of string type, it is an expression that can select parts of state data
4161
-
to be used as payload of the event referenced by `produceEventRef`. If it is of object type, you can define a custom object to be the event payload.
4160
+
to be used as payload of the event referenced by `publish`. If it is of object type, you can define a custom object to be the event payload.
4162
4161
4163
4162
The `contextAttributes` property allows you to add one or more [extension context attributes](https://github.com/cloudevents/spec/blob/main/cloudevents/spec.md#extension-context-attributes)
4164
4163
to the trigger/produced event.
4165
4164
4166
-
##### ConsumeEventRef Definition
4165
+
##### Susbscribe Definition
4167
4166
4168
4167
Wait for an event to arrive.
4169
4168
4170
4169
| Parameter | Description | Type | Required |
4171
4170
| --- | --- | --- | --- |
4172
-
| [name](#Event-Definition) | Reference to the unique name of an event definition. Must follow the [Serverless Workflow Naming Convention](#naming-convention) | string | yes |
4173
-
| consumeEventTimeout | Maximum amount of time (ISO 8601 format literal or expression) to wait for the consume event. If not defined it be set to the [actionExecutionTimeout](#Workflow-Timeout-Definition) | string | no |
4171
+
| [event](#Event-Definition) | Reference to the unique name of an event definition. Must follow the [Serverless Workflow Naming Convention](#naming-convention) | string | yes |
4172
+
| timeout | Maximum amount of time (ISO 8601 format literal or expression) to wait for the consume event. If not defined it be set to the [actionExecutionTimeout](#Workflow-Timeout-Definition) | string | no |
4174
4173
4175
4174
<details><summary><strong>Click to view example definition</strong></summary>
4176
4175
<p>
@@ -4185,7 +4184,7 @@ Wait for an event to arrive.
4185
4184
4186
4185
```json
4187
4186
{
4188
-
"consumeEventRef": {
4187
+
"subscribe": {
4189
4188
"name": "approved-appointment",
4190
4189
}
4191
4190
}
@@ -4196,7 +4195,7 @@ Wait for an event to arrive.
4196
4195
4197
4196
```yaml
4198
4197
eventRef:
4199
-
consumeEventRef: approved-appointment
4198
+
subscribe: approved-appointment
4200
4199
4201
4200
```
4202
4201
@@ -4206,9 +4205,9 @@ eventRef:
4206
4205
4207
4206
</details>
4208
4207
4209
-
Consumes an [event definition](#Event-Definition) referenced via the `name` property.
4208
+
Consumes an [event definition](#Event-Definition) referenced via the `event` property.
4210
4209
4211
-
The `consumeEventTimeout` property defines the maximum amount of time (ISO 8601 format literal or expression) to wait for the result event. If not defined it should default to the [actionExecutionTimeout](#Workflow-Timeout-Definition).
4210
+
The `timeout` property defines the maximum amount of time (ISO 8601 format literal or expression) to wait for the result event. If not defined it should default to the [actionExecutionTimeout](#Workflow-Timeout-Definition).
4212
4211
If the event defined by the `name` property is not received in that set time, action invocation should raise an error that can be handled in the states `onErrors` definition.
0 commit comments