@@ -68,9 +68,13 @@ func TestWorkflowSpecFormatChart(t *testing.T) {
68
68
{"notstreamssepolia" , notStreamSepoliaWorkflowSpec },
69
69
{"serial" , serialWorkflowSpec },
70
70
{"parallel" , parallelWorkflowSpec },
71
+ {"parallel_serialized" , parallelSerializedWorkflowSpec },
71
72
{"builder_parallel" , buildSimpleWorkflowSpec (
72
73
sdk .NewWorkflowSpecFactory (sdk.NewWorkflowParams {Owner : "test" , Name : "parallel" }),
73
74
).MustSpec (t )},
75
+ {"builder_serial" , buildSimpleWorkflowSpec (
76
+ sdk .NewSerialWorkflowSpecFactory (sdk.NewWorkflowParams {Owner : "test" , Name : "serial" }),
77
+ ).MustSpec (t )},
74
78
} {
75
79
t .Run (tt .name , func (t * testing.T ) {
76
80
requireEqualChart (t , tt .name , tt .workflow )
@@ -405,3 +409,86 @@ var parallelWorkflowSpec = sdk.WorkflowSpec{
405
409
},
406
410
},
407
411
}
412
+
413
+ var parallelSerializedWorkflowSpec = sdk.WorkflowSpec {
414
+ Name : "parallel-serialized" ,
415
+ Owner : "owner" ,
416
+ Triggers : []sdk.StepDefinition {
417
+ {
418
+
419
+ Ref : "trigger-chain-event" ,
420
+ Inputs : sdk.StepInputs {},
421
+ Config : map [string ]any {"maxFrequencyMs" : 5000 },
422
+ CapabilityType : capabilities .CapabilityTypeTrigger ,
423
+ },
424
+ },
425
+ Actions : []sdk.StepDefinition {
426
+ {
427
+
428
+ Ref : "get-foo" ,
429
+ Inputs : sdk.StepInputs {
430
+ Mapping : map [string ]any {"Arg0" : "$(trigger-chain-event.outputs)" },
431
+ },
432
+ CapabilityType : capabilities .CapabilityTypeAction ,
433
+ },
434
+ {
435
+
436
+ Ref : "compute-foo" ,
437
+ Inputs : sdk.StepInputs {
438
+ Mapping : map [string ]any {"Arg0" : "$(get-foo.outputs)" },
439
+ },
440
+ CapabilityType : capabilities .CapabilityTypeAction ,
441
+ },
442
+ {
443
+
444
+ Ref : "get-bar" ,
445
+ Condition : "$(compute-foo.success)" ,
446
+ Inputs : sdk.StepInputs {
447
+ Mapping : map [string ]any {"Arg0" : "$(trigger-chain-event.outputs)" },
448
+ },
449
+ CapabilityType : capabilities .CapabilityTypeAction ,
450
+ },
451
+ {
452
+
453
+ Ref : "compute-bar" ,
454
+ Inputs : sdk.StepInputs {
455
+ Mapping : map [string ]any {"Arg0" : "$(get-bar.outputs)" },
456
+ },
457
+ CapabilityType : capabilities .CapabilityTypeAction ,
458
+ },
459
+ {
460
+
461
+ Ref : "read-token-price" ,
462
+ Condition : "$(compute-bar.success)" ,
463
+ Inputs : sdk.StepInputs {
464
+ Mapping : map [string ]any {"Arg0" : "$(trigger-chain-event.outputs)" },
465
+ },
466
+ CapabilityType : capabilities .CapabilityTypeAction ,
467
+ },
468
+ },
469
+ Consensus : []sdk.StepDefinition {
470
+ {
471
+
472
+ Ref : "data-feeds-report" ,
473
+ Inputs : sdk.StepInputs {
474
+ Mapping : map [string ]any {
475
+ "observations" : []string {
476
+ "$(compute-foo.outputs.Value)" ,
477
+ "$(compute-bar.outputs.Value)" ,
478
+ },
479
+ "token_price" : "$(read-token-price.outputs.Value)" ,
480
+ },
481
+ },
482
+ CapabilityType : capabilities .CapabilityTypeConsensus ,
483
+ },
484
+ },
485
+ Targets : []sdk.StepDefinition {
486
+ {
487
+
488
+ Inputs : sdk.StepInputs {
489
+ Mapping : map [string ]any {"signed_report" : "$(data-feeds-report.outputs)" },
490
+ },
491
+ CapabilityType : capabilities .CapabilityTypeTarget ,
492
+ },
493
+ },
494
+ }
0 commit comments