Create a workflow based on a webhook that ask users to connect via Google and use this as impersonate

Hello n8n Community,

I’m working on a workflow that involves triggering a Google OAuth consent screen for users and then using their Google credentials to impersonate them and interact with various Google services (like Google Sheets, Drive, etc.). Specifically, my use case is to:

  1. Use a Webhook as the trigger that prompts users to authenticate with Google.
  2. Redirect users to the Google OAuth consent screen so they can grant permissions.
  3. Once the user authorizes the app, retrieve their access token.
  4. Use this token to impersonate the user and perform actions on their behalf (such as reading from or writing to their Google Sheets).

However, I couldn’t find a built-in way to redirect users to the Google OAuth consent screen directly in the workflow (using something like a webhook or HTTP trigger). The closest I’ve gotten is the ability to set up OAuth credentials manually in n8n, but I’d like this process to be user-triggered so that each user connects their own Google account via OAuth.

Questions:

  1. Is there a way to dynamically trigger the Google OAuth consent screen via a webhook or similar trigger in n8n?
  2. How can I capture the OAuth token from the user’s Google login and store it in n8n for use in further nodes like Google Sheets or Drive?
  3. Can the Google OAuth credentials be linked dynamically to users, so that each user’s actions in the workflow are authenticated as them?

I’m looking for a way to automate this entire process—starting from the webhook trigger, redirecting the user to the Google login, and using their credentials dynamically.

Thanks for any insights or guidance!

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @E_A,

Welcome to the community :raised_hands:

I don’t have an example worklfow for this but it may be worth noting that using other peoples credentials in a workflow is typically a good indicator that you will need an embed or enterprise license. If you don’t already have one of these I would get in touch with the sales / license team to go over the options and to confirm if you don’t need one, They may also have examples from other customers who have done this.