# Engine.save
URL: https://lsd.tools/docs/api-engine-save
Updated: 2026-07-17

## Parameters

| name | type | default | description |
|---|---|---|---|
| `path` | `str \| None` | `None` | destination `.lsd` path; required for an ephemeral engine, else defaults to the file it was opened from |

## Example

```python
engine = Engine("survey.lsd")
engine.save()               # writes back to survey.lsd

Engine().save("out.lsd")    # an ephemeral engine needs an explicit path
```

## Notes

Records the **packages** that own the step/entity types used, so opening the project reloads exactly
that set. The write is **atomic** — a crash or full disk mid-save never truncates your only copy.
Raises `ValueError` if an ephemeral engine is saved without a `path`.

## See also

**API:** [load](/docs/api-engine-load) · [run_all](/docs/api-engine-run-all) · [Engine](/docs/api-engine)
