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

# executeTransition

## Overview

Runs a workflow transition on one object or on several objects in one request.

A run that is not a dry run drops the cached workflow state history of each object it ran on,
and a history request still in flight for that object does not cache its result.
When `router` and `stateToRoute` are given and the new state code is a key of `stateToRoute`,
the router then navigates to that route.

## Signature

`executeTransition(app, model, objectPk, transitionCode, router, stateToRoute, dryRun, acknowledgeWarnings)`

### 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 \| string[]` | yes | The object's primary key, or an array of keys for a bulk run. |
| <span id="param-transitionCode">transitionCode</span> | `string` | yes | The code of the transition to run. |
| <span id="param-router">router</span> | `Router` | no | The router to navigate with after the run. |
| <span id="param-stateToRoute">stateToRoute</span> | `object` | no | The route  to navigate to for each new state code. |
| <span id="param-dryRun">dryRun</span> | `boolean` | no | Whether the server validates the transition and rolls it back. |
| <span id="param-acknowledgeWarnings">acknowledgeWarnings</span> | `string` | no | The warning digest the user acknowledged, sent in the  `Acknowledge-Warnings` header. |

### Returns

`Promise`

A promise for the server response. A bulk run resolves to one result per primary key. It
 resolves to an empty array when workflow is off. It rejects with `FormValidationError` on a
 400, `ConfirmationRequiredError` on a 409, and `WorkflowError` for other failures.

## Source

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