Skip to content

Commit 6755903

Browse files
feat: update schema
Signed-off-by: Matthias Pichler <[email protected]>
1 parent 8c92c23 commit 6755903

File tree

1 file changed

+40
-46
lines changed

1 file changed

+40
-46
lines changed

schema/workflow.yaml

+40-46
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ properties:
7676
description: The workflow's secrets.
7777
description: Defines the workflow's reusable components.
7878
do:
79-
description: Defines the task the workflow must perform
80-
$ref: '#/$defs/task'
79+
description: Defines the task(s) the workflow must perform
80+
$ref: '#/$defs/taskList'
8181
timeout:
8282
$ref: '#/$defs/timeout'
8383
description: The workflow's timeout configuration, if any.
@@ -101,6 +101,14 @@ properties:
101101
description: Specifies the events that trigger the workflow execution.
102102
description: Schedules the workflow
103103
$defs:
104+
taskList:
105+
type: array
106+
items:
107+
type: object
108+
minProperties: 1
109+
maxProperties: 1
110+
additionalProperties:
111+
$ref: '#/$defs/task'
104112
task:
105113
type: object
106114
properties:
@@ -118,7 +126,8 @@ $defs:
118126
description: The flow directive to be performed upon completion of the task.
119127
oneOf:
120128
- $ref: '#/$defs/callTask'
121-
- $ref: '#/$defs/compositeTask'
129+
- $ref: '#/$defs/doTask'
130+
- $ref: '#/$defs/branchTask'
122131
- $ref: '#/$defs/emitTask'
123132
- $ref: '#/$defs/forTask'
124133
- $ref: '#/$defs/listenTask'
@@ -273,43 +282,28 @@ $defs:
273282
additionalProperties: true
274283
description: A name/value mapping of the parameters, if any, to call the function with.
275284
required: [ call ]
276-
compositeTask:
285+
branchTask:
277286
type: object
278-
required: [ execute ]
279-
description: Serves as a pivotal orchestrator within workflow systems, enabling the seamless integration and execution of multiple subtasks to accomplish complex operations
287+
required: [ branch ]
288+
description: Allows to execute multiple tasks concurrently.
280289
properties:
281-
execute:
290+
branch:
282291
type: object
283-
description: Configures the task execution strategy to use
284-
oneOf:
285-
- required: [ concurrently ]
286-
properties:
287-
concurrently:
288-
description: A list of the tasks to perform concurrently.
289-
type: array
290-
minItems: 2
291-
items:
292-
type: object
293-
minProperties: 1
294-
maxProperties: 1
295-
additionalProperties:
296-
$ref: '#/$defs/task'
297-
compete:
298-
description: Indicates whether or not the concurrent tasks are racing against each other, with a single possible winner, which sets the composite task's output.
299-
type: boolean
300-
default: false
301-
- required: [ sequentially ]
302-
properties:
303-
sequentially:
304-
description: A list of the tasks to perform sequentially.
305-
type: array
306-
minItems: 2
307-
items:
308-
type: object
309-
minProperties: 1
310-
maxProperties: 1
311-
additionalProperties:
312-
$ref: '#/$defs/task'
292+
required: [ "on" ]
293+
properties:
294+
on:
295+
$ref: '#/$defs/taskList'
296+
compete:
297+
description: Indicates whether or not the concurrent tasks are racing against each other, with a single possible winner, which sets the composite task's output.
298+
type: boolean
299+
default: false
300+
doTask:
301+
type: object
302+
required: [ do ]
303+
description: Allows to execute multiple tasks sequentially.
304+
properties:
305+
do:
306+
$ref: '#/$defs/taskList'
313307
emitTask:
314308
type: object
315309
properties:
@@ -374,7 +368,7 @@ $defs:
374368
type: string
375369
description: A runtime expression that represents the condition, if any, that must be met for the iteration to continue.
376370
do:
377-
$ref: '#/$defs/task'
371+
$ref: '#/$defs/taskList'
378372
description: Allows workflows to iterate over a collection of items, executing a defined set of subtasks for each item in the collection. This task type is instrumental in handling scenarios such as batch processing, data transformation, and repetitive operations across datasets.
379373
required: [ for, do ]
380374
listenTask:
@@ -533,8 +527,8 @@ $defs:
533527
type: object
534528
properties:
535529
try:
536-
description: The task to perform.
537-
$ref: '#/$defs/task'
530+
description: The task(s) to perform.
531+
$ref: '#/$defs/taskList'
538532
catch:
539533
type: object
540534
properties:
@@ -553,8 +547,8 @@ $defs:
553547
$ref: '#/$defs/retryPolicy'
554548
description: The retry policy to use, if any, when catching errors.
555549
do:
556-
description: The definition of the task to run when catching an error.
557-
$ref: '#/$defs/task'
550+
description: The definition of the task(s) to run when catching an error.
551+
$ref: '#/$defs/taskList'
558552
required: [ try, catch ]
559553
description: Serves as a mechanism within workflows to handle errors gracefully, potentially retrying failed tasks before proceeding with alternate ones.
560554
waitTask:
@@ -777,11 +771,11 @@ $defs:
777771
type: string
778772
description: A runtime expression, if any, used to determine whether or not the extension should apply in the specified context.
779773
before:
780-
description: The task to execute before the extended task, if any.
781-
$ref: '#/$defs/task'
774+
description: The task(s) to execute before the extended task, if any.
775+
$ref: '#/$defs/taskList'
782776
after:
783-
description: The task to execute after the extended task, if any.
784-
$ref: '#/$defs/task'
777+
description: The task(s) to execute after the extended task, if any.
778+
$ref: '#/$defs/taskList'
785779
required: [ extend ]
786780
description: The definition of a an extension.
787781
externalResource:

0 commit comments

Comments
 (0)