---
url: "https://vueda.dev/v3/reference/api/js/stores/storeWorkflow/methods/fetchObjectHistory.md"
title: "fetchObjectHistory"
---

# fetchObjectHistory

## Overview

Fetches the recorded workflow states of one object and caches them in `objectHistories`.

A cached history resolves at once, and a cached error rejects at once. A request already in
flight for the same object is shared. A transition that `executeTransition` runs on the object
drops its cached history, so the next call fetches it again. A request that was already in flight
when the transition ran still resolves for its callers, and its history is not cached.

## Signature

`fetchObjectHistory(app, model, objectPk)`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| <span id="param-app">app</span> | `string` | yes | Django app label. |
| <span id="param-model">model</span> | `string` | yes | Model name. |
| <span id="param-objectPk">objectPk</span> | `string` | yes | The object's primary key. |

### Returns

`Promise`

A promise for the object's history, oldest first. It
 resolves to an empty array when workflow is off or the model does not enable it. It rejects
 with `WorkflowError` when the request fails. The server answers with a 404 for an object that
 has no workflow state, so the history of that object also rejects with `WorkflowError`.

## Source

`client/lib/stores/storeWorkflow.js:430`
