---
title: "The Foundation SDK builder pattern | Grafana Labs"
description: "How the Foundation SDK uses composable builders to construct dashboards"
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

## How builders work in the Foundation SDK

With the Foundation SDK you define dashboards one step at a time with chained method calls instead of one giant config object.

## Follow the builder sequence

Most dashboard code follows this flow:

- Start with **DashboardBuilder** for dashboard-level settings.
- Add each panel with **PanelBuilder**.
- Add panel queries with **DataqueryBuilder**.
- Export the final dashboard JSON from the completed builder chain.

## Why this matters

The builder pattern has practical advantages when defining dashboards in code.

| Benefit          | What it means for you                                  |
|------------------|--------------------------------------------------------|
| **Composable**   | Build complex dashboards from simple, reusable pieces  |
| **Readable**     | Chained calls read like a description of what you want |
| **IDE-friendly** | Autocomplete shows valid options at every step         |
