# Real Time Data Export Data Model

> Every change in the system is represented by an event logged JSON format.

## Overview

Every change in the system is represented by an event logged JSON format.

The following event types are supported:

* Events describing jobs:
  + `job.created`
  + `job.started`
  + `job.stopped`
  + `job.pending`
  + `job.completed`
  + `job.faulted`
  + `job.stopping`
  + `job.terminating`
* Events describing queue items:
  + `queueitem.added`
  + `queueItem.deferred`
  + `queueItem.reviewStatusChanged`
  + `queueItem.retried`
  + `queueItem.updated`
  + `queueItem.transactionAbandoned`
  + `queueItem.transactionCompleted`
  + `queueItem.transactionFailed`
  + `queueItem.transactionRetried`
  + `queueItem.transactionStarted`
    :::note
    The following fields will be removed from the `queueItem.deferred` and `queueItem.reviewStatusChanged` events:
    * SpecificData
    * SpecificContent
    * Output
    :::
* Events describing machines:
  + `machine.created`
  + `machine.updated`
  + `machine.deleted`
  + `machineSession.status`
  + `machine.assign`
  + `machine.unassign`
* Events describing robot logs:
  + `robotlog`

Because different events describe different entities and changes to the system, they have different content (JSON fields).

## Format and Schema of Events

Each event is delivered in JSON format and has the following:

* Event-specific body
* Common fields
* Metadata

For a better understanding, check the following example for a `job.created` event. The example is formatted with new lines and comments describing each section for readability. Real events do not have this formatting and are delivered as a single-line string.

```
{
    /*********************
            event-specific body
    **********************/
    "body": {
        "Job": {
            "Key": "<job-key>",
            "CreationTime": null,
            "State": "Pending",
            "StartTime": "<job-start-time>",
            "EndTime": null,
            "ProcessName": "<process-name>",
          "DisplayName": "<display-name>",
            "RobotName": "<robot-name>",
            "HostMachineName": "<host-machine-name>"
        },
    /*********************
            common fields
    **********************/
        "EventType": "job.started",
        "SchemaVersion": "0.0.1",
        "Timestamp": "<timestamp>",
        "TenantKey": "<tenant-key>",
        "TenantName": "<tenant-name>",
        "FolderName": "<folder-name>",
        "FullFolderPath": "<folder-path>",
        "FolderKey": "<folder-key>"
        },
    /*********************
            metadata
    **********************/
    "x-opt-sequence-number": <sequence-number>,
    "x-opt-offset": "<offset>",
    "x-opt-enqueued-time": <enqueued-time>,
    "Diagnostic-Id": "<diagnostic-id>"
}
```

## Common Fields

Common fields appear in every event.

| Name | Type | Description |
| --- | --- | --- |
| **EventType** | `string` | The type of event. |
| **SchemaVersion** | `string` | The version of the schema. Different versions may have different event types and fields supported. |
| **Timestamp** | `timestamp` | UTC timestamp of the event. |
| **TenantKey** | `Guid` | The unique identifier of the tenant that generated the event. |
| **TenantName** | `string` | Name of the tenant that generated the event. |
| **FolderName** | `string` | Name of the Orchestrator folder in which the event was generated. |
| **FullFolderPath** | `string` | If a folder is a subfolder of another folder, this field displays the full path. |
| **FolderKey** | `Guid` | The unique identifier of the folder. |

```
{
    "EventType": "queueItem.transactionCompleted",
    "SchemaVersion": "0.0.1",
    "Timestamp": "<timestamp>",
    "TenantKey": "<tenant-key>",
    "TenantName": "<tenant-name>",
    "FolderName": "<folder-name>",
    "FullFolderPath": "<folder-path>",
    "FolderKey": "<folder-key>"
}
```

## Job Events

