Templates / Queue OpenAI-compatible LLM chat requests with PostgreSQL and a local GPU

Queue OpenAI-compatible LLM chat requests with PostgreSQL and a local GPU

Ready for 3.0

by Wetomate AI ✓ · 5 views · created 2026-09-04 · Engineering, AI Chatbot

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-12-01.

📬 Weekly n8n 3.0 breakage alerts, free

What this workflow does

This workflow has 36 nodes and runs manually, when you click “Execute workflow” (plus 4 other triggers). Along the way it connects Postgres.

How it runs

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

  1. Init Queue Table in PostgreSQL (Postgres): run a query
  2. Set Model Discovery Params (Edit Fields (Set)): sets 1 field: configuredModelIds
  3. Set Chat Gateway Parameters (Edit Fields (Set)): sets 3 fields: waitPollSeconds, waitMaxAttempts, jobMaxAttempts
  4. Verify Task ID (Code): runs custom JavaScript code
  5. Set GPU Dispatcher Params (Edit Fields (Set)): sets 4 fields: upstreamChatCompletionsUrl, upstreamTimeoutMs, leaseMinutes…
  6. Execute Setup Code (Code): runs custom JavaScript code
  7. Display Configured Models (Code): runs custom JavaScript code
  8. Process Chat Request (Code): runs custom JavaScript code
  9. Check Valid Task ID (If): checks a condition and branches into true / false
  10. Handle Expired Task Leases (Postgres): run a query

…plus 20 more steps. See the full node list below.

Services it uses

Postgres

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.

Check at runtime on n8n 3.0
  • Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Informational: a static scan can't see the data, so test these on your own instance. Status above is unchanged.

Nodes used (11)

From the author

Quick overview An n8n-first, durable FIFO gateway for a local OpenAI-compatible language model. It accepts ordinary Chat Completions requests, queues them in PostgreSQL, runs one inference at a time, and supports human retrieval commands, automatic waiting by…

Excerpt from Wetomate AI'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.