Run Job step

Start another Glue job, and optionally wait for its result.

The Run Job step starts another Glue job from this one. Use it to split a big job into smaller ones you can reuse, like one "update stock" job that several other jobs call.

Set it up

In the appdata fieldWhat it does
JobjobThe job to run. Pick it from the list, or use a job ID or the exact job name. Liquid works.
ModemodeAsync (the default) starts the job and carries on. Sync runs it now and waits for it.
PayloadpayloadSent to the other job as its default variable, just like a webhook body. Liquid works, so {{ rows_json }} is fine. For Async, up to 1 MB.
Continue on errorcontinue_on_errorSync only. Records the other job's error in the result instead of failing this step.
Response variableresponse_variableSaves the result (see below).
📘

Up to 5 levels deep

A job can start another job at most 5 levels deep. Past that, the step stops the run with an error, which usually means a job is calling itself.

Async or Sync?

AsyncSync
When it runsQueued, and starts on its own a moment later.Straight away, inside this run.
Does this job wait?No.Yes.
Time limitThe other job gets its own.Shares this job's 270 seconds, loop and nesting limits.
Response variable{status: "queued", job_id}{job_id, status, error, variables}
If the other job failsIt's retried on its own, and shows up in Glue errors.This step fails too, unless Continue on error is on.

With Sync, status is success or error, error holds the message, and variables holds the other job's variables when it finished, so you can read its results: $.stock_run.variables.updated.

In a test (when you select Run in the job editor), Async only logs the job it would start. Nothing is queued.

Example 1: Run the stock job and use its result

Trigger: Webhook.

  1. Script: Read the payload: $.stock_payload = $.default;

  2. Run Job: Run the stock job, Job Update stock, Mode Sync, Payload {{ stock_payload }}, Continue on error on, Response variable stock_run.

  3. Script: Read the result

    if ($.stock_run.status !== "success") {
      console.error("Stock job failed:", $.stock_run.error);
    }
    $.updated = $.stock_run.variables.updated || 0;

Example 2: Hand an import off to another job

Trigger: Webhook.

  1. Script: Read the import rows

    var rows = JSON.parse($.default).rows || [];
    $.rows_json = JSON.stringify(rows);
  2. Run Job: Run the import job, Job Import products, Mode Async, Payload {{ rows_json }}.

The webhook job finishes quickly, and the import runs on its own with its own time limit.

Tips

  • Name jobs clearly. If you use a name in Job, it has to match exactly. A job ID doesn't change when someone renames the job.
  • Payloads arrive as text. In the other job, start with JSON.parse($.default), as you would for a webhook.
  • Retries skip it at the top level. A top-level Run Job that already worked isn't repeated when this job is retried.

← All Glue step guides


Did this page help you?