How Generate works
What happens between Generate click and a finished layout.
When you click Generate in the Tauri app, SolarLayout creates a Run, fans the work out across cloud workers, and streams progress back to the desktop via polling.
Lifecycle phases
Run creation
The desktop sends your inputs (parsed KMZ + module spec + plant parameters)
to api.solarlayout.app. The API validates, snapshots your entitlement
features, creates a Run row, and fans out one Slice per plot.
Per-plot compute
Each Slice triggers a dedicated Lambda invocation (compute-layout-slice).
The Lambda places tables, inverters, cables, lightning arresters for that
plot independently. Plots run in parallel — typical fan-out is 4-8 Slices.
Rollup
When all Slices reach a terminal state, rollup-layout-slices claims the
Run, aggregates results, computes 25-year energy yield, and stamps the
Run as DONE. Cancellation cascades to non-terminal Slices.
Surface in the app
The desktop polls every 2s while the Run is in flight. As Slices report
progress, per-plot pins light up on the canvas. On DONE, the layout
renders and exports become available.
Cable routing options
Three modes, selectable in the Inspector:
- Off — table-only layout, fastest path.
- Trench-fit — DC + AC cables routed along plot trenches.
- Optimised — trench-fit plus length minimisation (default).
Cancelling a run
Click Cancel on the running Run. The API marks the Run as CANCELLING
and cascades to every non-terminal Slice. Slices already running don't get
interrupted mid-invocation (Lambda has no kill primitive), but they're
ignored at rollup.