Schedule pipelines using triggers
Use cron triggers to schedule pipeline executions.
Use cron triggers to run pipelines on a schedule instead of in response to an event. For example, to run a pipeline every Monday at 1:00 AM, Harness uses the cron expression 0 1 * * MON. Go to the Triggers overview to review other trigger types.
What you will learn in this topic
By the end of this topic, you will be able to:
Add a cron trigger to a pipeline.
Schedule the trigger with a cron expression and timezone.
Set pipeline inputs for the trigger.
Use complex cron expressions with AND semantics.
Enable, disable, or run the trigger once.
Before you begin
Before you schedule a pipeline with a cron trigger, ensure you have the following:
A Harness pipeline: An existing Harness CI or CD pipeline.
Key concepts familiarity: Familiarity with Harness key concepts. Go to Harness key concepts to review core platform concepts.
Schedule a pipeline using a cron trigger
Complete these three steps to add a cron trigger, define its schedule, and provide any pipeline inputs.
Step 1: Add a cron trigger
Add a cron trigger to the pipeline you want to run on a schedule.
Open your Harness pipeline in Pipeline Studio.
Select Triggers.
Click New Trigger.
Select Cron. For Git-based trigger types or CodeCommit, go to Trigger pipelines using Git events to configure Git-based triggers.
In Trigger Overview, configure the trigger:
In Name, enter a name for the trigger. Harness generates the Id from the name.
(Optional) In Description, add a description for the trigger.
(Optional) In Tags, add tags for the trigger.
Click Continue.
Step 2: Schedule the trigger
Configure when the trigger fires by setting a timezone and a cron expression. The Schedule page shows the current time in the selected timezone and your local time for reference.
In Schedule, configure when the trigger fires:
In Timezone, select the timezone in which the cron expression is evaluated. The default timezone is
UTC.Select how to define the schedule:
Use the Minutes, Hourly, Daily, Weekly, Monthly, or Yearly tabs to build a schedule from presets.
Use the Custom tab to enter a cron expression directly.
In the Custom tab, select the expression type and enter your cron expression. The fields shown depend on the expression type you select.
Select UNIX Expression.
In Enter a custom cron expression, type or paste a UNIX cron expression, for example
0/5 * * * *.Review the parsed values:
Expression Breakdown: A table that shows the parsed Minutes, Hours, Day of month, Month, and Day of week values.
Cron Expression: The final expression Harness evaluates.
Click Continue.
Select Quartz Expression.
In Enter a custom cron expression, type or paste a Quartz cron expression, for example
0 0 4 7 ? 2026.Click Continue.
Timezone: Harness supports the IANA Time Zone convention, such as America/New_York, Asia/Kolkata, or Europe/London. The default timezone is UTC.
If the feature flag is not enabled, the cron expression is always evaluated against UTC time.
Step 3: Set the pipeline input
Provide values for any runtime inputs the pipeline requires, so the scheduled execution has everything it needs to run.
Pipelines often have runtime inputs, such as codebase branch names or artifact versions and tags. You can also use input sets.
In Pipeline Input, provide the values the trigger uses when it runs the pipeline:
In Pipeline Stages, select the stages to run. The default is All Stages.
Under Pipeline Input, provide values for the runtime inputs. If the pipeline has no runtime inputs, this section shows No Runtime Inputs.
Click Create Trigger. The trigger is now added to the Triggers page.
Complex cron expressions with date and day constraints
Use complex cron expressions when you need executions on specific days within specific date ranges.
Harness supports complex cron trigger expressions that execute pipelines only when both the date range and the day-of-week conditions are satisfied simultaneously. This enables more precise scheduling for scenarios where you need executions on specific days within specific date ranges.
Standard cron behavior uses OR semantics when both day-of-month and day-of-week are specified. For example, a cron expression like 0 3 16-22 * 1 triggers at 3:00 AM UTC on every Monday OR any day between the 16th and 22nd. With AND semantics enabled, the pipeline executes only when it is a Monday and the date falls between the 16th and 22nd of the month.
Use cases
Complex cron expressions with AND semantics are useful for:
Running monthly maintenance tasks on specific weekdays within a date window (for example, the third Monday of each month).
Scheduling deployments during defined change windows that must occur on particular days.
Executing compliance or reporting pipelines that must run on business days within a specific week of the month.
Coordinating batch jobs that need to align with both calendar dates and weekly schedules.
Expression evaluation behavior
When both day-of-month and day-of-week are specified (neither is * or ?):
Standard cron semantics (feature flag disabled): The expression matches if either condition is true (OR logic).
AND semantics (feature flag enabled): The expression matches only when both conditions are true (AND logic).
This feature provides more precise control over pipeline schedules, which reduces unnecessary executions and improves resource utilization for scenarios that require specific date and day combinations.
Edit a scheduled trigger
Edit an existing cron trigger to change its schedule, timezone, or pipeline inputs.
Open your Harness pipeline in Pipeline Studio.
Select Triggers.
In the list of triggers, select the cron trigger you want to edit.
Update the trigger:
In Overview, update the name, description, or tags.
In Schedule, update the timezone or cron expression.
In Pipeline Input, update the pipeline stages or runtime inputs.
Click Update Trigger to save your changes.
Enable or disable a trigger
Use the enable setting to turn the trigger on and off.
Your pipeline runs when the cron expression equals the current time.
Run once
Configure a run-once schedule when you need the pipeline to run at a single, fully qualified date and time.
Enter the time, day of month, and month, and then allow for any day of the week.
The following example runs at 1:45 PM, on day 13 of the month, and on Tuesday, only in September:
45 13 13 09 Tue
Last updated
Was this helpful?