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 found400 Bad Request - Missing or malformed space resource name in the request400 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 APIcredential works perfectly. I can use it with aGoogle Chatnode or anHTTP Requestnode 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:uploadhttps://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 Requestnode with theBody Content Typeset to bothBinary DataandForm-Data (multipart/form-data). - Multipart Payloads: I have tried building a
multipartrequest with two parts as suggested by Google’s API requirements: a JSONmetadatapart and the binaryfilepart. - Data Handling: I have used
Merge,Set, andCodenodes to ensure that all necessary data (spaceName, the binarydataproperty with a correctfileName) is present and correctly formatted in the item that is fed into the finalHTTP Requestnode. The errors persist even when hardcoding values like thespaceName. - n8n Limitations: I have encountered and worked around a
source.on is not a functioncrash by using aRead/Write Files from Disknode 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 Requestnode 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 Requestnode fails to build this specificmultipart/form-datarequest correctly? - Is the consistent
404 / 400error 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

