Condition to allow events between two specific datetime values.

yaml
type: "io.kestra.plugin.core.condition.datetimebetween"

Trigger condition to execute the flow only after the specific date.

yaml
id: schedule_condition_datetimebetween
namespace: company.team

tasks:
  - id: log_message
    type: io.kestra.plugin.core.log.Log
    message: "This flow will execute once every 5 minutes after the date 2025-12-31T23:59:59Z"

triggers:
  - id: schedule
    type: io.kestra.plugin.core.trigger.Schedule
    cron: "*/5 * * * *"
    conditions:
      - type: io.kestra.plugin.core.condition.DateTimeBetween
        date: "{{ trigger.date }}"
        after: "2025-12-31T23:59:59Z"

Trigger condition to execute the flow between two specific dates.

yaml
id: schedule_condition_datetimebetween
namespace: company.team

tasks:
  - id: log_message
    type: io.kestra.plugin.core.log.Log
    message: "This flow will be executed once every 5 minutes between the before and after dates"

triggers:
  - id: schedule
    type: io.kestra.plugin.core.trigger.Schedule
    cron: "*/5 * * * *"
    conditions:
      - type: io.kestra.plugin.core.condition.DateTimeBetween
        date: "{{ trigger.date }}"
        after: "2025-01-01T00:00:00Z"
        before: "2025-12-31T23:59:59Z"
Properties
Format date-time

The date to test must be after this one.

Must be a valid ISO 8601 datetime with the zone identifier (use 'Z' for the default zone identifier).

Format date-time

The date to test must be before this one.

Must be a valid ISO 8601 datetime with the zone identifier (use 'Z' for the default zone identifier).

Default {{ trigger.date }}

The date to test.

Can be any variable or any valid ISO 8601 datetime. By default, it will use the trigger date.