Centralized model

The idea is:

My different workflow used AI models, however now if I want to change it to the latest model, I need to change one by one instead of changing it in bulk. Hope we could have a global variable model of Gemini and let it change centralized in one place.

My use case:

I think it would be beneficial to add this because:

Any resources to support this?

Are you willing to work on this?

Totally agree this would be useful as a native feature — upvoted.

While it doesn’t exist natively yet, there’s a workaround I use across all my production workflows:

Use n8n Variables (or environment vars) + a Code node to select the model

If you’re on self-hosted, you can set an environment variable like DEFAULT_AI_MODEL=gemini-2.0-flash and then in a Code node at the top of each workflow:

const model = process.env.DEFAULT_AI_MODEL || 'gpt-4o-mini';
return [{ json: { model } }];

Then pipe that into your AI/LLM nodes using an expression. Updating one env var = all workflows pick it up on next execution.

If you’re on n8n Cloud, the approach is slightly different — use a “config” sub-workflow that returns your model settings, and call it with Execute Workflow at the start of each AI workflow. One place to update, everything stays in sync.

It’s not as clean as a global model dropdown would be, but it gets the job done for now. I’ve been running this pattern across my business workflows for a few months and it works well — especially when a new model drops and you want to test it without touching 10 different workflows.

This exact pattern (along with a few others I use to run my business on n8n) is in my starter pack if you want a working example: Stripe Checkout — but the code above is the core of it.