Skip to content

Wait

Waits for a relative duration or until an absolute date and time.

@lainstack/time/wait · Flow

Use this block to pause the run, then continue on out. The pause is a durable timer, so it survives restarts. For a pause that needs a person’s decision, use @lainstack/flow/approval. To calculate a date without pausing, use @lainstack/time/date-math.

  • mode delay waits for durationMs, from 1 second to 365 days. mode until waits for the datetime in until. delay needs durationMs. until needs until.
  • A target in until more than 365 days ahead fails the step.
  • If the until time has already passed, the block does not wait. It continues at once and wasPastDue is true.
  • until without an offset is read in timezone (default UTC). A local time that does not exist fails. A time that exists twice uses disambiguation, earlier by default. An until value with an offset ignores timezone for the instant.
  • The outputs describe the target moment (iso, epochMs, localIso, date, time, wasPastDue). They are fixed when the wait starts.
  • Inside @lainstack/flow/for-each-item, each item waits on its own timer.
Setting Key Type Details
Mode mode One of Delay, Until Default delay.
Duration durationMs Number
Target until Text
Timezone (required) timezone Text
Fold disambiguation One of Earlier, Later Default earlier.
Output Path Type
ISO target iso Text
Epoch milliseconds epochMs Number
Resolved timezone resolvedTimezone Text
Local target localIso Text
Date date Date
Time time Text
Was past due wasPastDue Yes or no