Source
id: schedule-condition-datetimebetween
namespace: company.team
tasks:
- id: hello
type: io.kestra.plugin.core.log.Log
message: Demo for DateTimeBetween condition
triggers:
- id: schedule
type: io.kestra.plugin.core.trigger.Schedule
cron: "0 11 * * *"
conditions:
- type: io.kestra.plugin.core.condition.DateTimeBetween
date: "{{ trigger.date }}"
before: "2025-01-01T00:00:00Z"
after: "2025-12-31T23:59:59Z"
About this blueprint
Trigger Schedule
This flow triggers the task at 11am every day with the schedule condition that the date falls between 1st January, 2025 and 31st December, 2025 using the DateTimeBetween condition.
The DateTimeBetween condition also works with either the before
or after
clause on their own. By providing only the before
clause, the condition will evaluate to true for any date
that falls before the before
date time. Similarly, by providing only the after
clause, the condition will evaluate to true for any date
that falls after the after
date time.
By providing both the before
and after
date time, the condition will evaluate to true when the date
falls between the before
and the after
date time.
The flow will only get triggered if the associated DateTimeBetween condition evaluates to true.
More Related Blueprints