> ## 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.

# schedule table

> Generic scheduled tasked handling time scheduling, locking and error messages

## schedule Table (379)

Generic scheduled tasked handling time scheduling, locking and error messages

## Fields

| Name                | Description                                             | Type                          | Nullable |
| ------------------- | ------------------------------------------------------- | ----------------------------- | :------: |
| id                  | Primary key                                             | PK                            |    No    |
| domain              | Type of scheduled task                                  | domain                        |    Yes   |
| status              | Schedules current status                                | status                        |    Yes   |
| frequency           | Type of schedule algorithm to use                       | frequency                     |    Yes   |
| asap                | Run schedule ASAP                                       | Bool                          |    No    |
| disabled            | Disable the schedule                                    | Bool                          |    No    |
| stop                | Signal to stop schedule                                 | Bool                          |    No    |
| name                | Name of the schedule                                    | String(255)                   |    Yes   |
| after\_schedule\_id | Run after another schedule have completed               | FK [schedule](./schedule.mdx) |    Yes   |
| minute\_interval    | Interval in minutes, used by Minutely                   | Int                           |    Yes   |
| weekdays            | Bitfield: which days of the week to run                 | Int                           |    Yes   |
| months              | Bitfield: which months of the year to run               | Int                           |    Yes   |
| min\_of\_hour       | Run at a given minute in an hour                        | Int                           |    Yes   |
| day\_of\_month      | What day of month to run                                | Int                           |    Yes   |
| time\_of\_day       | Time of day to execute if not specified.                | DateTime                      |    Yes   |
| once\_at            | Execute once at                                         | DateTime                      |    Yes   |
| next\_execution     | Next execution                                          | DateTime                      |    Yes   |
| last\_execution     | Last execution                                          | DateTime                      |    Yes   |
| execution\_time     | Amount of time in seconds used by last execution        | Int                           |    Yes   |
| lock\_expire        | Lock preventing the same schedule to run simultaniously | DateTime                      |    Yes   |
| lock\_pid           | PID preventing the same schedule to run simultaniously  | Int                           |    Yes   |
| lock\_ttl           | Lock time to live                                       | Int                           |    Yes   |
| error\_message      | Last error message                                      | Clob                          |    Yes   |
| last\_error         | Time of last error                                      | DateTime                      |    Yes   |
| retries             | Number of retries since last successfull execution      | Int                           |    No    |
| retry\_interval     | Number of minutes between each retry                    | Int                           |    Yes   |

<img src="https://mintcdn.com/superofficeas/8-OIGQQJR0VGDXy_/media/loc/en/database/tables/schedule.png?fit=max&auto=format&n=8-OIGQQJR0VGDXy_&q=85&s=f49f2cb5afeddcabef9b3b2c2ef8174a" alt="schedule table relationship diagram" width="804" height="59" data-path="media/loc/en/database/tables/schedule.png" />

## Indexes

| Fields              | Types | Description |
| ------------------- | ----- | ----------- |
| after\_schedule\_id | FK    | Index       |

## Relationships

| Table                                        | Description                                                                   |
| -------------------------------------------- | ----------------------------------------------------------------------------- |
| [dbi\_agent\_schedule](./dbi-agent-schedule) | DBI agent schedule settings                                                   |
| [schedule](./schedule)                       | Generic scheduled tasked handling time scheduling, locking and error messages |
| [scheduled\_task](./scheduled-task)          | A scheduled entry executing a script at certain times                         |

## Replication Flags

* None

## Security Flags

* No access control via user's Role.


## Related topics

- [dbi_agent_schedule table](/en/database/tables/dbi-agent-schedule.md)
- [scheduled_task table](/en/database/tables/scheduled-task.md)
- [locking table](/en/database/tables/locking.md)
- [YearSchedule](/en/automation/crmscript/reference/CRMScript.Native.YearSchedule.md)
- [WeekSchedule](/en/automation/crmscript/reference/CRMScript.Native.WeekSchedule.md)
- [ejscript table](/en/database/tables/ejscript.md)
