orientation.sh
netops@nautobot:~$ nautobot-server help runjob

Nautobot Jobs

network automation that runs inside the source of truth
define repeatable network tasks
run on demand, schedule, or trigger
return logs, files, and JobResult
$ python manage.py? → nautobot-server

Why Jobs matter

Jobs turn Nautobot’s source-of-truth data into controlled, repeatable automation endpoints — with inputs, permissions, execution, logs, and results handled by the platform.

Validate

Compliance checks: console links, loopbacks, parent prefixes, and operational guardrails.

Change

Reserve prefixes, prep new locations, bulk-update objects, or perform governed writes.

Integrate

Fetch external data and import it into Nautobot through a traceable workflow.

$ inspect job model

Mental model

Separate the code you ship from the record Nautobot runs.

Job classPython source
metadata + variables
run() method
Job recordDatabase state
enabled/name
queue config
Run requestUI / API / CLI
schedule / hook
operator inputs
WorkerCelery task or
Kubernetes pod
executes logic
JobResultStatus, logs, files
visible in UI/API
auditable trail
$ cat jobs/hello_world.py

Anatomy of a Job

The smallest useful unit combines user inputs, metadata, a run method, and explicit registration.

from nautobot.apps import jobs

name = "Examples"

class HelloWorldJob(jobs.Job):
    who = jobs.StringVar(default="world")

    class Meta:
        name = "Hello World"

    def run(self, *, who):
        self.logger.info("Hello, %s!", who)

jobs.register_jobs(HelloWorldJob)

Build checklist

variables
User inputs become the form and API payload.

Meta
Controls how the Job appears and behaves.

run()
The execution entry point.

register_jobs()
Required for discovery.

$ job --safe-mode

Operate safely in production

dry-run first

Preview what will change; require an explicit commit path for writes.

idempotent logic

A second run should converge, not create duplicate objects.

bounded execution

Avoid infinite loops or daemons; use schedules for recurring work.

RBAC + approvals

Use permissions and approvals where the blast radius justifies it.

structured logs

Log inputs, decisions, skipped items, and failures at the right level.

small contracts

Keep variables simple; validate external data before updating Nautobot.

$ history | grep nautobot-server

Demo runbook

  1. Create
    Implement a tiny read-only check first.
  2. Register
    Call register_jobs() so Nautobot discovers it.
  3. Enable
    Use the Job record to turn availability on.
  4. Run
    Supply inputs through UI, API, CLI, schedule, or hook.
  5. Review
    Check JobResult, logs, and generated files.
# 1. add code under JOBS_ROOT
vim $NAUTOBOT_ROOT/jobs/compliance.py

# 2. discover new Job records
nautobot-server post_upgrade

# 3. inspect CLI options
nautobot-server help runjob

# 4. execute when ready
nautobot-server runjob --commit <job>
takeaways.md

Nautobot Jobs turn automation into an interface.

ship code · control access · queue execution · observe results

next: convert one recurring manual network check into a read-only Job with strong logs.