| Name | Type | Description |
| --- | --- | --- |
| **Key** | `Guid` | Unique identifier of a job. |
| **CreationTime** | `timestamp` | Timestamp when the job was created. |
| **StartTime** | `timestamp` | Timestamp when the job started. |
| **EndTime** | `timestamp` | Timestamp when the job completed. |
| **State** | `string` |The state of job. Supported values: `Pending``Running``Stopping``Terminating``Faulted``Successful``Stopped``Suspended``Resumed`|
| **ProcessName** | `string` | Name of the package that the job was created from. |
| **DisplayName** | `string` | Name provided to a process in Orchestrator. |
| **RobotName** | `string` | Name of the robot executing the job. |
| **HostMachineName** | `string` | Machine on which the job is being executed. |

```
{
    "body": {
        "Job": {
        "Key": "<job-key>",
        "CreationTime": "<creation-time>",
        "State": "Running",
        "StartTime": "<start-time>",
        "EndTime": null,
        "ProcessName": "<process-name>",
        "DisplayName": "<display-name>",
        "RobotName": "<robot-name>",
        "HostMachineName": "<host-machine-name>",
    },
    ... common fields ...
    "EventType": "job.started",
    ... more common fields ...
}
```

## Queue Item Events

| Name | Type | Description |
| --- | --- | --- |
|  |  |  |
| **QueueItem** | **JSON object** |  |
|  |  |  |
| **Key** | `Guid` | Unique identifier of the queue item. |
| **QueueDefinitionId** | `number` | Numeric identifier of a queue that the queue item belongs to. |
| **Status** | `string` |The status of the queue item. Supported values: `New``InProgress``Failed``Successful``Abandoned``Retried``Deleted``Unknown`|
| **ReviewStatus** | `string` |The review status of the queue item. Supported values: `None``InReview``Verified``Retried``Unknown`|
| **DueDate** | `datetime` | Latest date and time at which the item should be processed. |
| **Priority** | `string` |The priority of the queue item. Supported values: `High``Normal``Low``Unknown`|
| **CreationTime** | `datetime` | Timestamp when the queue item was created. |
| **StartProcessing** | `datetime` | Timestamp when the queue item started processing. |
| **EndProcessing** | `datetime` | Timestamp when the queue item finished processing (successfully or not). |
| **DefferDate** | `datetime` | The earliest date and time at which the item should be available for processing. If empty, the item can be processed as soon as possible. |
| **SecondsInPreviousAttempt** | `number` | The number of seconds that the last failed processing attempt lasted. |
| **RetryNumber** | `number` | The number of times this queue item has been processed. |
| **Progress** | `string` | String filed added by developers in **UiPath Studio** which is used to keep track on the business flow progress. |
| **AnalyticsData** | `string` | A collection of key-value pairs containing the data from the `Analytics` property added by developers in Studio via the **Set Transaction Status** activity. |
| **Output** | `string` | A collection of key-value pairs containing the data from the `Output` property added by developers in Studio via the **Set Transaction Status** activity. |
| **SpecificData** | `string` | A collection of key-value pairs containing the data from the `Specific Content` property added by developers in Studio via the **Set Transaction Status** activity.  A collection of key value pairs containing custom data configured in the **Add Queue Item** activity in  **UiPath Studio**. |
| **CreatorJobId** | `number` | The ID of the job that created the queue item. |
| **ExecutorJobId** | `number` | The ID of the job that executed the queue item. |
| **ProcessExceptionReason** | `string` | Summary of reason the queue item processing failed. |
| **ProcessExceptionDetails** | `string` | Additional details on the queue item failure. |
| **ProcessExceptionType** | `string` |For queue items that finished with an error this field describes the type of error (exception). Supported values: `ApplicationException``BusinessException``None`|
|  |  |  |
| **Queue** | **JSON Object** |  |
|  |  |  |
| **Key** | `Guid` | Unique identifier of the queue. |
| **Name** | `string` | The name of the queue. |
| **Description** | `string` | Additional information about a queue in order to better identify it. |
| **MaxNumberOfRetries** | `number` | The number of times an item of this queue can be retried if its' processing fails. |
| **EnforceUniqueReference** | `boolean` | States whether the `Item Reference` field should be unique per Queue item. |
| **SlaInMinutes** | `number` | Integer value representing the Queue SLA in minutes. |
| **RiskSlaInMinutes** | `number` | Integer value representing the Queue Risk SLA in minutes. |
|  |  |  |

