← All DaVinci Resolve API guides
DaVinci Resolve APIIntermediateRender

How to Clear the Render Queue with the DaVinci Resolve Python API

Use GetRenderJobs, GetRenderJobList, DeleteRenderJob, and StopRendering before a fresh export

Build a defensive Render Queue cleanup routine: enumerate existing jobs, extract their job IDs, stop an active render if necessary, and remove stale jobs before creating a new one.

API

Resolve Scripting API

Language

Python

Resolve

19–20+

Requires

Running Resolve

Syntax

project.StopRendering()
project.DeleteRenderJob(job_id)

Parameters

  • The relevant arguments are shown in the complete working example below. Validate paths, object types, and required project state before calling the API method.

Returns

Always validate the returned object, list, identifier, or boolean before continuing to the next automation step.

Complete working Python exampleuse it as a starting point for your own script
import os
import sys
from pathlib import Path


def import_resolve_module():
    try:
        import DaVinciResolveScript as dvr
        return dvr
    except ImportError:
        search_paths = [
            os.environ.get("RESOLVE_SCRIPT_API", ""),
            os.environ.get("RESOLVE_MODULES", ""),
            r"C:\\ProgramData\\Blackmagic Design\\DaVinci Resolve\\Support\\Developer\\Scripting\\Modules",
            "/opt/resolve/Developer/Scripting/Modules",
            "/opt/BlackmagicDesign/DaVinciResolve/Developer/Scripting/Modules",
            "/Library/Application Support/Blackmagic Design/DaVinci Resolve/Developer/Scripting/Modules",
            str(Path.home() / "Library/Application Support/Blackmagic Design/DaVinci Resolve/Developer/Scripting/Modules"),
        ]
        for path in search_paths:
            if path and os.path.isdir(path) and path not in sys.path:
                sys.path.append(path)
        import DaVinciResolveScript as dvr
        return dvr


def safe_call(obj, name, *args):
    try:
        fn = getattr(obj, name, None)
        if callable(fn):
            return fn(*args)
    except Exception:
        return None
    return None


dvr = import_resolve_module()
resolve = dvr.scriptapp("Resolve")
if not resolve:
    raise RuntimeError("DaVinci Resolve API is unavailable")

project = resolve.GetProjectManager().GetCurrentProject()
if not project:
    raise RuntimeError("No DaVinci Resolve project is open")

timeline = project.GetCurrentTimeline()
if not timeline:
    raise RuntimeError("No active Timeline")
def extract_render_job_id(job):
    if isinstance(job, dict):
        return job.get("JobId") or job.get("jobId") or job.get("JobID") or job.get("Id") or job.get("id")
    return job


def clear_render_queue(project) -> dict:
    safe_call(project, "StopRendering")

    deleted = 0
    failed = 0
    attempts = []

    for _ in range(3):
        jobs = safe_call(project, "GetRenderJobs") or safe_call(project, "GetRenderJobList") or []
        if not jobs:
            break

        changed = False
        for raw_job in jobs:
            job_id = extract_render_job_id(raw_job)
            if not job_id:
                continue

            variants = [job_id, str(job_id), raw_job]
            try:
                variants.append(int(job_id))
            except Exception:
                pass

            ok = False
            for value in variants:
                if safe_call(project, "DeleteRenderJob", value):
                    ok = True
                    break

            attempts.append({"job_id": str(job_id), "deleted": ok})
            if ok:
                deleted += 1
                changed = True
            else:
                failed += 1

        if not changed:
            break

    remaining = safe_call(project, "GetRenderJobs") or safe_call(project, "GetRenderJobList") or []
    return {"deleted": deleted, "failed": failed, "remaining_count": len(remaining), "attempts": attempts}


print(clear_render_queue(project))

Guide

Why queue cleanup matters

Calling StartRendering without a specific job ID can start every queued task. Before an automated final render, it is therefore useful to stop any active export and remove stale jobs so the queue contains only the work you intend to run.

Why the helper accepts several job-ID shapes

Resolve versions can expose a render task as a string, a number, or a dictionary containing fields such as JobId. The example extracts the logical ID and tries compatible DeleteRenderJob forms instead of assuming one representation works everywhere.

What the cleanup result reports

The helper returns how many jobs were deleted, how many deletion attempts failed, what remains in the queue, and the individual attempts. That information is useful for logs and for deciding whether the next Render Job should be launched strictly by ID.

How the example works

1

Connect to Resolve

Establish a Resolve Scripting API connection and stop early if the application object is unavailable.

2

Validate the current context

Check the active project, Timeline, Media Pool, source paths, or Render Queue state required by this specific operation.

3

Run the core API operation

Execute the operation demonstrated in this guide: how to clear the render queue with the davinci resolve python api.

4

Validate the result

Check the returned value before the workflow continues. Resolve methods often signal an unavailable object or failed operation with None, False, or an empty result.

Resolve API notes

  • Not every Resolve version behaves identically when deleting old queue entries through the API.
  • If cleanup is incomplete, start the new job explicitly by its ID instead of launching the whole queue.
  • StopRendering() is called before deletion so an active export is not modified blindly.
  • This script changes the project’s Render Queue.

Common errors

Resolve API is unavailable

Reason: Resolve is closed or Python cannot import/use DaVinciResolveScript.

Fix: Start Resolve and verify the Developer/Scripting/Modules path from the same Python interpreter used by the script.

The method returns None or False

Reason: A required project, Timeline, clip, preset, path, or application state is missing.

Fix: Validate each input and add explicit result checks after important Resolve API calls.

The script only works on one workstation

Reason: Paths or environment assumptions are hard-coded for a single operating system or machine.

Fix: Move paths into configuration and support the required Windows, Linux, and macOS locations explicitly.

Next step

Continue only after the current operation has returned the expected Resolve object or result.

Related API guides