> ## Documentation Index
> Fetch the complete documentation index at: https://www.nexrender.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Nested Jobs

> Render child compositions first and automatically inject their output into a parent job

A nested job is a child render whose output is automatically injected as a video or image layer into a parent composition. You define it inline as an asset of `type: "job"` inside the parent's `assets` array - no separate API call required.

## How It Works

When Nexrender sees an asset with `type: "job"`, it:

1. Creates the child job and starts rendering it
2. Holds the parent in `pending` state until the child finishes
3. Takes the child's `outputUrl` and injects it into the layer specified by `layerName` in the parent composition
4. Renders the parent

The creation response returns immediately with the parent job ID and a `children` array containing the child job IDs, so you can track either independently.

## Basic Example

The simplest nested job: render a child composition and place its output into a layer called `"PrecompLayer"` in the parent.

```bash Request theme={null}
curl -X POST https://api.nexrender.com/api/v2/jobs \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "template": {
      "id": "PARENT_TEMPLATE_ID",
      "composition": "main"
    },
    "assets": [
      {
        "type": "job",
        "layerName": "PrecompLayer",
        "template": {
          "id": "CHILD_TEMPLATE_ID",
          "composition": "lower-third"
        },
        "assets": [
          {
            "type": "text",
            "layerName": "name",
            "value": "Jane Smith"
          },
          {
            "type": "text",
            "layerName": "title",
            "value": "Lead Designer"
          }
        ]
      }
    ]
  }'
```

```json Response theme={null}
{
  "id": "01PARENT_JOB_ID_HERE",
  "status": "pending",
  "outputUrl": "https://nx1-outputs-eu.nexrender.com/.../parent.mp4",
  "children": [
    {
      "id": "01CHILD_JOB_ID_HERE",
      "status": "queued",
      "outputUrl": "https://nx1-outputs-eu.nexrender.com/.../child.mp4"
    }
  ]
}
```

The parent starts as `pending`. Once the child finishes, the parent is automatically promoted to `queued` and rendered.

## Nested Job Asset Fields

| Field | Type | Required | Description |
| - | - | - | - |
| `type` | string | Yes | Must be `"job"` |
| `layerName` | string | Yes | Layer in the parent composition where the child's output is placed |
| `template.id` | string | Yes | Template ID for the child job |
| `template.composition` | string | Yes | Composition to render in the child |
| `assets` | array | No | Assets to inject into the child job |
| `preview` | boolean | No | Render the child at preview quality (default: `false`) |
| `settings.type` | string | No | Output type: `"video"` or `"image"` (default: `"video"`) |
| `settings.quality` | string | No | `"draft"` or `"full"` |
| `settings.codec` | string | No | Output codec (e.g. `"video_h264_vbr_15mbps"`) - see [full list](https://www.nexrender.com/docs/cloud/jobs/rendering_settings.md#codecs). An image child renders one frame as `image_png` or `image_jpeg`. A video child can't use `video_vp8_alpha` or `video_vp9_alpha`: the WebM is converted to H.264 for the parent, which drops the alpha channel, so use `video_prores_4444` for transparency |
| `settings.engine` | string | No | AE engine version: `"ae2025"` or `"ae2026"` (default: `"ae2026"`) |
| `settings.multiFrame` | boolean | No | Multi-Frame Rendering on (`true`) or off (`false`). If omitted, the render node's default applies |

## Multiple Nested Jobs

You can include more than one nested job asset in a single parent. All children render in parallel - the parent waits for all of them before proceeding.

```json theme={null}
{
  "template": {
    "id": "PARENT_TEMPLATE_ID",
    "composition": "final-scene"
  },
  "assets": [
    {
      "type": "job",
      "layerName": "IntroClip",
      "template": {
        "id": "INTRO_TEMPLATE_ID",
        "composition": "intro"
      }
    },
    {
      "type": "job",
      "layerName": "LowerThird",
      "template": {
        "id": "LOWER_THIRD_TEMPLATE_ID",
        "composition": "name-card"
      },
      "assets": [
        {
          "type": "text",
          "layerName": "speaker",
          "value": "Alex Johnson"
        }
      ]
    },
    {
      "type": "data",
      "layerName": "BackgroundColor",
      "property": "Color",
      "value": [0.1, 0.1, 0.9]
    }
  ]
}
```

Regular assets (like the `data` asset above) and nested job assets can coexist in the same `assets` array.

## Tracking a Nested Job

Track the parent job normally with `GET /jobs/:id`. The parent stays in `pending` while children are rendering and transitions to `queued` - then `render:dorender` - once all children complete.

To check the child job specifically, use its ID from the `children` array in the creation response:

```bash theme={null}
curl -X GET https://api.nexrender.com/api/v2/jobs/01CHILD_JOB_ID_HERE \
  -H "Authorization: Bearer YOUR_API_KEY"
```

## When to Use Nested Jobs

Nested jobs are useful when one composition depends on the rendered output of another:

* A lower-third animation that needs to be composited into a final scene
* A branded intro clip rendered from a separate template and inserted at the start
* A data-driven chart rendered in isolation and dropped into a presentation layout
* Any workflow where intermediate renders feed a final assembly composition

If you need to stitch multiple clips end-to-end rather than compositing them as layers, use a [Join Job](https://www.nexrender.com/docs/cloud/jobs/join_job.md) instead.

> [card] [Join Jobs](https://www.nexrender.com/docs/cloud/jobs/join_job.md)
>
> Concatenate multiple rendered clips into a single output video

> [card] [Tracking Renders](https://www.nexrender.com/docs/cloud/jobs/tracking_renders.md)
>
> Poll status or receive a webhook when rendering completes


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.