---
title: chartSchema
description: The Chart grammar, as a zod schema.
---

# `chartSchema`

Constant, in `@jr2/orchestrator/src/chart.ts`. It is an export of `@jr2/orchestrator`, on the [Authoring surface](../authoring-surface.md) page, in Charts.

```ts
const chartSchema: z.ZodType<ChartText>
```

The Chart grammar, as a zod schema. Make a field of the run input of a Chart wrapper this schema,
as in `z.object({ topic: z.string(), chart: chartSchema })`. Then a run input can carry a Chart,
and the wrapper can keep Charts under names: Chart files in `workflows/<wrapper>/`, and runtime
Charts. For the pick of a planner, use `chartSchemaFor`, which knows the names that the Open body
lends.

**See also**

- [Run a Chart by name](../../guides/run-a-chart-by-name.md)
- [Charts](../../concepts/charts.md)
