Export stage history

Export Stage History allows you to download a record of the stages an item has passed through in a V7 Darwin workflow, together with a snapshot of its annotations when it exited each stage.

Use stage history to review annotation changes throughout a workflow, compare the results of annotation and review stages, or restore an item's annotations to an earlier version.

Include stage history in an export

Stage history is available when exporting annotations in Darwin JSON 2.0 format. You can enable it through the Darwin UI, API, or darwin-py CLI.

From the Darwin interface

  1. Open your dataset's Export panel.
  2. Create an export using Darwin JSON 2.0.
  3. Select Include full stage history.
  4. Generate and download the export.

Include full stage history option in the export configuration window


Using the API

When creating an export, set include_stage_history: true in the Create an export API request.

{
  "include_stage_history": true
}

To include worker information, also enable include_authorship. This adds available user details, such as names and email addresses, and annotator and reviewer information to the exported history.

Using darwin-py:

Create an export with stage history enabled:

  • darwin dataset export <dataset> <release> --version 2.0 --include-stage-history
    

Then download the annotation files:

darwin dataset pull <dataset>:<release> --only-annotations

Understand the exported files

In addition to the standard annotation files, the export contains a stage_history directory with a separate folder for each item:

stage_history/
  <item id>/
    visits.json                  # every stage visit of the item, in order
    <stage instance id>.json     # annotations at the end of that visit (Darwin JSON 2.0)

When downloaded using darwin dataset pull, the files are located at:

<dataset>/releases/<release>/stage_history/

Stage visits (visits.json )

The visits.json file contains the item's workflow history, including the stage visited, when the item entered and exited the stage, and whether an annotation snapshot is available.

For example:

{
  "version": "1.1",
  "item_id": "0191...",
  "visits": [
    {
      "stage_instance_id": "8f2c...",
      "parent_stage_id": null,
      "stage": {"id": "...", "name": "Annotate", "type": "annotate"},
      "status": "completed",
      "entered_at": "2026-11-02T09:14:03Z",
      "exited_at": "2026-11-02T10:02:41Z",
      "exited_by": {"type": "user", "id": 123},
      "exit_snapshot": {"status": "exported", "file": "8f2c....json"}
    },
    {
      "stage_instance_id": "a71d...",
      "parent_stage_id": null,
      "stage": {"id": "...", "name": "Consensus", "type": "consensus_entrypoint"},
      "status": "completed",
      "entered_at": "2026-11-02T10:02:41Z",
      "exited_at": "2026-11-02T10:02:41Z",
      "exited_by": {"type": "system", "id": null},
      "exit_snapshot": {"status": "none", "file": null, "reason": "pass_through"}
    }
  ]
}

Key fields

FieldDescription
stage_instance_idIdentifies an individual visit to a workflow stage and its corresponding snapshot, if available.
parent_stage_idIdentifies the parent consensus stage for an annotator's visit within a consensus stage. Otherwise, null.
stageThe visited stage's ID, name, and type.
statusThe visit's status: completed (the item advanced through the workflow), overriden (the item was moved using Set Stage), or current (the item remains in the stage).
entered_at / exited_atThe timestamps for entering and leaving the stage.
exited_byThe actor that ended the visit: user, model, or system, together with its ID. If include_authorship is enabled, user details can also include email and full_name.
exit_snapshot.statusexported if an annotation snapshot is available, or none if no snapshot is available.
exit_snapshot.fileThe filename of the snapshot, when one has been exported.
exit_snapshot.reasonExplains why no snapshot is available (see below).

The exit_snapshot.reason field can contain the following values:

ValueMeaning
currentThe item is still in the stage, so the visit has not ended.
pass_throughThe stage does not modify annotations, such as a consensus entry stage or AI review stage.
not_recordedNo snapshot was stored for this visit, typically because it occurred before snapshot recording was supported.

Annotation snapshots

Each <stage instance id>.json file is a standard Darwin JSON 2.0 annotation file representing the item at the end of a specific stage visit.

Snapshots include annotations across frames, classes, annotation properties, and item properties, including classes and properties that have subsequently been deleted. When authorship metadata is included, annotations also contain the annotators and reviewers associated with them at the time the snapshot was recorded.

Restore annotations from an earlier stage

You can now use a recorded snapshot to restore an item's annotations to their state at the end of a previous stage visit.

  1. Export and download the dataset with Include full stage history enabled.
  2. Open stage_history/<item id>/visits.json.
  3. Find the visit you want to restore and check that exit_snapshot.status is exported.
  4. Locate the corresponding <stage instance id>.json snapshot.
  5. Import the snapshot over the existing item using darwin-py:
darwin dataset import <dataset> darwin "stage_history/<item id>/<stage instance id>.json" --overwrite --yes

The item's annotations, annotation properties, and item properties are restored to the snapshot's recorded values.
Notes:

  • Overwriting annotations creates new annotation IDs
  • This process restores annotation data from a snapshot. It does not, by itself, move the item back to the original workflow stage..

Read stage history with Python

You can also inspect stage visits and access snapshots programmatically using darwin-py :

from darwin.dataset.stage_history import read_stage_history

visits = read_stage_history(release_path / "stage_history" / item_id)

for visit in visits:
    print(visit.stage["name"], visit.exited_at, visit.exit_snapshot["status"], visit.reason)
    annotations = visit.snapshot()  # parsed Darwin JSON, or None

Important considerations

  • Historical availability. Stage history only includes annotation snapshots from visits for which snapshots were recorded. For items moved using Set Stage in the interface or API, snapshots have been recorded since 19 October 2026. Earlier visits moved this way may have an exit_snapshot.reason value of not_recorded.
  • Annotator and reviewer metadata. Authorship information in snapshots is available for snapshots recorded after the November 2026 release. Earlier snapshots may not contain this information.
  • Export size. Including stage history can significantly increase the size of an export, particularly for long videos or items with numerous stage visits. A video with extensive history may add tens of megabytes. Consider filtering the export to the items you need.
  • Annotation IDs. Importing snapshots with --overwrite recreates annotations with new IDs. Do not rely on annotation IDs alone to match annotations across independently restored versions.

Did this page help you?