# Low-Code Job Scheduler (cf.cplace.lowcodeJobScheduler)

## Overview

The Low-Code Job Scheduler app enables scheduling one-time or interval-based execution of existing Low-Code Jobs using a cron-style schedule. Each Job Schedule page references a specific Low-Code Job (from any workspace) and configures when and how it should execute. Supports recurring and one-time executions, suspension, catch-up execution, job categorization for cluster-safe parallel control, and parameterized jobs.

**Available since:** cplace 24.1

**Required permission:** Low-Code Editors (in the workspace where the app is installed)

**Icon:** `fa-list`

## Dependencies

- `cf.cplace.platform` (cplace Basis) — always pre-installed

> **Note:** `cf.cplace.attributeDependencies` (Attribute Dependencies) was co-installed in the investigation workspace but may have been added independently. Its status as a hard dependency has not been verified.

## Types Provided

### cf.cplace.lowcodeJobScheduler.type (Job Schedule)

Represents a scheduled execution of a Low-Code Job. The schedule is configured using cron-style fields (minute, hour, day-of-week, day-of-month, month). Leaving a field blank defaults to the least restrictive interval (e.g., blank hour = run every hour).

**Name Generation Pattern:** `<#> | <cf.cplace.lowcodeJobScheduler.name>`

**Icon:** `fa-list`

| Attribute | Internal Name | Type | Required | Description |
|-----------|--------------|------|----------|-------------|
| Name | `cf.cplace.lowcodeJobScheduler.name` | String | Yes | Display name for this schedule |
| Execution at minutes | `cf.cplace.lowcodeJobScheduler.scheduleMinute` | String | No | Cron-style minutes (0–59). Blank = every minute. Comma-separated or ranges with `-`. Example: `2,4-6,7` |
| Execution at hours | `cf.cplace.lowcodeJobScheduler.scheduleHour` | String | No | Cron-style hours (0–23). Blank = every hour. Example: `5-7,14` |
| Execution on days of week | `cf.cplace.lowcodeJobScheduler.scheduleDayOfWeek` | String | No | 0–7 (0 and 7 = Sunday, 6 = Saturday). Blank = every day. Example: `2,4-6` |
| Execution on days of month | `cf.cplace.lowcodeJobScheduler.scheduleDayOfMonth` | String | No | 1–31. Blank = every day. Example: `2,4-6,7` |
| Execution in months | `cf.cplace.lowcodeJobScheduler.scheduleMonth` | String | No | 1–12. Blank = every month. Example: `2,4-6` |
| Workspace of Low-Code Job | `cf.cplace.lowcodeJobScheduler.jobWorkspace` | Dynamic Enumeration | Yes | Selects the workspace that contains the Low-Code Job to run |
| Low-Code Job | `cf.cplace.lowcodeJobScheduler.jobId` | Dynamic Enumeration | Yes | Selects the specific Low-Code Job from the chosen workspace |
| Execute one time only | `cf.cplace.lowcodeJobScheduler.isOneTimeExecution` | Boolean | Yes | If true, job runs once then is automatically deactivated |
| Execution deactivated | `cf.cplace.lowcodeJobScheduler.isSuspended` | Boolean | Yes | Temporarily disables the schedule without deleting it |
| Catch up on execution | `cf.cplace.lowcodeJobScheduler.strictExecution` | Boolean | Yes | If cplace was offline at scheduled time, run the job immediately on restart, then resume normal schedule |
| Job Category | *(not observed in investigation)* | String/Enumeration | No | Groups jobs logically; jobs with the same category never run in parallel, even across cluster nodes |
| Job Category Enqueue Mode | *(not observed in investigation)* | Enumeration | No | Controls queuing behavior within a category: `IF_IDLE` (skip if busy), `ALWAYS` (always enqueue, sequential), `IF_NONE_QUEUED` (enqueue if nothing queued, wait for running) |
| Job Parameters | `cf.cplace.lowcodeJobScheduler.jobParametersScript` | Script | No | Low-Code script evaluated before execution; must return a JSON-serializable object with primitive values only (no cplace Page objects) |
| Last executed job id | `cf.cplace.lowcodeJobScheduler.lastExecutedJobId` | String | No | System-managed: ID of the last job run |
| Time of last execution | `cf.cplace.lowcodeJobScheduler.lastExecutionTime` | Date+Time | No | System-managed: when the job last ran |
| Duration of last execution | `cf.cplace.lowcodeJobScheduler.lastExecutionDuration` | String | No | System-managed: how long the last execution took |
| Time of next execution | `cf.cplace.lowcodeJobScheduler.nextExecutionTime` | Date+Time | No | System-managed: when the job will next run |

### Fixed Parameters Injected at Runtime

The scheduler automatically adds these properties to the job parameters:

| Property | Added When |
|----------|-----------|
| `isManual` | Job was triggered manually via page action from the job schedule page |
| `jobScheduleId` | Job was triggered automatically; contains the internal ID of the Job Schedule page |

> **Note:** Usage of these injected properties is discouraged and may change in future versions.

## Widgets Provided

None. This app is type-only — scheduling is managed via Job Schedule pages.

## Usage Notes

### When to Use This App

- **Automated batch processing:** Run a Low-Code Job nightly, weekly, or on a custom cron schedule
- **Periodic data synchronization:** Trigger sync jobs at defined intervals
- **One-time deferred execution:** Schedule a job to run once at a specific time
- **Parameterized jobs:** Use the Job Parameters script to pass dynamic values at runtime
- **Cluster-safe serialization:** Use Job Category to prevent parallel execution of related jobs across cluster nodes

### Common Patterns

1. **Nightly job:** Set `scheduleHour=2`, leave minute/day/month blank → runs every day at 02:xx
2. **Weekday-only job:** Set `scheduleDayOfWeek=1-5` → runs Monday through Friday
3. **One-time execution:** Set `isOneTimeExecution=true` → auto-deactivates after first run
4. **Suspended schedule:** Set `isSuspended=true` to pause without deleting the configuration
5. **Catch-up on restart:** Enable `strictExecution` to ensure missed jobs are executed after downtime
6. **Cluster-safe jobs:** Assign a Job Category with `IF_IDLE` or `IF_NONE_QUEUED` mode to avoid overlapping runs

### Job Parameters Script Constraints

- Must return a plain JavaScript object with primitive values (`string`, `number`, `boolean`)
- Do **not** put cplace objects (e.g., `Page`) into parameters — use their IDs instead and resolve them inside the Low-Code Job script
- The returned object must be serializable/deserializable as a JSON string

### Integration with Other Apps

- Requires Low-Code Jobs to be defined in the target workspace (platform-level feature, no additional app needed for the jobs themselves)
- Works alongside any app that exposes Low-Code Jobs for automation

## Investigation Details

- **Investigation Date:** 2026-02-28
- **Workspace ID:** s6w1r1wz8fsg39vs10p5z50dd
- **Workspace Name:** Schedule Test
- **Supplemented by:** Internal product documentation (cplace 24.1 release)