Skip to content

Commit

Permalink
feat: blueprint for schedule condition timebetween (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
shrutimantri authored Jan 20, 2025
1 parent 8489ba2 commit 158f8f4
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions schedule-condition-timebetween.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
id: schedule-condition-timebetween
namespace: company.team

tasks:
- id: hello
type: io.kestra.plugin.core.log.Log
message: Demo for TimeBetween condition

triggers:
- id: schedule
type: io.kestra.plugin.core.trigger.Schedule
cron: "@hourly"
conditions:
- type: io.kestra.plugin.core.condition.TimeBetween
date: "{{ trigger.date }}"
after: "08:00:00+02:00"
before: "17:00:00+02:00"

extend:
title: Executes flow on schedule trigger with TimeBetween condition
description: >-
This flow gets triggered on an hourly basis with the schedule condition that
the time falls between 8am and 5pm of +02:00 timezone using the TimeBetween
condition.
The TimeBetween 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` time. Similarly, by providing
only the `after` clause, the condition will evaluate to true for any `date` that falls
after the `after` time.
By providing both the `before` and `after` time, the condition will evaluate
to true when the `date` falls between the `before` and the `after` time.
The flow will only get triggered if the associated TimeBetween condition
evaluates to true.
tags:
- Schedule
- Trigger
ee: false
demo: true
meta_description: This flow executes on schedule trigger with TimeBetween condition.

0 comments on commit 158f8f4

Please sign in to comment.