```
{
    "body": {
        "QueueItem": {
            "Key": "<queue-item-key>",
            "QueueDefinitionId": <queue-definition-id>,
          "Status": "New",
            "ReviewStatus": "None",
            "DueDate": "<due-date>",
            "Priority": "High",
            "CreationTime": "<creation-time>",
            "StartProcessing": "<start-processing-time>",
            "EndProcessing": null,
            "DefferDate": "<deffer-time>",
            "SecondsInPreviousAttempt": 0,
            "RetryNumber": 1,
            "Progress": "<progress>",
            "ProcessExceptionReason": null,
            "ProcessExceptionDetails": null,
            "ProcessExceptionType": null
        },
        "Queue": {
            "Key": "<queue-key>",
            "Name": "<queue-name>",
            "Description": "<queue-description>",
            "MaxNumberOfRetries": 1,
            "EnforceUniqueReference": false,
            "SlaInMinutes": 0,
            "RiskSlaInMinutes": 0
        },
    },
    ... common fields ...
}
```

## Machine Session Events

| Name | Type | Description |
| --- | --- | --- |
| **MachineKey** | `Guid` | Unique identifier of the machine. |
| **MachineName** | `string` | Custom name of the machine. |
| **HostMachineName** | `string` | Name of the host machine which is mapped to the UiPath machine. |
| **ServiceUsername** | `string` | Name of the user under which the robot service on the machine is running. |
| **MachineStatus** | `string` |Status of the machine. Supported values: `Available``Busy``Disconnected``Unknown`|
| **Timestamp** | `datetime` | Timestamp of the machine session event. |
| **IsUnresponsive** | `boolean` |A check to see if the machine is responsive to connection from Orchestrator. Supported values: `true``false`  A machine can still be available but be unresponsive. Once it is unresponsive for ten minutes, it becomes disconnected or unknown.|

```
{
    "body": {
        "MachineSession": {
            "MachineKey": "<machine-key>",
            "MachineName": "<machine-name>",
            "MachineId": <machine-id>,
            "HostMachineName": "<host-machine-name>",
            "ServiceUsername": "<service-username>",
            "MachineStatus": "Disconnected",
            "ReportingTime": "<reporting-time>",
            "IsUnresponsive": false
        },
        ... common fields ...
        "EventType":"machineSession.status",
        ... more common fields ...
}
```

## Machine Events

| Name | Type | Description |
| --- | --- | --- |
| **AutomationCloudSlots** | `number` | Number of **Automation Cloud**<sup>&lt;b&gt;TM&lt;/b&gt;</sup> slots to be reserved at runtime. |
| **HeadlessSlots** | `number` | Number of Headless slots to be reserved at runtime. |
| **MachineId** | `number` | Machine integer id, unique per Orchestrator instance. |
| **MachineKey** | `Guid` | Unique identifier of a machine. |
| **MachineName** | `string` | Custom name of the machine. |
| **NonProductionSlots** | `number` | Number of `NonProduction` slots to be reserved at runtime. |
| **UnattendedSlots** | `number` | Number of `Unattended` slots to be reserved at runtime. |

```
{
    "body": {
        "Machine": {
            "MachineName": "<machine-name>",
            "MachineKey": "<machine-key>",
            "NonProductionSlots": 1,
            "HeadlessSlots": 0,
            "AutomationCloudSlots": 0,
            "UnattendedSlots": 0
        },
        ... common fields ...
}
```

## Machine Assign Events

| Name | Type | Values |
| --- | --- | --- |
| **MachineKey** | `Guid` | Unique identifier of a machine. |
| **MachineName** | `string` | Custom name of the machine. |

```
{
    "body": {
        "MachineAssign": {
            "MachineKey": "<machine-key>",
            "MachineName": "<machine-name>"
        },
        "EventType": "machine.unassigned",
        ... common fields ...
    }
}
```

## Robot Logs

