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 app | data field | What it does |
|---|---|---|
| Job | job | The job to run. Pick it from the list, or use a job ID or the exact job name. Liquid works. |
| Mode | mode | Async (the default) starts the job and carries on. Sync runs it now and waits for it. |
| Payload | payload | Sent 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 error | continue_on_error | Sync only. Records the other job's error in the result instead of failing this step. |
| Response variable | response_variable | Saves the result (see below). |
Up to 5 levels deepA 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?
| Async | Sync | |
|---|---|---|
| When it runs | Queued, and starts on its own a moment later. | Straight away, inside this run. |
| Does this job wait? | No. | Yes. |
| Time limit | The 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 fails | It'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.
-
Script: Read the payload:
$.stock_payload = $.default; -
Run Job: Run the stock job, Job
Update stock, Mode Sync, Payload{{ stock_payload }}, Continue on error on, Response variablestock_run. -
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.
-
Script: Read the import rows
var rows = JSON.parse($.default).rows || []; $.rows_json = JSON.stringify(rows); -
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.
Updated about 23 hours ago
