Reference

Step Sleep (:sleep)

Quick Answer

Use :sleep to pause a flow without blocking workers.

Provide exactly one duration field: :seconds, :millis, or :duration.

Canonical Shape

FieldTypeRequiredNotes
:typekeywordYesMust be :sleep
:secondsintOne-ofInteger seconds
:millisintOne-ofInteger milliseconds
:durationstringOne-ofDuration string (for example "5m", "2h", "1d")
:timeoutintNoCommon step timeout option
:retrymapNoCommon step retry option

Limits And Behavior

  • Exactly one of :seconds, :millis, or :duration can be set.
  • If none is set, sleep defaults to 1 second.
  • Maximum duration is constrained by the workflow max-duration limit.

Result Shape

{:slept-seconds 30}

Canonical Example

{:functions [{:id :retry-delay
              :language :clojure
              :code "(fn [input]\n                       {:seconds (min 300 (max 1 (* 5 (or (:attempt input) 1))))})"}]
 :flow
 '(let [delay (flow/step :function :compute-delay
                 {:ref :retry-delay
                  :input (flow/input)})]
    (flow/step :sleep :backoff
      {:seconds (:seconds delay)}))}

Related

As of Feb 13, 2026