Rotate Gemini API Keys in Doppler and n8n
Learn how to generate new Google AI Studio Gemini API keys, update production secrets in Doppler, update n8n credentials, and revoke old keys.
Purpose
This guide details the procedure for generating and rotating Google Gemini API keys across core services. Completing this workflow ensures updated credentials sync properly to production in Doppler and to automated workflows in n8n, ending with the secure deletion of obsolete keys in Google AI Studio.
Scope
This procedure applies to technical operations and engineering team members responsible for maintaining production credentials and automation workflows. It covers generating API keys in Google AI Studio, updating environment secrets for the Sales Genius Portal in Doppler, updating automation credentials in n8n, and revoking deprecated keys. Third-party integrations outside Doppler and n8n are out of scope.
Generate and Update the Sales Genius Portal Key
Navigate to aistudio.google.com to begin the rotation process.





Sales Genius Portal.






Gemini.




Saving this secret automatically syncs the updated Gemini key to the DigitalOcean Sales Genius portal environment.
Generate and Update the n8n Key
Return to Google AI Studio to generate a dedicated key for automated workflows.


n8n Sales Genius.




Gemini.



Revoke Deprecated Keys
Once both destination systems have received their updated keys, revoke the old keys in Google AI Studio.




FAQ
Q: Why are two separate Gemini API keys created during this process?
A: One key is dedicated to the Sales Genius Portal and stored in Doppler, while the other is dedicated specifically to n8n automated workflows.
Q: How does saving the key in Doppler affect downstream hosting?
A: Saving the updated secret in the Doppler production (prd) environment automatically syncs the value down to the DigitalOcean Sales Genius portal.
Q: When is it safe to delete the old keys from Google AI Studio?
A: Only delete obsolete keys after both Doppler and n8n have received and saved their respective new API keys.
Glossary
Term | Definition |
|---|---|
Google AI Studio | The web interface used to generate, configure, and manage Google Gemini API keys. |
Doppler | The centralized secret management platform used to store and sync production environment variables. |
prd | The Doppler production environment branch for the Sales Genius Portal project. |
n8n | The workflow automation tool executing scheduled and event-based processes utilizing the Gemini integration. |