Wait a while

Overview

Wait a While pauses flow execution for a short duration in milliseconds, up to a maximum of 4000ms (4 seconds). Use it for brief pauses between operations. For any delay longer than 4 seconds, use Run Later instead. A value over 4000ms (or a negative value) is rejected: the stage passes immediately with no pause.

Example: Wait a while - setting the "Milliseconds to pause" field to 2000 (2 seconds) before continuing to the next stage.

Where to find it: Flow Control in the stage library.

Configuration

Required Fields

FieldDescriptionExample
TimeDuration in milliseconds to pause execution. Maximum 4000 (4 seconds)1000 (1 second), 4000 (4 seconds, the max), {{delayMs}}

Using functions in these fields: Any value field above accepts @ functions, for example @NowSecond for the current time or @calc(...) for a calculation. 

See Flows Functions for the full list.

Exit Points

ExitWhenFlow Direction
PassWait duration completed, OR the value was rejected (over 4000ms or negative)✓ Flow continues after the delay. If the value was rejected, the flow continues immediately with no pause

There is only a Pass exit. A rejected value does not route anywhere different: it still passes, just with no pause.

Need a longer delay? Use Run Later. Run Later does not block. The flow continues immediately down the Pass (green) path, while the scheduled action runs later on its own separate path.

How It Works

When executed, Wait a While:

  1. Resolves time value - Converts static number, variable, or formula to milliseconds
  2. Pauses current flow - Blocks execution for specified duration
  3. Returns Pass exit - Continues to next stage after delay completes

Important: This stage blocks the entire flow for the duration. No concurrent processing occurs during the wait.

Common Use Cases

1. Simple Delay

  • Time: 1000
  • Result: Pause 1 second (1000 milliseconds)

2. Rate Limiting API Calls

  • Time: 500
  • Flow: Loop → Call API → Wait 500ms → Next iteration
  • Result: API calls spaced 500ms apart (max 2 per second)

3. Configurable Retry Delay

  • Setup: Set Default Value: retryDelayMs = 2000
  • Time: {{retryDelayMs}}
  • Flow: Call API → Route Flow (on fail) → Wait → Retry
  • Result: Retry with 2-second delay after failure

4. Exponential Backoff

  • Time: ={{baseDelay * attempt}}
  • Flow: Increment attempt → Wait (exponential) → Retry API
  • Result: Each retry waits progressively longer (1s, 2s, up to the 4s max)

5. Batch Processing with Delays

  • Time: 100
  • Flow: Loop → Update database → Wait 100ms → Next record
  • Result: Database updates paced to avoid overload

Key Behaviors

FeatureBehavior
Time UnitMilliseconds (1000 = 1 second)
Maximum4000ms (4 seconds). Over 4000 or negative is rejected and passes with no pause. Combined wait across all Wait a While stages in a flow also cannot exceed 4 seconds
Variable Support✓ Accepts variables: {{delayMs}}
Formula Support✓ Accepts formulas: ={{baseMs * attempt}}
Zero DelayNo pause; stage returns immediately
Blocking BehaviorBlocks this flow only; other flows unaffected
Timeout InteractionOverall flow timeout may trigger during wait

Best Practices

  • ✓ Use milliseconds: 1000 = 1 second, not 1
  • ✓ Use variables for configurable delays: {{retryDelayMs}}
  • ✓ Add comments explaining why delay is needed
  • ✓ Start with smaller values; the maximum allowed is 4000ms (4 seconds)
  • ✓ Use for rate-limiting external API calls
  • ✓ Combine with retry logic for robust error handling
  • ✓ For any delay longer than 4 seconds, use Run Later instead of Wait a While

Common Mistakes

MistakeSymptomFix
Using seconds instead of millisecondsEntering 4 to mean "4 seconds" actually pauses for only 4 millisecondsMultiply by 1000 — for a 4-second pause, use 4000 (the maximum allowed)
Placing in loop without considering accumulationLoop with 1s delay × 100 iterations = 100s totalUse smaller delays in loops or batch differently
Assuming this handles timeoutsConfusion with timeout settingsUse Call API timeout settings for API timeouts
Trying to wait longer than 4 secondsValue over 4000ms is rejected; the stage passes with no pause at allReduce to 4000ms or less, or use Run Later for longer delays
Variable not initializedError during executionUse Set Default Value to initialize delay variable first

Troubleshooting

IssueExit/ResultCommon CauseFix
Flow doesn't pause at allPass (immediate, no delay)Value over 4000ms or negative, so it was rejectedReduce to 4000ms or less; for longer delays use Run Later
Flow pauses too longPass (delayed)Seconds used instead of ms, but capped at 4000msReduce value or convert to ms (multiply by 1000)
Flow doesn't pausePass (immediate)Time = 0 or very small valueIncrease milliseconds value (max 4000)
Error during waitErrorVariable not initialized or invalid formatEnsure Time field is numeric or valid variable
External system still not readyPassDelay too shortIncrease milliseconds; test with target system
Performance degradedPass (slow)Long delays in high-volume flowsReduce delay or batch process differently
Flow timeout errorErrorOverall flow timeout triggered during waitIncrease timeout or reduce wait duration

Edge Cases

  • Zero delay (Time = 0): No pause; stage returns immediately
  • Value over 4000ms: Rejected. The stage passes immediately with no pause. Attempting to run or test the flow with a static value over 4000 also surfaces an error in the builder
  • Negative numbers: Rejected. Same as over-limit: passes immediately with no pause
  • Concurrent flows: Only this flow pauses; other flows unaffected
  • Variable not initialized: Error during resolution; stage may fail

Related Stages

  • Run Later: Schedule delayed execution (vs blocking current flow)
  • Loop: Can include waits inside loop (delays accumulate)
  • Route Flow: Conditionally decide whether to wait
  • Call API: Use API timeout settings for request timeouts