---
title: ChartAction
description: An action.
---

# `ChartAction`

Type, in `@jr2/orchestrator/src/chart.ts`. The signature of an export, or a type that it names, names this type. The [Authoring surface](../authoring-surface.md) page lists each export. This type is not an export of `@jr2/orchestrator`, so a workflow module does not import it by name.

```ts
type ChartAction =
  | { type: "set"; path: string; from: ChartValue }
  | { type: "append"; path: string; from: ChartValue }
  | { type: "increment"; path: string; by?: number }
  | { type: "clear"; path: string }
  | { type: string; params?: ChartValue };
```

An action. The four generic ones write the run's context at `path`, a context path WITHOUT the
`context.` root (`"round"`, `"ticket.notes"`, `"items.0"`); every other `type` is a lent action.

**Forms**: it is one of these objects.

- Form 1: `type`, `path`, `from`

  - `type`: `"set"`
  - `path`: `string`
  - `from`: [`ChartValue`](type-chartvalue.md)
- Form 2: `type`, `path`, `from`

  - `type`: `"append"`
  - `path`: `string`
  - `from`: [`ChartValue`](type-chartvalue.md)
- Form 3: `type`, `path`, `by`

  - `type`: `"increment"`
  - `path`: `string`
  - `by` (optional): `number`
- Form 4: `type`, `path`

  - `type`: `"clear"`
  - `path`: `string`
- Form 5: `type`, `params`

  - `type`: `string`
  - `params` (optional): [`ChartValue`](type-chartvalue.md)
