# `Lightning.ExportUtils`
[🔗](https://github.com/OpenFn/lightning/blob/main/lib/lightning/export_utils.ex#L1)

Module that expose a function generating a complete and valid yaml string
from a project and its workflows.

# `build_yaml_tree`

# `generate_new_yaml`

```elixir
@spec generate_new_yaml(
  Lightning.Projects.Project.t(),
  [Lightning.Workflows.Snapshot.t()] | nil
) ::
  {:ok, binary()} | {:error, binary()}
```

Builds the project spec.

Returns `{:error, message}` when two entities in the project would be written
under the same spec key. That is refused rather than exported, because the
key is what the CLI addresses the entity by. The message names both.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
