# Jobs

Jobs refer to the scheduled delivery of messages to a specific topic in order to trigger message workflows. For example, if a subscriber listens on topic "amps.actions.runscript.cleanup" to run a script that should perform a cleanup action every 30 minutes, a job would be created using a "timer" Job Type, to execute every 30 minutes and send a message to "amps.actions.runscript.cleanup" with any additional metadata. The fields for defining jobs are specified below.

| Field                     | Description                                                                                                                                                                                                                                                                                         |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Job Name\*                | A name for the job.                                                                                                                                                                                                                                                                                 |
| Active\*                  | A flag indicating whether or not this job is currently active.                                                                                                                                                                                                                                      |
| Topic\*                   | The topic to send a message to when this job is executed.                                                                                                                                                                                                                                           |
| Additional Metadata       | Any additional metadata to include when sending the message to the topic.                                                                                                                                                                                                                           |
| Job Type\*                | The type of schedule this job will run on. One of three possible options: Timer which executes the job at a certain interval, Daily which excecutes the job every day or on certain days of the week at a set time, or Days which executes the job at a specific time on specific days of the month |
| \[Timer]-Every            | Every specifies the interval at which to execute the job as a value-unit pair. Because AMPS uses cron-like job scheduling under the hood, valid values are factors of 60. The unit can either be seconds, minutes, or hours.                                                                        |
| \[Daily, Days]-Time       | The time at which to execute the job, values are provided in military time.                                                                                                                                                                                                                         |
| \[Daily]-Every Day        | A flag indicating whether this job should execute every day.                                                                                                                                                                                                                                        |
| \[Daily]-Select Days      | If not execute every day, a list of days of the week on which to execute this job.                                                                                                                                                                                                                  |
| \[Days]-Days of the Month | A list of days of the month on which to execute this job.                                                                                                                                                                                                                                           |
