Keep Clauses

Jobs and Workflows that have already executed leave behind execution records, generally referred to as Jobs. You can view these Jobs in the Monitor screen.

It is generally a good idea to delete old Jobs to avoid overloading your system. A Keep Clause defines how many Jobs are kept in the system and/or how long Jobs will be kept in the system. You can retain Jobs per Parameter value combination, system, user, or date. You can further limit Job retention by status. However you delete old Jobs, however, the important thing is to do it, because the default setting is to keep all Jobs.

You can specify a Keep Clause for a specific Job or Workflow Definition using the Retention tab for a Job Definition. You can also set the DefaultKeepStatus registry key to define a Keep Clause for all Jobs with a particular final status.

Your retention strategy is the way you set up your Keep Clauses.

Warning: Incorrect or inefficient retention strategies can cause Job accumulation, which can lead to poor performance and/or file system saturation. Contact Redwood Support Services if you are in doubt about the efficiency of your retention strategy.

Job Deletion

Jobs are not deleted immediately. Rather, they are deleted by system Jobs that run in the background. Jobs are deleted by the System_ProcessKeepClauses Job Definition, and output files are removed by the System_DeleteJobFiles Job Definition. By default, these Job Definitions are executed every 15 minutes.

These Job Definitions run according to the built-in Advanced Schedules System_ProcessKeepClausesSubmitFrame and System_DeleteJobFilesSubmitFrame. You can modify these Advanced Schedules to change the interval at which the Job Definitions are executed.

Tip: Because these are maintenance Jobs, they are not displayed in the Job Definitions screen when the default All (non-maintenance) processes filter is selected. If you need to monitor these Jobs, select the Maintenance (background) processes filter.

Partition-wide and System-wide Keep Clauses

You can set Partition-wide and system-wide Keep Clause defaults by creating or editing <Partition>.System_Defaults_Partition and/or GLOBAL.System_Defaults_System Job Definitions. These Job Definitions are also used to configure default restart behavior. For more information, see Controlling Global and Partition Restart Behavior.

Tip: You can set a default Keep Clause for all Jobs to which no other Keep Clause applies. To do so, use the defaultjobretention group of registry keys.

DefaultKeepStatus Registry Key

Jobs that reach one of statuses defined by the /configuration/DefaultKeepStatus registry key are excluded from the Keep Clauses of Job and Workflow Definitions. These Jobs are kept indefinitely.

You can set this registry entry to a series of the following codes, in any order, without any separators (for example: KAUE). Jobs that have been excluded from the Keep Clause this way are kept forever.

  • A - Canceled
  • C - Completed
  • E - Error
  • K - Killed
  • U - Unknown

KeepExpiration Field on the Job Table (Model)

You can set the Job.KeepExpiration field of a Job in the database to override the Keep Clause specified on the Job Definition for that Job.

Retention Warnings

A warning displays if (a) 80% of non-system Job Definitions do not have a Keep Clause set, and (b) the system reaches either the maximum number of processes (100,000 by default) or the maximum number of new processes within 24 hours (10,000 by default). You can specify your own criteria using the retention registry entries.