File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -71,16 +71,26 @@ const workflow: Specification.Workflow = workflowBuilder()
71
71
.build ();
72
72
```
73
73
74
-
75
- #### Load a file JSON/YAML to a Workflow instance
74
+ #### Create Workflow from JSON/YAML source
76
75
77
76
``` typescript
78
77
import { Specification , Workflow } from ' @severlessworkflow/sdk-typescript' ;
79
78
79
+ const source = ` id: helloworld
80
+ version: '1.0'
81
+ name: Hello World Workflow
82
+ description: Inject Hello World
83
+ start: Hello State
84
+ states:
85
+ - type: inject
86
+ name: Hello State
87
+ data:
88
+ result: Hello World!
89
+ end: true `
90
+
80
91
const workflow: Specification .Workflow = Workflow .fromSource (source );
81
92
```
82
- Where ` source ` is a JSON or a YAML string.
83
-
93
+ Where ` source ` can be in both JSON or YAML format.
84
94
85
95
#### Parse a Workflow instance to JSON/YAML
86
96
You can’t perform that action at this time.
0 commit comments