Wait step
Pause a Glue job for up to 60 seconds.
The Wait step pauses the run for a few seconds before the next step. Use it when another system needs a moment to catch up, such as an API that processes a request in the background before you can read the result.
Set it up
| In the app | data field | What it does |
|---|---|---|
| Wait for | duration | How many seconds to wait, from 1 to 60. |
Through the API the step type is sleep. A duration over 60 waits 60 seconds, with no error.
How it behaves
- The wait counts toward the job's time limit. A whole Glue job has 270 seconds, so a few long waits add up quickly.
- For anything longer than a minute, use Schedule Later, which can pause the rest of the job for up to 30 days without holding a run open.
Example: Send a follow-up after the first request settles
Trigger: System Hook, Create Sale.
-
Script: Read the sale, which sets
$.sale_body. -
REST Request: Send the first request,
POSTwith Body{{ sale_body }}, Response variablefirst_res, Fail on bad response code on. -
Script: Read the response
var r = JSON.parse($.first_res.body); $.job_ref = r.id; -
Wait: Wait 10 seconds, Wait for
10. -
REST Request: Send the follow-up,
GET https://api.example.com/jobs/{{ job_ref }}, Response variablestatus_res.
Tips
- Don't wait to work around rate limits in a loop. Ten passes with a 10-second wait is 100 seconds of your 270. Send fewer, bigger requests instead.
- Wait as little as you can. If the other system has a status endpoint, a short wait and a check is better than a long wait.
Updated about 23 hours ago
Did this page help you?
