# WorkflowSnapshot

Source: /tuil/docs/reference/packages/workflow/api/workflow-snapshot
Locale: en

interface exported by @mwillbanks/tuil-workflow.



{/* Generated by tooling/docs/generate-reference.ts. */}

## interface [#interface]

Public interface exported by `@mwillbanks/tuil-workflow`.

```ts
export interface WorkflowSnapshot<TState> {
  readonly id: string;
  readonly version: number;
  readonly status: WorkflowStatus;
  readonly state: TState;
  readonly currentStep?: string;
  readonly completedSteps: readonly string[];
  readonly skippedSteps: readonly string[];
  readonly history: readonly string[];
  readonly errors: readonly string[];
  readonly operations: readonly OperationSnapshot[];
  readonly nestedWorkflow?: WorkflowSnapshot<unknown>;
  readonly parallel: readonly WorkflowParallelSnapshot[];
  readonly transitioning: boolean;
  readonly startedAt?: number;
  readonly completedAt?: number;
}
```

## Members [#members]

| Member           | Type                                     | Required | Description                                                                             | Related types                                                                                  |
| ---------------- | ---------------------------------------- | -------- | --------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `id`             | `string`                                 | Yes      | The `id` member uses the `string` contract.                                             | —                                                                                              |
| `version`        | `number`                                 | Yes      | The `version` member uses the `number` contract.                                        | —                                                                                              |
| `status`         | `WorkflowStatus`                         | Yes      | The `status` member uses the `WorkflowStatus` contract.                                 | [`WorkflowStatus`](/tuil/docs/reference/packages/workflow/api/workflow-status)                      |
| `state`          | `TState`                                 | Yes      | The `state` member uses the `TState` contract.                                          | —                                                                                              |
| `currentStep`    | `string \| undefined`                    | No       | The `currentStep` member uses the `string \| undefined` contract.                       | —                                                                                              |
| `completedSteps` | `readonly string[]`                      | Yes      | The `completedSteps` member uses the `readonly string[]` contract.                      | —                                                                                              |
| `skippedSteps`   | `readonly string[]`                      | Yes      | The `skippedSteps` member uses the `readonly string[]` contract.                        | —                                                                                              |
| `history`        | `readonly string[]`                      | Yes      | The `history` member uses the `readonly string[]` contract.                             | —                                                                                              |
| `errors`         | `readonly string[]`                      | Yes      | The `errors` member uses the `readonly string[]` contract.                              | —                                                                                              |
| `operations`     | `readonly OperationSnapshot<unknown>[]`  | Yes      | The `operations` member uses the `readonly OperationSnapshot<unknown>[]` contract.      | [`OperationSnapshot`](/tuil/docs/reference/packages/operations/api/operation-snapshot)              |
| `nestedWorkflow` | `WorkflowSnapshot<unknown> \| undefined` | No       | The `nestedWorkflow` member uses the `WorkflowSnapshot<unknown> \| undefined` contract. | [`WorkflowSnapshot`](/tuil/docs/reference/packages/workflow/api/workflow-snapshot)                  |
| `parallel`       | `readonly WorkflowParallelSnapshot[]`    | Yes      | The `parallel` member uses the `readonly WorkflowParallelSnapshot[]` contract.          | [`WorkflowParallelSnapshot`](/tuil/docs/reference/packages/workflow/api/workflow-parallel-snapshot) |
| `transitioning`  | `boolean`                                | Yes      | The `transitioning` member uses the `boolean` contract.                                 | —                                                                                              |
| `startedAt`      | `number \| undefined`                    | No       | The `startedAt` member uses the `number \| undefined` contract.                         | —                                                                                              |
| `completedAt`    | `number \| undefined`                    | No       | The `completedAt` member uses the `number \| undefined` contract.                       | —                                                                                              |

## Parameters [#parameters]

This declaration has no public members.

## Returns [#returns]

This declaration does not return a value.

## Throws [#throws]

No thrown errors are documented for this declaration.

## Related types [#related-types]

* [`WorkflowParallelSnapshot`](/tuil/docs/reference/packages/workflow/api/workflow-parallel-snapshot)
* [`WorkflowStatus`](/tuil/docs/reference/packages/workflow/api/workflow-status)

## Source [#source]

[View the secondary source reference](https://github.com/mwillbanks/tuil/blob/main/packages/workflow/src/index.ts)

## Package [#package]

[@mwillbanks/tuil-workflow](/tuil/docs/reference/packages/workflow)
