Run Pipelines with ScheduledTrigger
For the architecture, motivations, and design background of ScheduledTrigger, see the ScheduledTrigger Concepts page.
TOC
OverviewSupported Resource TypesTypical WorkflowBasic Manifest StructureStep-by-Step Configuration1. Choose the cadence and time zone2. Point to the TriggerTemplate3. Pass parameters4. Apply the manifest5. Validate the resourceTime Zone Resolution for Context ParametersSet the controller default time zone cluster-wideManaging ScheduledTrigger Over TimeInline Template ExampleTime-Zone-Aware Weekly ExampleReference LinksOverview
ScheduledTrigger lets you execute a TriggerTemplate on a cron-style cadence without relying on inbound webhooks. Each tick of the schedule renders the template, injects any static or time-based parameters, and creates the Tekton resources (for example PipelineRuns) you defined. This how-to walks you through preparing the prerequisites, writing the manifest, and validating the automation end to end.
Supported Resource Types
ScheduledTrigger currently supports the following Tekton Pipelines resources in TriggerTemplate:
Recommendation: use
tekton.dev/v1for the following resources;tekton.dev/v1beta1is still accepted but is deprecated and will be removed in a future release.
Typical Workflow
- Confirm the TriggerTemplate you want to run periodically (reusable reference or inline spec).
- Decide on the cadence, time zone, and any contextual parameters the automation needs.
- Create a
ScheduledTriggermanifest that binds the template to the schedule. - Apply the manifest and monitor the resource status/events to ensure executions occur.
Basic Manifest Structure
Step-by-Step Configuration
1. Choose the cadence and time zone
- Use standard cron syntax (minute hour day-of-month month day-of-week). Example:
15 1 * * 1-5runs at 01:15 Monday through Friday. - Set
spec.timeZoneto an Olson time zone string (for exampleEurope/Paris). If omitted, the controller renders in its own time zone (UTC by default — see Time Zone Resolution for Context Parameters). - Prefer explicit time zones when business hours differ from the cluster default or when daylight-saving changes matter.
2. Point to the TriggerTemplate
You can reference a reusable template via spec.triggerTemplate.ref, or embed a full template inline under spec.triggerTemplate.spec. References keep multiple ScheduledTriggers in sync, while inline specs make each manifest self-contained.
3. Pass parameters
- Use
spec.paramsto feed static values into the template ($(tt.params.<name>)). Context placeholders (for example$(context.date)and$(context.datetime)) are only valid in this section. - Combine those placeholders with your own params to generate deterministic run names, tags, or report partitions, then reference them inside the template as
$(tt.params.<name>). - Because Tekton Trigger parameters are strings, serialize complex objects (for example JSON) before passing them.
4. Apply the manifest
Target the namespace where the TriggerTemplate lives. Kubernetes RBAC must allow the controller to resolve and execute that template.
5. Validate the resource
Check the LAST SCHEDULETIME column (or the .status.lastScheduleTime field) to confirm the controller is firing. Kubernetes events surfaced by kubectl describe will indicate successful runs or scheduling errors (for example invalid cron expressions or missing templates).
If executions still do not start as expected, review the ScheduledTrigger troubleshooting guide for detailed investigation steps.
Time Zone Resolution for Context Parameters
The $(context.date) and $(context.datetime) placeholders are rendered using the schedule's effective time zone. The same effective zone is used both to evaluate the cron schedule and to render the placeholders, so a trigger's firing time and its injected timestamps always agree. The zone is resolved in this order:
spec.timeZoneon the ScheduledTrigger, when set. This takes precedence over everything else and is the recommended way to control an individual trigger.- The controller's process time zone, when
spec.timeZoneis omitted. - UTC, which is the controller's default out of the box.
For example, with no spec.timeZone and the default controller zone, $(context.datetime) resolves to a UTC timestamp such as 2025-11-25T07:42:00Z.
Set the controller default time zone cluster-wide
Out of the box the ScheduledTrigger controller runs in UTC. To change the default for every ScheduledTrigger that does not set its own spec.timeZone, inject a TZ environment variable into the controller through TektonConfig options. The operator applies this additively and does not revert it on reconcile:
After you apply the change, the operator rolls out the controller. Subsequent runs render the context placeholders in the configured zone — for example $(context.datetime) becomes 2025-11-25T15:42:00+08:00 for Asia/Shanghai.
- Editing the controller Deployment directly (for example with
kubectl set env) is reverted by the operator within minutes. Always configureTZthroughTektonConfigso the change is persistent. - A per-trigger
spec.timeZonealways overrides this cluster-wide default. Preferspec.timeZonefor individual schedules and reserve the controllerTZfor setting an organization-wide default. TZaccepts IANA/Olson time zone names (for exampleUTC,Asia/Shanghai,Asia/Kolkata). An invalid name leaves the controller on its previous zone.
Managing ScheduledTrigger Over Time
- Update cadence: Edit the resource (
kubectl editor apply a new manifest) to changespec.scheduleorspec.timeZone. The next tick recalculates automatically. - Rotate parameters: Modify
spec.paramsto update static values such as environment names, feature flags, or recipients. - Switch templates: Point
spec.triggerTemplate.refto a new template, or update the inline spec. Subsequent executions use the new logic immediately. - Pause or remove: Delete the ScheduledTrigger to stop future runs. Recreate it later with the same name if you need to resume the cadence.