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 appdata fieldWhat it does
Wait fordurationHow 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.

  1. Script: Read the sale, which sets $.sale_body.

  2. REST Request: Send the first request, POST with Body {{ sale_body }}, Response variable first_res, Fail on bad response code on.

  3. Script: Read the response

    var r = JSON.parse($.first_res.body);
    $.job_ref = r.id;
  4. Wait: Wait 10 seconds, Wait for 10.

  5. REST Request: Send the follow-up, GET https://api.example.com/jobs/{{ job_ref }}, Response variable status_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.

← All Glue step guides


Did this page help you?