> For the complete documentation index, see [llms.txt](https://specs.govstack.global/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://specs.govstack.global/workflow/7-data-structures.md).

# 7 Data Structures

This section provides information on the core data structures/data models that are used by this Building Block.

## 7.1 Resource Model

The full resource model is described in detail in the [API Specification](https://github.com/GovStackWorkingGroup/bb-workflow/blob/23Q4/api/swagger.yaml), but the following is a high-level diagram of the key entities.

![Diagram Source](https://798676149-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxvrgZVk1bp2PoPldb2xI%2Fuploads%2Fgit-blob-736cd906cff209af7113b298653cb11a8b5935b6%2Fdata-structures.png?alt=media)

## 7.2 Data Elements

The data elements listed below provide detail for the resource model defined by the swagger specification. This section lists the required fields for each resource. The data elements listed are extensible in order to respond to specific use cases, however, the data elements listed below are a minimum requirement.

### 7.2.1 Process

**Description:** Represents a process that has been successfully created in a Workflow engine. This object contains important reference details like the generated process UUID (universally unique identifier), which is required to perform further operations on the process.

| Name              | Type                                          | Description                                 | Notes                                |
| ----------------- | --------------------------------------------- | ------------------------------------------- | ------------------------------------ |
| id                | integer                                       | generated by a system surrogate primary key | Required: false. Restrictions: none. |
| processDefinition | [ProcessDefinition](#7.2.2-processdefinition) | none                                        | Required: false. Restrictions: none. |

### 7.2.2 ProcessDefinition

**Description:** Reference to a blueprint of a process. Contains all the fields required to create a new process for a workflow engine.

| Name         | Type                                        | Description                                                                                              | Notes                                |
| ------------ | ------------------------------------------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------ |
| name         | string                                      | name of a process                                                                                        | Required: true. Restrictions: none.  |
| type         | string                                      | none                                                                                                     | Required: true. Restrictions: none.  |
| version      | string                                      | none                                                                                                     | Required: true. Restrictions: none.  |
| isExecutable | boolean                                     | Specifies whether the Process is executable                                                              | Required: false. Restrictions: none. |
| isClosed     | boolean                                     | whether Messages and Events, not modeled in Process, can occur when the Process is executed or performed | Required: false. Restrictions: none. |
| description  | string                                      | none                                                                                                     | Required: false. Restrictions: none. |
| processBody  | [ListOfProperties](#7.2.5-listofproperties) | none                                                                                                     | Required: false. Restrictions: none. |

### 7.2.3 ProcessInstance

**Description:** Used to list a single or list of process instances that are in various states like active, suspended or stopped, in a Workflow engine.

| Name           | Type    | Description                                 | Notes                                |
| -------------- | ------- | ------------------------------------------- | ------------------------------------ |
| id             | integer | generated by a system surrogate primary key | Required: false. Restrictions: none. |
| processRef     | integer | reference to the process definition         | Required: false. Restrictions: none. |
| initTime       | string  | Initiation Timestamp                        | Required: false. Restrictions: none. |
| state          | string  | see BPMN specification v.2.0 section 13.2.2 | Required: false. Restrictions: none. |
| lastChangeTime | string  | last change Timestamp                       | Required: false. Restrictions: none. |

### 7.2.4 ProcessInstancePayload

**Description:** Initiates a process execution or creates a process instance. Contains the ability to capture input values that may be required to start a new process instance.

| Name             | Type                                        | Description | Notes                                |
| ---------------- | ------------------------------------------- | ----------- | ------------------------------------ |
| processStartedBy | string                                      | none        | Required: true. Restrictions: none.  |
| instanceValues   | [ListOfProperties](#7.2.5-listofproperties) | none        | Required: false. Restrictions: none. |

### 7.2.5 ListOfProperties

| Name  | Type   | Description | Notes                                |
| ----- | ------ | ----------- | ------------------------------------ |
| code  | string | none        | Required: false. Restrictions: none. |
| value | string | none        | Required: false. Restrictions: none. |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://specs.govstack.global/workflow/7-data-structures.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
