SharePoint Workflow Status Codes

Trying to filter a list on its workflow status is pretty non-intuitive. You need the special status codes. Theese will work with all workflows in ShaePoint even Nintex workflows.

Status Code

Status Description

0

Not Started

1

Failed on Start

2

In Progress

3

Error Occurred

4

Cancelled (i.e. Stopped by User)

5

Completed

6

Failed on Start (retrying)

7

Error Occurred (retrying)

8

(unknown)

9

(unknown)

10

(unknown)

11

(unknown)

12

(unknown)

13

(unknown)

14

(unknown)

15

Cancelled

16

Approved

17

Rejected

Theese status codes can be used in editing list view query in both the user interface and the CAML in the list schema.xml

image005

 

image006

Another little special SharePoint speciality is that the workflow status field is referenced as the 8 first letters in the workflow instance name and the value type as WorkflowStatus

References: