Edited: The issue was that I didn’t realize I was handling two types of messages: text and image. The problem occurred specifically with image messages because they have a different JSON structure. Instead of sending a string, the image type message sends an object.
Additionally, the JSON object included keys and values that exceeded OpenAI’s 64-character limit. (I couldn’t find this documented officially, but it seems to be a common issue based on others’ experiences I saw online.).
To fix this, I updated the workflow to properly separate the logic using an IF node, ensuring that a JSON object isn’t sent for image URLs, and to handle image messages correctly within n8n. I also cleared the stored object containing the URL from the Supabase vector database.
Just to clarify: the issue isn’t that OpenAI doesn’t accept URLs in the payload. It’s that the structure wasn’t what the model expected. Even sending a long string (thousands of characters) is fine, but sending an unexpected object structure causes problems.
After these changes, everything went back to normal.