Templates / Unload idle Ollama models and log GPU usage with HTTP and file writes

Unload idle Ollama models and log GPU usage with HTTP and file writes

Ready for 3.0

by Kevin · 0 views · created 2026-10-04 · DevOps

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What this workflow does

This workflow has 10 nodes and runs manually, when you click “Execute workflow” (plus 1 other trigger). It uses only n8n's built-in nodes.

How it runs

Trigger: Manually, when you click “Execute workflow” (plus 1 other trigger).

  1. Settings (Edit Fields (Set)): sets 6 fields: ollamaUrl, dryRun, idleMinutes…
  2. List loaded models (HTTP Request): calls an HTTP API (GET)
  3. Decide idle models (Code): runs custom JavaScript code
  4. Changed since last run? (If): checks a condition and branches into true / false
  5. Live unload needed? (If): checks a condition and branches into true / false
  6. Pack log line (Code): runs custom JavaScript code
  7. Unload model in Ollama (HTTP Request): calls an HTTP API (POST)
  8. Append guard log (Read/Write Files from Disk): writes a file to disk

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Nodes used (7)

From the author

Quick Overview This workflow runs manually or every 10 minutes to check which Ollama models are loaded, log state changes to a file, and optionally unload models that have been idle too long to free GPU memory. How it works 1. Runs on a manual trigger or on a…

Excerpt from Kevin's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.