toYaml
toYaml(
model:Model,options?:ToYamlOptions):string
Serialize a workflow or action model to a YAML string.
Keys are emitted in canonical order, comments are attached, and multiline strings use block-literal style. A header comment identifying the generating tool is prepended by default.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
|
|
|
The model to serialize (e.g. from workflow or action). |
|
|
|
Optional settings for header customization. |
Returns
Section titled “Returns”string
The rendered YAML string, including a trailing newline.
Example
Section titled “Example”const yaml = toYaml(myWorkflow);console.log(yaml);
// Suppress the auto-generated header comment:const bare = toYaml(myWorkflow, { includeHeader: false });