Wait Steps
Pause workflow execution for timed delays
Wait Steps
Wait steps pause workflow execution for a specified duration. They're useful for rate limiting, scheduling delays, and allowing external processes to complete.
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Unique step identifier |
type | string | Yes | Must be "wait" |
name | string | Yes | Human-readable name |
config.duration | number | Yes | Wait time in milliseconds |
Duration
The duration field specifies how long to pause in milliseconds:
Common Durations
| Duration | Milliseconds | Use Case |
|---|---|---|
| 1 second | 1000 | Quick pause |
| 5 seconds | 5000 | Brief delay |
| 30 seconds | 30000 | Rate limiting |
| 1 minute | 60000 | Processing time |
| 5 minutes | 300000 | External sync |
| 1 hour | 3600000 | Scheduled delay |
Output
Wait steps return information about the wait:
| Field | Description |
|---|---|
waited | The actual duration waited (in ms) |
Common Patterns
Rate Limiting
Add delays between API calls to avoid rate limits:
Retry with Delay
Wait before retrying a failed operation:
Processing Delay
Wait for external system to process:
Scheduled Notification Delay
Delay a notification:
Polling Pattern
Poll for status with delays:
Dynamic Duration
Use template expressions for dynamic wait times:
Or calculate based on previous step output:
Best Practices
Reasonable Timeouts
Keep wait durations reasonable for your use case:
- API rate limiting: 100-1000ms
- Processing delays: 5-30 seconds
- Polling intervals: 5-60 seconds
- Scheduled delays: Use schedule triggers instead for hours/days
Avoid Long Waits
For delays longer than a few minutes, consider:
- Schedule triggers - Use cron or interval triggers instead
- Subworkflows - Split workflow at natural pause points
- External scheduling - Let external systems handle timing
Idempotency
Design steps after waits to be idempotent in case of restarts:
Troubleshooting
Wait Not Working
- Check duration type - Must be a number in milliseconds
- Verify template resolution - Dynamic values must resolve to numbers
- Check workflow status - Workflow must be active
Workflow Timeout
If your total wait time exceeds the workflow timeout:
- Split into subworkflows - Break at natural boundaries
- Use schedule triggers - For long delays
- Reduce polling frequency - Increase wait duration between checks
Resource Usage
Long-running waits consume resources:
- Use appropriate intervals - Don't poll too frequently
- Consider schedules - For regular intervals
- Monitor run duration - Track total workflow time