Hello n8n Community,
I am trying to connect to the Google Document AI API using the HTTP Request node, and I’m stuck in an authentication loop. I would be grateful for any help.
My Setup:
- n8n Version: 1.98.2 (Cloud)
- Goal: Call the Document AI
:processendpoint. - Credential Type Used:
Google Service Account API
What I Have Verified on Google Cloud:
- The
Document AI APIis enabled. - A Billing Account is active and correctly linked to the project.
- A Service Account exists with the
Document AI Administratorrole. - A JSON key for this service account has been created, downloaded, and is active.
The Problem in n8n:
I have created a Google Service Account API credential, successfully pasting the client_email and private_key from the JSON file.
In my HTTP Request node, I use this credential. The rest of the node (URL, Body, etc.) is configured correctly. However, I face a catch-22 depending on one switch in the credential’s configuration:
-
Scenario 1: When the credential’s
Set up for use in HTTP Request nodeswitch is OFF, the API call fails with a401 - CREDENTIALS_MISSINGerror. -
Scenario 2: When the credential’s
Set up for use in HTTP Request nodeswitch is ON, the API call fails with a400 - invalid_scopeerror.
I have spent many hours debugging this and have verified every setting on the Google Cloud side. It seems like a potential bug or issue with how this credential type interacts with the HTTP Request node in this version of n8n.
Could anyone advise on a solution or a workaround? Thank you very much.