[Canonical page](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/solve-options/>)
[Full documentation index](<https://docs.dhtmlx.com/planning-engine/llms.txt>)


# SolveOptions

Options for one scheduling run: which part of the project to schedule and what the result reports. It's the `options_json` argument of [`schedule`](<https://docs.dhtmlx.com/planning-engine/wasm/api/schedule.md>) and [`JsonProject.solve`](<https://docs.dhtmlx.com/planning-engine/wasm/api/project-solve.md>), sent as JSON text. `"{}"` schedules the whole project and reports only the tasks that moved.

## Fields

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `subtree` | [`Subtree`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/common.md#subtree>) \| `null` | no | absent (whole project) | Schedules one branch: `{ "task": <Id>, "inclusive": <boolean> }`. `inclusive` defaults to `true`, which schedules the root task too. See [Reschedule a branch](<https://docs.dhtmlx.com/planning-engine/wasm/how-to/reschedule-a-branch.md>). |
| `analytics` | [`AnalyticsOptions`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/common.md#analyticsoptions>) \| `null` | no | none requested | `{ "criticalPath": <boolean>, "slack": <boolean> }`, both `false` by default. Fills `analytics` in the [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/schedule-result.md>). |
| `reasons` | boolean \| `null` | no | `false` | Adds the planner's `reason` to each entry in `updates`. |
| `includeUnchanged` | boolean \| `null` | no | `false` | Also lists unchanged scheduled tasks in `updates`, each with `start_date`, `end_date` and `duration`. Unscheduled tasks are never listed. With `subtree`, it lists every task of the subtree plus the changed or touched tasks outside it. `baselineId` still changes only when dates change. |

The payload must be a JSON object. Field names are camelCase. `null` reads as the default. Unknown fields, including unknown fields inside `subtree` and `analytics`, fail the call with `parse`. These rules are described in [Wire format](<https://docs.dhtmlx.com/planning-engine/wasm/wire-format.md#omitted-null-and-unknown-fields>).

On a cyclic project with `includeUnchanged`, `updates` lists every scheduled task and `subtree` is ignored. Those entries carry no `reason`, even with `reasons: true`.

## Used by

- [`schedule`](<https://docs.dhtmlx.com/planning-engine/wasm/api/schedule.md>) - `options_json`
- [`JsonProject.solve`](<https://docs.dhtmlx.com/planning-engine/wasm/api/project-solve.md>) - `options_json`

[`JsonProject.preview`](<https://docs.dhtmlx.com/planning-engine/wasm/api/project-preview.md>) takes the same `subtree`, `analytics` and `reasons` fields in its own options.

## Example

Reschedule the `phase` branch without its root task, report every task in it, and add critical path and slack:

```json
{
  "subtree": { "task": "phase", "inclusive": false },
  "analytics": { "criticalPath": true, "slack": true },
  "reasons": true,
  "includeUnchanged": true
}
```

## Related

- [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/schedule-result.md>) - the result these options shape
- [`PreviewOptions`](<https://docs.dhtmlx.com/planning-engine/wasm/api/project-preview.md#previewoptions>) - the `preview` options with the same fields
- [Reschedule a branch](<https://docs.dhtmlx.com/planning-engine/wasm/how-to/reschedule-a-branch.md>) - `subtree`
- [Critical path and slack](<https://docs.dhtmlx.com/planning-engine/wasm/scheduling/critical-path-and-slack.md>) - `analytics`
- [Load all task dates](<https://docs.dhtmlx.com/planning-engine/wasm/how-to/load-all-task-dates.md>) - `includeUnchanged`
