Skip to content

Commit e695c2f

Browse files
feat: update schema to use named tasks
Signed-off-by: Matthias Pichler <[email protected]>
1 parent b8f3e29 commit e695c2f

File tree

1 file changed

+34
-20
lines changed

1 file changed

+34
-20
lines changed

schema/workflow.yaml

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ properties:
5353
extensions:
5454
type: array
5555
items:
56-
$ref: '#/$defs/extension'
56+
type: object
57+
minProperties: 1
58+
maxProperties: 1
59+
additionalProperties:
60+
$ref: '#/$defs/extension'
5761
description: The workflow's extensions.
5862
functions:
5963
type: object
@@ -75,7 +79,11 @@ properties:
7579
type: array
7680
minItems: 1
7781
items:
78-
$ref: '#/$defs/task'
82+
type: object
83+
minProperties: 1
84+
maxProperties: 1
85+
additionalProperties:
86+
$ref: '#/$defs/task'
7987
description: Defines the tasks the workflow must perform
8088
timeout:
8189
$ref: '#/$defs/timeout'
@@ -103,9 +111,6 @@ $defs:
103111
task:
104112
type: object
105113
properties:
106-
name:
107-
type: string
108-
description: The task's name. **SHOULD** be unique within an array. Required if you want to reference the task in `then`.
109114
input:
110115
$ref: '#/$defs/input'
111116
description: Configure the task's input.
@@ -286,7 +291,11 @@ $defs:
286291
type: array
287292
minItems: 2
288293
items:
289-
$ref: '#/$defs/task'
294+
type: object
295+
minProperties: 1
296+
maxProperties: 1
297+
additionalProperties:
298+
$ref: '#/$defs/task'
290299
description: A list of the tasks to perform concurrently.
291300
compete:
292301
type: boolean
@@ -297,7 +306,11 @@ $defs:
297306
type: array
298307
minItems: 2
299308
items:
300-
$ref: '#/$defs/task'
309+
type: object
310+
minProperties: 1
311+
maxProperties: 1
312+
additionalProperties:
313+
$ref: '#/$defs/task'
301314
description: A list of the tasks to perform sequentially.
302315
required: [ sequentially ]
303316
description: Configures the task execution strategy to use
@@ -506,16 +519,20 @@ $defs:
506519
minItems: 1
507520
items:
508521
type: object
509-
properties:
510-
name:
511-
type: string
512-
description: The case's name.
513-
when:
514-
type: string
515-
description: A runtime expression used to determine whether or not the case matches.
516-
then:
517-
$ref: '#/$defs/flowDirective'
518-
description: The flow directive to execute when the case matches.
522+
minProperties: 1
523+
maxProperties: 1
524+
additionalProperties:
525+
type: object
526+
properties:
527+
name:
528+
type: string
529+
description: The case's name.
530+
when:
531+
type: string
532+
description: A runtime expression used to determine whether or not the case matches.
533+
then:
534+
$ref: '#/$defs/flowDirective'
535+
description: The flow directive to execute when the case matches.
519536
required: [ switch ]
520537
description: Enables conditional branching within workflows, allowing them to dynamically select different paths based on specified conditions or criteria
521538
tryTask:
@@ -758,9 +775,6 @@ $defs:
758775
extension:
759776
type: object
760777
properties:
761-
name:
762-
type: string
763-
description: The extension's name.
764778
extend:
765779
type: string
766780
enum: [ call, composite, emit, for, listen, raise, run, set, switch, try, wait, all ]

0 commit comments

Comments
 (0)