| Name | Type | Description |
| --- | --- | --- |
| **FileName** | `string` | The name of the `.xaml` file being executed. |
| **InitiatedBy** | `string` |The source of the execution. Possible values: `Assistant``Studio``StudioX``StudioPro``Orchestrator``CommandLine``RobotAPI`|
| **JobId** | `string`/`guid` | The `JobKey`, a unique identifier for the job. |
| **Level** | `string` |Logging level of the log. Possible values: `Trace``Info``Warn``Error``Fatal`|
| **LogType** | `string` |The type of the robot log. Possible values: `User``Default``Error``Business``ExecutionStep``BusinessIteration``Info``Security``Technical`|
| **MachineId** | `number` | Machine integer id, unique per Orchestrator instance. |
| **MachineName** | `string` | Custom name of the machine. |
| **Message** | `string` |The message of the robot log. Possible values: `execution started``execution ended`custom message|
| **ProcessName** | `string` | The process name the robot is executing. |
| **ProcessVersion** | `string` | The version of the process. |
| **RobotName** | `string` | The name of the robot. |
| **WindowsIdentity** | `string` | The name of the user that performed the action that was logged. |
| **ProcessingExceptionReason** | `string` | The reason for the exception. Only present in Transaction End logs. |
| **ProcessingExceptionType** | `string` |The type of the exception. Only present in Transaction End logs. Possible values: `ApplicationException``BusinessException`|
| **QueueItemPriority** | `string` |The priority of the queue item. Only present in Transaction End logs. Possible values: `High``Normal``Low`|
| **QueueItemReviewStatus** | `string` |The review status of the queue item. Only present in Transaction End logs. Possible values: `InReview``Verified``Reported``Retried`|
| **QueueName** | `string` | The queue name from which the robot is executing queue items. |
| **TransactionExecutionTime** | `number` | The execution time in seconds for the transaction. Only has values when processing queue items. |
| **TransactionId** | `string`/`Guid` | The unique key of the transaction. Only has values when processing queue items. |
| **TransactionState** | `string` |The transaction state. Only has values when processing queue items. Possible values: `Started``Ended``Postponed`|
| **TransactionStatus** | `string` |The transaction status. Only has values when processing queue items. Possible values: `ApplicationException``Start``SystemError``Failed``BusinessException``Success``InProgress`|
| **TotalExecutionTimeInSeconds** | `number` | The execution time for the transaction, measured in seconds. Only has values when processing queue items. |
| **ActivityInfo** | `JSON` | The activity info JSON containing `DisplayName`, `State` (`Faulted`, `Closed`, or `Executing`), `Activity`, and `Arguments`. |
| **Timestamp** | `datetime` | Time the event was generated. |
| **MachineKey** | `Guid` | Unique identifier of the machine executing the job. |
| **CustomFields** | `JSON` | A JSON that contains the fields defined in the **AddLogFields** activity in Studio. |

```
{
    "body": {
        "Level": "Info",
        "MachineKey": "<machine-key>",
        "RobotLog": {
            "Message": "Transaction Ended",
            "Level": "Information",
            "LogType": "Default",
            "CustomFields": {
                "Custom fields 1": "value1",
                "Custom fields 2": 2,
            },
        "TimeStamp": "<timestamp>",
        "Fingerprint": "<fingerprint>",
        "WindowsIdentity": "<windows-identity>",
        "MachineName": "<machine-name>",
        "FileName": "<filename>",
        "TransactionExecutionTime": 0.6733966,
        "QueueItemPriority": "Normal",
        "ProcessingExceptionReason": "",
        "TransactionStatus": "Successful",
        "QueueName": "<queue-name>",
        "TransactionState": "Ended",
        "ProcessingExceptionType": "",
        "TransactionId": "<transaction-id>",
        "QueueItemReviewStatus": "None",
        "ProcessName": "<process-name>",
        "ProcessVersion": "1.0.6",
        "JobId": "<job-id>",
        "RobotName": "<robot-name>",
        "MachineId": <machine-id>,
        "OrganizationUnitId": <organization-unit-id>
        },
        "EventType": "robotlog",
        ... common fields ...
    },
}
```
