# WorkflowInstance

- [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/WorkflowInstance#SCHEMA_REPRESENTATION)
- [WorkflowInstanceStatusValue](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/WorkflowInstance#WorkflowInstanceStatusValue)

WorkflowInstance represents a workflow instance.

| JSON representation |
|---|
| ``` { "caseId": string, "workflowDefinitionIdentifier": string, "indicatorIdentifier": string, "triggerIdentifier": string, "workflowName": string, "status": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/WorkflowInstance#WorkflowInstanceStatusValue`), "priority": integer, "nestedInputParameters": string, "parentWorkflowStepInstanceName": string, "assignedUsers": [ string ], "messageToAssignee": string, "pendingStepTimeUnixTimeInMs": string, "runCount": integer, "parentInstanceId": string, "id": string, "tenantId": string, "blockStepId": string, "forMigrationValue0": boolean, "forMigrationValue1": boolean, "terminatedBySystem": boolean, "isDebug": boolean, "isSimulated": boolean, "isNested": boolean, "pendingStepIdentifier": string, "pendingStepExpirationTimeUnixTimeInMs": string, "pendingStepLoopIteration": integer, "originalWorkflowDefinitionIdentifier": string } ``` |

| Fields ||
|---|---|
| `caseId` | `string (https://developers.google.com/discovery/v1/type-format format)` Required. CaseId is the identifier of the case. |
| `workflowDefinitionIdentifier` | `string` Required. WorkflowDefinitionIdentifier is the identifier of the workflow definition. |
| `indicatorIdentifier` | `string` Optional. IndicatorIdentifier is the identifier of the indicator. |
| `triggerIdentifier` | `string` Required. TriggerIdentifier is the identifier of the trigger. |
| `workflowName` | `string` Required. WorkflowName is the name of the workflow. |
| `status` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/WorkflowInstance#WorkflowInstanceStatusValue`)`` Required. Status is the status of the workflow instance. |
| `priority` | `integer` Required. Priority is the priority of the workflow instance. |
| `nestedInputParameters` | `string` Optional. NestedInputParameters is a map containing the nested input parameters. |
| `parentWorkflowStepInstanceName` | `string` Optional. ParentWorkflowStepInstanceName is the name of the parent workflow step instance. |
| `assignedUsers[]` | `string` Optional. AssignedUsers is a list of assigned users. |
| `messageToAssignee` | `string` Optional. MessageToAssignee is the message to the assignee. |
| `pendingStepTimeUnixTimeInMs` | `string (https://developers.google.com/discovery/v1/type-format format)` Optional. PendingStepTimeUnixTimeInMs is the time when the step became pending. |
| `runCount` | `integer` Optional. RunCount is the number of times the workflow has been run. |
| `parentInstanceId` | `string (https://developers.google.com/discovery/v1/type-format format)` Optional. ParentInstanceId is the identifier of the parent instance. |
| `id` | `string (https://developers.google.com/discovery/v1/type-format format)` Required. Id is the unique identifier of the workflow instance. |
| `tenantId` | `string` Required. TenantId is the identifier of the tenant. |
| `blockStepId` | `string` Optional. BlockStepId is the identifier of the block step. |
| `forMigrationValue0` | `boolean` Optional. ForMigrationValue0 is a migration value. |
| `forMigrationValue1` | `boolean` Optional. ForMigrationValue1 is a migration value. |
| `terminatedBySystem (deprecated)` | `boolean` > [!WARNING] > This item is deprecated! Optional. TerminatedBySystem indicates if the workflow was terminated by the system. Deprecated - use Status==Terminated instead |
| `isDebug` | `boolean` Optional. IsDebug indicates if the workflow ran in debug mode. |
| `isSimulated` | `boolean` Optional. IsSimulated indicates if the instance was manually created by running the simulator. |
| `isNested` | `boolean` Optional. IsNested indicates if the instance is a nested instance. |
| `pendingStepIdentifier` | `string` Optional. PendingStepIdentifier is the identifier of the pending step. |
| `pendingStepExpirationTimeUnixTimeInMs` | `string (https://developers.google.com/discovery/v1/type-format format)` Optional. PendingStepExpirationTimeUnixTimeInMs is the time that after reaching it the pending step will get expired. |
| `pendingStepLoopIteration` | `integer` Optional. PendingStepLoopIteration is the loop iteration of the pending step. |
| `originalWorkflowDefinitionIdentifier` | `string` Optional. OriginalWorkflowDefinitionIdentifier is the identifier of the original workflow definition. |

## WorkflowInstanceStatusValue

WorkflowInstanceStatusValue is the status of the workflow instance.

| Enums ||
|---|---|
| `WORKFLOW_INSTANCE_STATUS_VALUE_UNSPECIFIED` | The status of the workflow instance is unspecified. |
| `IN_PROGRESS` | The workflow instance is in progress. |
| `COMPLETED` | The workflow instance is completed. |
| `FAILED` | The workflow instance is failed. |
| `TERMINATED` | The workflow instance is terminated. |
| `PENDING_IN_QUEUE` | The workflow instance is pending in the queue. |
| `PENDING_FOR_USER` | The workflow instance is pending for the user. |
| `PENDING_PREVIOUS_COMPLETION` | The workflow instance is pending for the previous completion. |