Describe the problem/error/question
Is it possible to connect public users Oauth2 connection to the n8n workflow and run automations on their google drive that they logged in with? Meaning I have an automation where (in a perfect world) a user would log into through the website using google Oauth2 and is stored in supa base. then I would take the users google credentials and connect them to the workflow and run the automation. only issue is that n8n doesn’t allow (seemingly) for the credentials to replace the credentials that were only previsouly established before hand. Any idea on how to solve it?
What is the error message (if any)?
The workflow naturally works, just want to connect the users to the workflow.
Please share your workflow
{
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "revunote-intake",
"responseMode": "lastNode",
"responseData": "firstEntryBinary",
"options": {
"binaryPropertyName": "file"
}
},
"type": "n8n-nodes-base.webhook",
"typeVersion": 2.1,
"position": [
480,
-16
],
"id": "",
"name": "Upload File",
"webhookId": "44428cf2-a7ee-4d92-b724-055dfbaba5ef"
},
{
"parameters": {
"resource": "fileFolder",
"searchMethod": "query",
"queryString": "=mimeType = 'application/vnd.google-apps.folder'",
"returnAll": true,
"filter": {},
"options": {}
},
"type": "n8n-nodes-base.googleDrive",
"typeVersion": 3,
"position": [
1248,
-16
],
"id": "",
"name": "Search files and folders",
"alwaysOutputData": true,
"notesInFlow": false,
"credentials": {
"googleDriveOAuth2Api": {
"id": "u9ajJ6QE7LBIWuuW",
"name": "Google Drive account"
}
}
},
{
"parameters": {
"resource": "image",
"operation": "analyze",
"modelId": {
"__rl": true,
"value": "models/gemini-2.0-flash-exp-image-generation",
"mode": "list",
"cachedResultName": "models/gemini-2.0-flash-exp-image-generation"
},
"text": "",
"imageUrls": "={{ $json.fileUri }}",
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.googleGemini",
"typeVersion": 1,
"position": [
1040,
-16
],
"id": "",
"name": "Analyze an image",
"credentials": {
"googlePalmApi": {
"id": "",
"name": "Google Gemini(PaLM) Api account 2"
}
}
},
{
"parameters": {
"resource": "file",
"inputType": "binary",
"binaryPropertyName": "file0"
},
"type": "@n8n/n8n-nodes-langchain.googleGemini",
"typeVersion": 1,
"position": [
864,
-16
],
"id": "",
"name": "Upload a file",
"credentials": {
"googlePalmApi": {
"id": "IUTxxPbV8Mebe9Qr",
"name": "Google Gemini(PaLM) Api account 2"
}
}
},
{
"parameters": {
"tableId": "user_connections",
"dataToSend": "autoMapInputData"
},
"type": "n8n-nodes-base.supabase",
"typeVersion": 1,
"position": [
688,
-16
],
"id": "6263e8a4-141c-419d-afbf-192259f7ddd4",
"name": "Get User",
"credentials": {
"supabaseApi": {
"id": "q3o8MyNYWE4mc9pO",
"name": "Supabase account"
}
}
}
],
"connections": {
"Upload File": {
"main": [
[
{
"node": "Get User",
"type": "main",
"index": 0
}
]
]
},
"Search files and folders": {
"main": [
[]
]
},
"Analyze an image": {
"main": [
[
{
"node": "Search files and folders",
"type": "main",
"index": 0
}
]
]
},
"Upload a file": {
"main": [
[
{
"node": "Analyze an image",
"type": "main",
"index": 0
}
]
]
},
"Get User": {
"main": [
[
{
"node": "Upload a file",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {},
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": ""
}
}
The rest is not required for the question
Information on the n8n Setup:
- n8n version: 1.122.4
- Database (default: SQLite): N/A
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app): render.com
- Operating system: mac