> ## 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.

# Advanced Rendering Practices

> Build cost-efficient, resilient rendering pipelines at scale

Building jobs at scale requires defensive design. Here's what we recommend.

## Always Provide Fallbacks

Your templates should gracefully handle empty or missing values. In After Effects, use `if` expressions or fallback layers hidden by default so a missing asset never crashes the render.

| Layer Type | Best Practice                           |
| ---------- | --------------------------------------- |
| Text       | Set a default like `"(Missing Title)"`  |
| Image      | Use a neutral brand logo or placeholder |
| Audio      | Default to a silent fallback track      |

## Validate Assets Before Submitting

Before sending a job, verify:

* The `composition` name exists - use `GET /templates/{id}` to inspect available compositions
* Every `layerName` matches exactly (case-sensitive)
* All asset URLs return `200 OK`
* Required fonts have been uploaded via the Fonts API

Catching these issues before submission avoids wasted render time.

## Use Webhooks Instead of Polling

Configure a `webhook.url` on each job so your system is notified the moment rendering completes or fails, rather than repeatedly querying the API:

```json theme={null}
{
  "webhook": {
    "url": "https://yourdomain.com/render-done",
    "headers": {
      "Authorization": "Bearer ${secrets.WEBHOOK_TOKEN}"
    }
  }
}
```

See [Webhooks](/docs/cloud/jobs/tracking_renders) for the full field reference, custom payloads, and retry behaviour.

## Implement Retry Logic

Jobs can occasionally fail due to transient render errors or temporary asset access issues. Build retries into your pipeline:

* Handle `status: "error"` in your webhook processor and resubmit the same payload
* Use a queue system that retries on `error` status with a backoff delay
* Limit retries to 2-3 attempts to avoid looping on a fundamentally broken payload

## Use Preview Mode for Iteration

Set `"preview": true` when developing or testing a new template. Preview renders are faster and cheaper, and catch most structural issues - missing layers, expression failures, layout shifts - before you commit to a full-quality render.

## Use Secrets for Credentials

Never embed storage credentials or API keys directly in a job payload. Store them as Nexrender secrets and reference them with `${secrets.NAME}`:

```json theme={null}
"accessKeyId": "${secrets.S3_KEY_ID}",
"accessKeySecret": "${secrets.S3_KEY_SECRET}"
```

See [Secrets Management](/docs/cloud/jobs/secrets) for how to create and reference secrets.

## Use Draft Quality for High-Volume Pipelines

When rendering large batches where visual fidelity is less critical (e.g., internal previews, thumbnails, QA passes), use `settings.quality: "draft"` to reduce render time and infrastructure cost per job.
