> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# BatchTask table

> Batch task request details, corresponding to the message body of a batch request message

## BatchTask Table (243)

Batch task request details, corresponding to the message body of a batch request message

## Fields

| Name                      | Description                                                                                          | Type                                                | Nullable |
| ------------------------- | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------- | :------: |
| BatchTask\_id             | Primary key                                                                                          | PK                                                  |    No    |
| BatchTaskDefinition\_id   | Batch task definition, which is populated from code attributes                                       | FK [BatchTaskDefinition](./batchtaskdefinition.mdx) |    Yes   |
| description               | Description of task (for monitoring and debugging)                                                   | String(254)                                         |    No    |
| dbTag                     | Database tag that this task applies to, to ensure tasks are execute on the correct database only     | String(39)                                          |    No    |
| state                     | 0=Unknown; 1=New; 2=Assigned; 3=Started; 4=Succeeded; 5=Failed                                       | Int                                                 |    No    |
| detailsTable              | Optional table containing further details that will not fit in the standard request/response fields  | TableNumber                                         |    Yes   |
| detailsRecord             | Optional record containing further details that will not fit in the standard request/response fields | RecordId                                            |    Yes   |
| request                   | The batch request, specifying what to do                                                             | String(254)                                         |    Yes   |
| response                  | The response from the batch task processor                                                           | String(254)                                         |    Yes   |
| startCount                | Number of times this batch task has been started (0 for tasks that have never been executed)         | Id                                                  |    Yes   |
| lastStarted               | When was this job last started                                                                       | DateTime                                            |    Yes   |
| progressPercent           | Task progress, in percent of estimated total                                                         | UShort                                              |    Yes   |
| progressDescription       | Descriptive text for the current stage                                                               | String(254)                                         |    Yes   |
| registered                | Registered when                                                                                      | UtcDateTime                                         |    No    |
| registered\_associate\_id | Registered by whom                                                                                   | FK [associate](./associate.mdx)                     |    No    |
| updated                   | 'heartbeat' that is updated once a minute by the batch task process                                  | UtcDateTime                                         |    No    |
| updated\_associate\_id    | 'heartbeat' that is updated once a minute by the batch task process                                  | FK [associate](./associate.mdx)                     |    No    |
| updatedCount              | 'heartbeat' that is updated once a minute by the batch task process                                  | UShort                                              |    No    |
| FileName                  | The filename related to the batchtask.                                                               | String(260)                                         |    Yes   |

<img src="https://mintcdn.com/superofficeas/-KbDeS3ObOMH8eFq/media/loc/en/database/tables/BatchTask.png?fit=max&auto=format&n=-KbDeS3ObOMH8eFq&q=85&s=554b08411b98eed80add0903214711e0" alt="BatchTask table relationship diagram" width="753" height="59" data-path="media/loc/en/database/tables/BatchTask.png" />

## Indexes

| Fields                         | Types   | Description |
| ------------------------------ | ------- | ----------- |
| state                          | Int     | Index       |
| BatchTaskDefinition\_id, state | FK, Int | Index       |

## Relationships

| Table                                        | Description                                                                                     |
| -------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| [associate](./associate)                     | Employees, resources and other users - except for External persons                              |
| [BatchTaskDefinition](./batchtaskdefinition) | Batch task definitiopns, populated from the SuperOffice.CRM.BatchProcessing.BatchTask attribute |

## Replication Flags

* None

## Security Flags

* No access control via user's Role.


## Related topics

- [BatchTasks](/en/api/archive-providers/reference/batchtasks.md)
- [BatchTaskDefinition table](/en/database/tables/batchtaskdefinition.md)
- [Update Batch Task](/en/api/reference/restful/rest/batch/update-batch-task.md)
- [Get Batch Task Info](/en/api/reference/restful/rest/batch/get-batch-task-info.md)
- [Start Batch Job](/en/api/reference/restful/rest/batch/start-batch-job.md)
