# diy.razorgirl.winter.job

> Published by [winter.razorgirl.diy](https://lexicon.garden/identity/did:plc:ezyi5vr2kuq7l5nnv53nb56m)

✓ This is the authoritative definition for this NSID.

## Description

Scheduled task with natural-language instructions. Supports one-time and recurring schedules.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:ezyi5vr2kuq7l5nnv53nb56m/diy.razorgirl.winter.job)
- [Documentation](https://lexicon.garden/lexicon/did:plc:ezyi5vr2kuq7l5nnv53nb56m/diy.razorgirl.winter.job/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:ezyi5vr2kuq7l5nnv53nb56m/diy.razorgirl.winter.job/examples)

## Definitions

### `diy.razorgirl.winter.job`

**Type**: `record`

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `name` | `string` | Yes |  |
| `status` | `string` | No |  |
| `lastRun` | `string` (datetime) | No |  |
| `nextRun` | `string` (datetime) | No |  |
| `schedule` | `union` | Yes |  |
| `createdAt` | `string` (datetime) | Yes |  |
| `failureCount` | `integer` | No |  |
| `instructions` | `string` | Yes |  |

### `diy.razorgirl.winter.job#onceSchedule`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `type` | `string` | Yes |  |
| `runAt` | `string` (datetime) | Yes |  |

### `diy.razorgirl.winter.job#intervalSchedule`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `type` | `string` | Yes |  |
| `seconds` | `integer` | Yes |  |

## Raw Schema

```json
{
  "id": "diy.razorgirl.winter.job",
  "defs": {
    "main": {
      "key": "tid",
      "type": "record",
      "record": {
        "type": "object",
        "required": [
          "name",
          "instructions",
          "schedule",
          "createdAt"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 128
          },
          "status": {
            "type": "string",
            "default": "pending",
            "knownValues": [
              "pending",
              "running",
              "completed",
              "failed"
            ]
          },
          "lastRun": {
            "type": "string",
            "format": "datetime"
          },
          "nextRun": {
            "type": "string",
            "format": "datetime"
          },
          "schedule": {
            "refs": [
              "#onceSchedule",
              "#intervalSchedule"
            ],
            "type": "union"
          },
          "createdAt": {
            "type": "string",
            "format": "datetime"
          },
          "failureCount": {
            "type": "integer",
            "default": 0
          },
          "instructions": {
            "type": "string",
            "maxLength": 50000
          }
        }
      }
    },
    "onceSchedule": {
      "type": "object",
      "required": [
        "type",
        "runAt"
      ],
      "properties": {
        "type": {
          "type": "string",
          "const": "once"
        },
        "runAt": {
          "type": "string",
          "format": "datetime"
        }
      }
    },
    "intervalSchedule": {
      "type": "object",
      "required": [
        "type",
        "seconds"
      ],
      "properties": {
        "type": {
          "type": "string",
          "const": "interval"
        },
        "seconds": {
          "type": "integer"
        }
      }
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "description": "Scheduled task with natural-language instructions. Supports one-time and recurring schedules."
}
```
