Skip to content

Commit

Permalink
Add a new to property to the emit task, used to configure an addi…
Browse files Browse the repository at this point in the history
…tional endpoint to publish the configured event to

Closes #1026

Signed-off-by: Charles d'Avernas <[email protected]>
  • Loading branch information
cdavernas committed Jan 8, 2025
1 parent df6686a commit 818f08c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions dsl-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ Allows workflows to publish events to event brokers or messaging systems, facili
| Name | Type | Required | Description |
|:--|:---:|:---:|:---|
| emit.event | [`eventProperties`](#event-properties) | `yes` | Defines the event to emit. |
| emit.to | [`endpoint`](#endpoint) | `no` | Specifies an additional endpoint for emitting the event. While the runtime's default cloud event endpoint remains the primary destination, setting this property ensures that the event is also published to the specified endpoint. Ideally, this property is left unset so that event delivery relies solely on the runtime's configured endpoint, but when provided, the event will be sent to both endpoints concurrently. |

##### Examples

Expand Down
20 changes: 20 additions & 0 deletions examples/emit-additional-sink.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
document:
dsl: '1.0.0-alpha5'
namespace: test
name: emit
version: '0.1.0'
do:
- emitEvent:
emit:
event:
with:
source: https://petstore.com
type: com.petstore.order.placed.v1
data:
client:
firstName: Cruella
lastName: de Vil
items:
- breed: dalmatian
quantity: 101
to: https://additional-cloud-event-sink.com/pub
6 changes: 5 additions & 1 deletion schema/workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$id: https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.yaml
$id: https://serverlessworkflow.io/schemas/1.0.0-alpha6/workflow.yaml
$schema: https://json-schema.org/draft/2020-12/schema
description: Serverless Workflow DSL - Workflow Schema.
type: object
Expand Down Expand Up @@ -482,6 +482,10 @@ $defs:
description: Defines the properties of event to emit.
required: [ source, type ]
additionalProperties: true
to:
$ref: '#/$defs/endpoint'
title: EmitEndpointDefinition
description: Defines the additional endpoint, if any, to emit the event to.
required: [ event ]
forTask:
type: object
Expand Down

0 comments on commit 818f08c

Please sign in to comment.