Wait a while

Overview

Wait a While pauses flow execution for a specified duration in milliseconds. Use this to introduce delays between operations, rate-limit API calls, implement retry delays, or give external systems time to process.

Configuration

Required Fields

FieldDescriptionExample 
TimeDuration in milliseconds to pause execution1000 (1 second), 5000 (5 seconds), {{DelayedTime}}

Exit Points

ExitWhenFlow Direction 
PassWait duration completed successfully✓ Flow continues after delay

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: {{DelayedTime}}
  • Flow: Call API → Route Flow (on fail) → Wait → Retry
  • Result: Retry with 2-second delay after failure

4. Exponential Backoff

  • Time: =({{DelayedTime}}*{{attempt}})
  • Flow: Increment attempt → Wait (exponential) → Retry API
  • Result: Each retry waits progressively longer (1s, 2s, 4s, etc.)

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, 60000 = 1 minute)
Variable Support✓ Accepts variables: {{DelayedTime}}
Formula Support✓ Accepts formulas: =({{DelayedTime}}*{{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: {{DelayedTime}}
  • ✓ Add comments explaining why delay is needed
  • ✓ Start with smaller values and increase if needed
  • ✓ Use for rate-limiting external API calls
  • ✓ Combine with retry logic for robust error handling
  • ✓ Avoid very long waits (> 30 minutes) that tie up resources

Common Mistakes

MistakeSymptomFix 
Using seconds instead of milliseconds60 pauses 60ms, not 60 secondsMultiply by 1000: use 60000 for 60 seconds
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
Very large delays blocking flows30-minute wait ties up resourcesConsider Run Later for scheduled processes instead
Variable not initializedError during executionUse Set Default Value to initialize delay variable first

Troubleshooting

IssueExit/ResultCommon CauseFix 
Flow pauses too longPass (delayed)Milliseconds too large or seconds used insteadReduce value or convert to ms (multiply by 1000)
Flow doesn't pausePass (immediate)Time = 0 or very small valueIncrease milliseconds value
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
  • Very large values (> 1 hour): Flow blocked for extended period; may timeout at caller
  • Negative numbers: Undefined behavior; likely error
  • 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

Was this article helpful?