Hello n8n Community,
I’ve been working on a complex Google Chat bot and have hit a complete wall on the final step. I’m hoping someone in the community has experience with this specific API call.
My Goal: I’m trying to build a workflow where my bot receives a message (text or audio), generates a response with the AI Agent, converts the AI’s text response into an audio file (using OpenAI TTS), and then sends that generated audio file back as a reply in Google Chat.
My Workflow Overview: The workflow correctly handles both text and audio inputs. The audio is transcribed, a response is generated by the AI Agent, and OpenAI successfully creates an .opus
audio file as binary data within n8n. Everything works perfectly up to the final step of sending the reply.
The Problem: I cannot get the final HTTP Request
node to successfully upload the generated audio file to Google Chat. I am using the documented two-step process (upload media, then create a message with the returned name), but the first “upload” step always fails with an error from Google’s servers.
Depending on the exact URL and configuration, I consistently get one of these two errors:
404 Not Found - The resource you are requesting could not be found
400 Bad Request - Missing or malformed space resource name in the request
400 Bad Request - No file found in request
What I Have Already Tried (The Troubleshooting Journey):
I have spent many hours debugging this and have confirmed the following:
- Authentication: My
Chat OAuth2 API
credential works perfectly. I can use it with aGoogle Chat
node or anHTTP Request
node to send text messages successfully. - Google Cloud Project: The Google Chat API is enabled . My OAuth Consent screen has the correct scopes (
chat.messages
,chat.spaces
,chat.memberships
). My app is in “Testing” mode with my user correctly added as a Test User. - Google Workspace: My admin settings are configured to allow third-party app access.
- API Endpoints: I have tried multiple variations of the upload URL based on Google’s documentation and community suggestions, including:
https://chat.googleapis.com/v1/media:upload
https://chat.googleapis.com/upload/v1/spaces/{spaceName}/attachments:upload
- The same URL with a
?filename=
query parameter.
- Request Format: I have tried sending the file using the
HTTP Request
node with theBody Content Type
set to bothBinary Data
andForm-Data (multipart/form-data)
. - Multipart Payloads: I have tried building a
multipart
request with two parts as suggested by Google’s API requirements: a JSONmetadata
part and the binaryfile
part. - Data Handling: I have used
Merge
,Set
, andCode
nodes to ensure that all necessary data (spaceName
, the binarydata
property with a correctfileName
) is present and correctly formatted in the item that is fed into the finalHTTP Request
node. The errors persist even when hardcoding values like thespaceName
. - n8n Limitations: I have encountered and worked around a
source.on is not a function
crash by using aRead/Write Files from Disk
node to save the binary data before the upload attempt. The upload still fails even with this workaround.
My Question for the Community:
- Has anyone successfully used a custom
HTTP Request
node to upload a generated binary file to Google Chat? If so, could you share the correct node configuration? - Is there a known bug or limitation in n8n v1.95.3 that would explain why the
HTTP Request
node fails to build this specificmultipart/form-data
request correctly? - Is the consistent
404 / 400
error a known issue for Google Chat apps in “Testing” mode (i.e., does this feature only work for published marketplace apps)?
I have exhausted every possible troubleshooting step I can think of. Any insight or alternative methods the community might have would be incredibly appreciated.
Thank you!
Phil