# Workflow Process Instance The `WorkflowProcessInstance` table is part of the [SQLite database schema](https://docs.workflowengine.io/database-schema/sqlite/) used by Workflow Engine. The `WorkflowProcessInstance` table stores the current state and execution metadata for process instances. This page lists the table columns in database order together with types, nullability, primary keys, defaults, and indexes. ## Table columns The `WorkflowProcessInstance` table contains 18 columns in database order. Data types and default expressions use the syntax defined by SQLite. Table: WorkflowProcessInstance columns | Position | Column | Database type | Nullable | Primary key | Default | |----------|--------|---------------|----------|-------------|---------| | 1 | `Id` | `TEXT` | No | Yes | - | | 2 | `StateName` | `TEXT` | Yes | No | - | | 3 | `ActivityName` | `TEXT` | No | No | - | | 4 | `SchemeId` | `TEXT` | No | No | - | | 5 | `PreviousState` | `TEXT` | Yes | No | - | | 6 | `PreviousStateForDirect` | `TEXT` | Yes | No | - | | 7 | `PreviousStateForReverse` | `TEXT` | Yes | No | - | | 8 | `PreviousActivity` | `TEXT` | Yes | No | - | | 9 | `PreviousActivityForDirect` | `TEXT` | Yes | No | - | | 10 | `PreviousActivityForReverse` | `TEXT` | Yes | No | - | | 11 | `ParentProcessId` | `TEXT` | Yes | No | - | | 12 | `RootProcessId` | `TEXT` | No | No | - | | 13 | `TenantId` | `TEXT` | Yes | No | - | | 14 | `StartingTransition` | `TEXT` | Yes | No | - | | 15 | `SubprocessName` | `TEXT` | Yes | No | - | | 16 | `CreationDate` | `INTEGER` | No | No | `(CAST(strftime('%s', 'now') AS INTEGER) * 10000000) + 621355968000000000` | | 17 | `LastTransitionDate` | `INTEGER` | Yes | No | - | | 18 | `CalendarName` | `TEXT` | Yes | No | - | ## Database indexes The `WorkflowProcessInstance` table defines 3 database indexes. Definitions retain the column or field order and sort direction used by the database. Table: WorkflowProcessInstance indexes | Index | Unique | Definition | |-------|--------|------------| | `WorkflowProcessInstance_CalendarName_idx` | No | `CREATE INDEX "WorkflowProcessInstance_CalendarName_idx" ON "WorkflowProcessInstance" ("CalendarName")` | | `WorkflowProcessInstance_RootProcessId_idx` | No | `CREATE INDEX "WorkflowProcessInstance_RootProcessId_idx" ON "WorkflowProcessInstance" ("RootProcessId")` | | `sqlite_autoindex_WorkflowProcessInstance_1` | Yes | `Id` |