FactorySchedule
A cron schedule that starts a Software Factory workflow: a cron trigger node in the workflow's graph whose id is metadata.name (at most 40 characters). Fields, YAML, HCL and CLI samples, and how apply treats it.
A cron schedule that starts a Software Factory workflow: a cron trigger node in the workflow’s graph whose id is metadata.name (at most 40 characters). Applying one saves and publishes a new version of the workflow, the same as adding the schedule on the Schedules tab, and creates or updates the timer that fires it; the workflow must be published and must not hold an unpublished draft. A cron trigger node the workflow already has under that id is adopted. Removing the document removes the node and its timer and publishes the workflow again.
apiVersion |
vulnetix.com/v1 |
kind |
FactorySchedule |
| Group | Factory |
| Status | Served. The config engine plans and applies it. |
| Objects per tenant | many, keyed by metadata.name |
| Token and role | An owner or admin session, or a vmt_ config management token with the owner or admin role that lists FactorySchedule in its kinds. See Management tokens. |
| Applied after | FactoryWorkflow (deleted before them) |
| Terraform resource | vulnetix_factory_schedule, imported by name (see Terraform and OpenTofu) |
| CLI | vulnetix config apply, CLI v3.168.0 and later. |
| Pinned schema | v1.15.0/FactorySchedule.schema.json |
| Newest schema | latest/FactorySchedule.schema.json |
| First released in | v1.6.0 |
| Print the built-in copy | vulnetix config schema FactorySchedule |
Minimal
Only the fields the kind requires. From examples/FactorySchedule/minimal.yaml.
YAML
# yaml-language-server: $schema=https://github.com/Vulnetix/config-schemas/releases/latest/download/FactorySchedule.schema.json
apiVersion: vulnetix.com/v1
kind: FactorySchedule
metadata:
name: nightly
spec:
workflow: security-patch-train
cron: 0 3 * * *
startAt: [scan]
HCL (resource vulnetix_factory_schedule)
# Only the arguments the kind requires. From config-schemas examples/FactorySchedule/minimal.yaml.
resource "vulnetix_factory_schedule" "nightly" {
name = "nightly"
cron = "0 3 * * *"
start_at = ["scan"]
workflow = "security-patch-train"
}
CLI (applies it)
export VULNETIX_CONFIG_TOKEN=vmt_... # a config management token
vulnetix config apply -f - --manager gitops:acme/platform --auto-approve <<'EOF'
# yaml-language-server: $schema=https://github.com/Vulnetix/config-schemas/releases/latest/download/FactorySchedule.schema.json
apiVersion: vulnetix.com/v1
kind: FactorySchedule
metadata:
name: nightly
spec:
workflow: security-patch-train
cron: 0 3 * * *
startAt: [scan]
EOF
Advanced
Every field the kind supports, with a when expression where it takes one. From examples/FactorySchedule/advanced.yaml.
YAML
# yaml-language-server: $schema=https://github.com/Vulnetix/config-schemas/releases/latest/download/FactorySchedule.schema.json
apiVersion: vulnetix.com/v1
kind: FactorySchedule
metadata:
name: weekday-sweep
annotations:
ticket: https://tracker.acme.com/SEC-142
spec:
workflow: security-patch-train
title: Weekday dependency sweep
cron: 0 3 * * 1-5
timezone: Australia/Melbourne
runsOn: aws
overlap: skip_if_running
enabled: true
startAt: [scan]
priority: 3
HCL (resource vulnetix_factory_schedule)
# Every argument the kind supports. From config-schemas examples/FactorySchedule/advanced.yaml.
resource "vulnetix_factory_schedule" "weekday_sweep" {
name = "weekday-sweep"
cron = "0 3 * * 1-5"
enabled = true
overlap = "skip_if_running"
priority = 3
runs_on = "aws"
start_at = ["scan"]
timezone = "Australia/Melbourne"
title = "Weekday dependency sweep"
workflow = "security-patch-train"
annotations = {
ticket = "https://tracker.acme.com/SEC-142"
}
}
CLI (applies it)
export VULNETIX_CONFIG_TOKEN=vmt_... # a config management token
vulnetix config apply -f - --manager gitops:acme/platform --auto-approve <<'EOF'
# yaml-language-server: $schema=https://github.com/Vulnetix/config-schemas/releases/latest/download/FactorySchedule.schema.json
apiVersion: vulnetix.com/v1
kind: FactorySchedule
metadata:
name: weekday-sweep
annotations:
ticket: https://tracker.acme.com/SEC-142
spec:
workflow: security-patch-train
title: Weekday dependency sweep
cron: 0 3 * * 1-5
timezone: Australia/Melbourne
runsOn: aws
overlap: skip_if_running
enabled: true
startAt: [scan]
priority: 3
EOF
Fields
Paths use dots for nesting and [] for the items of a list. Required means required whenever the parent object is present. A default is what the server uses when the field is left out.
| Field | Type | Required | Default | Allowed values | Description |
|---|---|---|---|---|---|
apiVersion |
string | yes | exactly vulnetix.com/v1 |
The document format version. Every kind in this release is vulnetix.com/v1. | |
kind |
string | yes | exactly FactorySchedule |
Always FactorySchedule. | |
metadata |
object | yes | no other keys | ||
metadata.name |
string | yes | pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ |
The object’s name, unique per kind within a tenant. It is the natural key: plan, apply, export and the Terraform provider all address an object by kind and name. | |
metadata.org |
string | no | format uuid |
The tenant (organization UUID) the document belongs to. When set, plan and apply refuse to run against any other tenant. | |
metadata.labels |
object | no | map of string to string (length 0 to 256); keys match ^[a-z0-9]([a-z0-9._/-]{0,61}[a-z0-9])?$ |
Free key/value labels. Stored with the object, never interpreted by the server. | |
metadata.annotations |
object | no | map of string to string (length 0 to 4096) | Free key/value notes for people and tools, such as a ticket link. | |
spec |
object | yes | no other keys | ||
spec.workflow |
string | yes | pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ |
The metadata.name of a FactoryWorkflow: the workflow the schedule starts. | |
spec.cron |
string | yes | length 9 to 200 | When the workflow runs: five cron fields (minute, hour, day of month, month, day of week) of numbers, ranges, lists and steps. Day of month and day of week cannot both be restricted. | |
spec.timezone |
string | no | UTC |
length 1 to any | The IANA time zone the cron fields are read in, such as Australia/Melbourne. Defaults to UTC. |
spec.runsOn |
string | no | aws |
aws, cloudflare |
The timer that fires the schedule: aws (an EventBridge Scheduler schedule) or cloudflare (a Worker cron trigger, for workflows that run in a Pix Sandbox). Defaults to aws. |
spec.overlap |
string | no | skip_if_running, queue, cancel_previous |
What happens when the previous run is still going at the next fire. Defaults to skip_if_running. | |
spec.enabled |
boolean | no | true |
Whether the schedule fires. A schedule of a workflow that is switched off fires but starts nothing. | |
spec.title |
string | no | length 1 to 200 | The trigger node’s title in the builder. Left out, the node is titled with metadata.name. | |
spec.startAt |
array of string | yes | 1 to any items; items unique; each item: pattern ^[A-Za-z0-9][A-Za-z0-9_-]{0,39}$ |
The ids of the steps in the workflow’s graph the schedule leads to: one edge from the trigger to each, in this order. | |
spec.priority |
integer | no | 1 to 5 | The run’s priority, 1 (highest) to 5, when runs wait for capacity. |
Applying this kind
- Command.
vulnetix config apply -f <file>; the CLI line above says from which release. Plan first withvulnetix config plan: it shows each object as create, update, delete or no change, with aplanHashthat apply then holds to. Apply writes in one transaction. - Manager. Each object records the manager that applied it (
terraform,consoleorgitops:<repo>).--prunedeletes only objects its own manager owns. See The manager and the config engine. - Order. Applied after
FactoryWorkflow, so a document that refers to one bymetadata.namecan be in the same apply. Deleted before them. - Status. Applied, Unchanged or Deleted, with no other status fields. The phases the engine reports are explained under status phases.
How apply treats it
A cron expression and time zone for a FactoryWorkflow, stored as a cron trigger node and written the same way as FactoryTrigger.
Terraform and OpenTofu
The resource is vulnetix_factory_schedule in the vulnetix/resolve provider. Its arguments are the spec in snake case, beside name, labels and annotations from metadata. The Minimal and Advanced HCL are above. The provider’s own reference is vulnetix_factory_schedule.
Import an object that already exists by its name:
# Import an existing FactorySchedule by its name (metadata.name).
terraform import vulnetix_factory_schedule.nightly nightly
Install, authentication and how state is read: Terraform and OpenTofu.
Check a file with vulnetix config validate -f <file>. See Validate documents. In an editor, start the file with the schema comment.