---
title: Job
description: Job protocol schemas
---

{/* ⚠️  AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs go in content/docs/guides/. */}

Cron Schedule Schema

Schedule jobs using cron expressions

<Callout type="info">
**Source:** `packages/spec/src/system/job.zod.ts`
</Callout>

## TypeScript Usage

```typescript
import { IntervalSchedule, JobExecution, JobExecutionStatus, OnceSchedule, RetryPolicy } from '@objectstack/spec/system';
import type { IntervalSchedule, JobExecution, JobExecutionStatus, OnceSchedule, RetryPolicy } from '@objectstack/spec/system';

// Validate data
const result = IntervalSchedule.parse(data);
```

---

## IntervalSchedule

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **type** | `string` | ✅ |  |
| **intervalMs** | `integer` | ✅ | Interval in milliseconds |


---

## JobExecution

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **jobId** | `string` | ✅ | Job identifier |
| **startedAt** | `string` | ✅ | ISO 8601 datetime when execution started |
| **completedAt** | `string` | optional | ISO 8601 datetime when execution completed |
| **status** | `Enum<'running' \| 'success' \| 'failed' \| 'timeout'>` | ✅ | Execution status |
| **error** | `string` | optional | Error message if failed |
| **duration** | `integer` | optional | Execution duration in milliseconds |


---

## JobExecutionStatus

### Allowed Values

* `running`
* `success`
* `failed`
* `timeout`


---

## OnceSchedule

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **type** | `string` | ✅ |  |
| **at** | `string` | ✅ | ISO 8601 datetime when to execute |


---

## RetryPolicy

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **maxRetries** | `integer` | ✅ | Maximum number of retry attempts |
| **backoffMs** | `integer` | ✅ | Initial backoff delay in milliseconds |
| **backoffMultiplier** | `number` | ✅ | Multiplier for exponential backoff |


---

