Liking cljdoc? Tell your friends :D

temporal.client.schedule


create-clientclj

(create-client options)
(create-client options timeout)

Creates a ScheduleClient instance suitable for interacting with Temporal's Schedules.

Arguments:

Creates a `ScheduleClient` instance suitable for interacting with Temporal's Schedules.

Arguments:

- `options`: Options for configuring the `ScheduleClient` (See [[temporal.client.options/schedule-client-options]] and [[temporal.client.options/stub-options]])
- `timeout`: Connection timeout as a [Duration](https://docs.oracle.com/javase/8/docs/api//java/time/Duration.html) (default: 5s)
sourceraw docstring

describeclj

(describe client schedule-id)

Describes an existing Temporal Schedule via a schedule-id


(let [client (create-client {:target "localhost:7233"})]
   (describe client "my-schedule")
Describes an existing Temporal `Schedule` via a schedule-id

```clojure

(let [client (create-client {:target "localhost:7233"})]
   (describe client "my-schedule")
 ```
sourceraw docstring

executeclj

(execute client schedule-id overlap-policy)

Runs a Temporal Schedule workflow execution immediately via a schedule-id


(let [client (create-client {:target "localhost:7233"})]
   (execute client "my-schedule" :skip)
Runs a Temporal Schedule workflow execution immediately via a schedule-id

```clojure

(let [client (create-client {:target "localhost:7233"})]
   (execute client "my-schedule" :skip)
 ```
sourceraw docstring

pauseclj

(pause client schedule-id)

Pauses an existing Temporal Schedule via a schedule-id


(let [client (create-client {:target "localhost:7233"})]
   (pause client "my-schedule")
Pauses an existing Temporal `Schedule` via a schedule-id

```clojure

(let [client (create-client {:target "localhost:7233"})]
   (pause client "my-schedule")
 ```
sourceraw docstring

rescheduleclj

(reschedule client schedule-id options)

Updates the current Temporal Schedule via a schedule-id. Uses the same options as schedule except :schedule.

The ScheduleHandle takes a unary function object of the signature:

(ScheduleUpdateInput) -> ScheduleUpdate


(let [client (create-client {:target "localhost:7233"})]
   (reschedule client "my-schedule" {:spec {:cron-expressions ["1 * * * *"]}})
Updates the current Temporal `Schedule` via a schedule-id.
Uses the same options as [[schedule]] except `:schedule`.

The `ScheduleHandle` takes a unary function object
of the signature:

(ScheduleUpdateInput) -> ScheduleUpdate

```clojure

(let [client (create-client {:target "localhost:7233"})]
   (reschedule client "my-schedule" {:spec {:cron-expressions ["1 * * * *"]}})
```
sourceraw docstring

scheduleclj

(schedule client schedule-id options)

Creates a Schedule with Temporal

Arguments:

  • client: ScheduleClient
  • schedule-id: The string name of the schedule in Temporal, keeping it consistent with workflow id is a good idea
  • options: A map containing the :schedule, :state, :policy, :spec, and :action option maps for the Schedule

:schedule options:

ValueDescriptionType
:trigger-immediately?Trigger one action immediately when the schedule is createdboolean
:memoArbitrary non-indexed metadata mapMap
:search-attributesIndexed schedule-level attributes. Supports simple and typed formats; see Search attribute input formats.Map

:state options:

ValueDescriptionType
:paused?Whether the schedule starts pausedboolean
:noteHuman-readable note describing the current stateString
:limited-action?Limit the schedule to :remaining-actions executionsboolean
:remaining-actionsNumber of actions remaining when :limited-action? is setlong

:policy options:

ValueDescriptionType
:overlapOverlap policy: :allow, :buffer, :buffer-one, :cancel, :skip, :terminatekeyword
:catchup-windowMaximum catch-up window for missed actionsDuration
:pause-on-failure?Pause the schedule if a workflow action failsboolean

:spec options:

ValueDescriptionType
:cron-expressionsCron expressions in Temporal cron syntaxList of String
:calendarsCalendar specsList of ScheduleCalendarSpec
:intervalsInterval specsList of ScheduleIntervalSpec
:start-atTime before which no actions are takenInstant
:end-atTime after which no actions are takenInstant
:jitterRandom jitter applied to each action timeDuration
:skip-atCalendar specs to skipList of ScheduleCalendarSpec
:timezoneIANA timezone name (e.g. US/Central, UTC); one of ZoneId/getAvailableZoneIdsString

:action options:

ValueDescriptionType
:workflow-typeThe workflow to startA temporal.workflow/defworkflow reference or its String name
:argumentsArguments passed to the started workflowSerializable value
:optionsWorkflow options for each started runSee temporal.client.core/create-workflow

:search-attributes is supported in both :schedule and :action :options. Both simple and typed formats are accepted; see Search attribute input formats.

(defworkflow my-workflow
  [args]
  ...)

(let [client (create-client {:target "localhost:7233"})]
  (schedule
   client
   "my-workflow-schedule"
   {:schedule {:trigger-immediately? false
               :search-attributes {"ScheduleType" {:type :keyword :value "hourly"}}}
    :state {:paused? false}
    :policy {:pause-on-failure? true}
    :spec {:cron-expressions ["0 * * * *"]}
    :action {:workflow-type my-workflow
             :arguments {:value 1}
             :options {:workflow-id "my-workflow"
                       :task-queue "my-task-queue"
                       :search-attributes {"WorkflowType" {:type :keyword :value "report"}}}}}))
Creates a `Schedule` with Temporal

Arguments:

- `client`: [ScheduleClient](https://www.javadoc.io/doc/io.temporal/temporal-sdk/latest/io/temporal/client/schedules/ScheduleClient.html)
- `schedule-id`: The string name of the schedule in Temporal, keeping it consistent with workflow id is a good idea
- `options`: A map containing the `:schedule`, `:state`, `:policy`, `:spec`, and `:action` option maps for the `Schedule`

`:schedule` options:

| Value                   | Description                                                 | Type    |
|-------------------------|-------------------------------------------------------------|---------|
| :trigger-immediately?   | Trigger one action immediately when the schedule is created | boolean |
| :memo                   | Arbitrary non-indexed metadata map                          | Map     |
| :search-attributes      | Indexed schedule-level attributes. Supports simple and typed formats; see [Search attribute input formats](/doc/workflows.md#search-attribute-input-formats). | Map |

`:state` options:

| Value               | Description                                                | Type    |
|---------------------|------------------------------------------------------------|---------|
| :paused?            | Whether the schedule starts paused                         | boolean |
| :note               | Human-readable note describing the current state           | String  |
| :limited-action?    | Limit the schedule to `:remaining-actions` executions      | boolean |
| :remaining-actions  | Number of actions remaining when `:limited-action?` is set | long |

`:policy` options:

| Value               | Description                                          | Type |
|---------------------|------------------------------------------------------|------|
| :overlap            | Overlap policy: `:allow`, `:buffer`, `:buffer-one`, `:cancel`, `:skip`, `:terminate` | keyword |
| :catchup-window     | Maximum catch-up window for missed actions           | [Duration](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/time/Duration.html) |
| :pause-on-failure?  | Pause the schedule if a workflow action fails        | boolean |

`:spec` options:

| Value              | Description                                           | Type |
|--------------------|-------------------------------------------------------|------|
| :cron-expressions  | Cron expressions in [Temporal cron syntax](https://docs.temporal.io/cron-job)   | List of String |
| :calendars         | Calendar specs                                        | List of [ScheduleCalendarSpec](https://www.javadoc.io/doc/io.temporal/temporal-sdk/latest/io/temporal/client/schedules/ScheduleCalendarSpec.html) |
| :intervals         | Interval specs                                        | List of [ScheduleIntervalSpec](https://www.javadoc.io/doc/io.temporal/temporal-sdk/latest/io/temporal/client/schedules/ScheduleIntervalSpec.html) |
| :start-at          | Time before which no actions are taken                | [Instant](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/time/Instant.html) |
| :end-at            | Time after which no actions are taken                 | [Instant](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/time/Instant.html) |
| :jitter            | Random jitter applied to each action time             | [Duration](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/time/Duration.html) |
| :skip-at           | Calendar specs to skip                                | List of [ScheduleCalendarSpec](https://www.javadoc.io/doc/io.temporal/temporal-sdk/latest/io/temporal/client/schedules/ScheduleCalendarSpec.html) |
| :timezone          | IANA timezone name (e.g. `US/Central`, `UTC`); one of [`ZoneId/getAvailableZoneIds`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/time/ZoneId.html#getAvailableZoneIds()) | String |

`:action` options:

| Value          | Description                                                         | Type |
|----------------|---------------------------------------------------------------------|------|
| :workflow-type | The workflow to start                                               | A [[temporal.workflow/defworkflow]] reference or its String name |
| :arguments     | Arguments passed to the started workflow                            | Serializable value |
| :options       | Workflow options for each started run                               | See [[temporal.client.core/create-workflow]] |

`:search-attributes` is supported in both `:schedule` and `:action :options`.
Both simple and typed formats are accepted; see [Search attribute input formats](/doc/workflows.md#search-attribute-input-formats).

```clojure
(defworkflow my-workflow
  [args]
  ...)

(let [client (create-client {:target "localhost:7233"})]
  (schedule
   client
   "my-workflow-schedule"
   {:schedule {:trigger-immediately? false
               :search-attributes {"ScheduleType" {:type :keyword :value "hourly"}}}
    :state {:paused? false}
    :policy {:pause-on-failure? true}
    :spec {:cron-expressions ["0 * * * *"]}
    :action {:workflow-type my-workflow
             :arguments {:value 1}
             :options {:workflow-id "my-workflow"
                       :task-queue "my-task-queue"
                       :search-attributes {"WorkflowType" {:type :keyword :value "report"}}}}}))
```
sourceraw docstring

unpauseclj

(unpause client schedule-id)

Unpauses an existing Temporal Schedule via a schedule-id


(let [client (create-client {:target "localhost:7233"})]
   (unpause client "my-schedule")
Unpauses an existing Temporal `Schedule` via a schedule-id

```clojure

(let [client (create-client {:target "localhost:7233"})]
   (unpause client "my-schedule")
 ```
sourceraw docstring

unscheduleclj

(unschedule client schedule-id)

Deletes a Temporal Schedule via a schedule-id


(let [client (create-client {:target "localhost:7233"})]
  (unschedule client "my-schedule")
Deletes a Temporal `Schedule` via a schedule-id

 ```clojure

(let [client (create-client {:target "localhost:7233"})]
   (unschedule client "my-schedule")
 ```
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close