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()
7171 .build ();
7272```
7373
74-
75- #### Load a file JSON/YAML to a Workflow instance
74+ #### Create Workflow from JSON/YAML source
7675
7776``` typescript
7877import { Specification , Workflow } from ' @severlessworkflow/sdk-typescript' ;
7978
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+
8091const workflow: Specification .Workflow = Workflow .fromSource (source );
8192```
82- Where ` source ` is a JSON or a YAML string.
83-
93+ Where ` source ` can be in both JSON or YAML format.
8494
8595#### Parse a Workflow instance to JSON/YAML
8696
You can’t perform that action at this time.
0 commit comments