Problem with HTTP Request in One Branch – OAuth2 Credentials Not Working

Hi everyone,

I’m working on a workflow in n8n that automatically publishes posts to Twitter (X). The workflow has two main branches:

  • The middle branch generates content, finds a suitable image using OpenAI, transforms the image ID, and successfully publishes the post using X OAuth2 API credentials. Everything works perfectly here.
  • The top branch uses a pre-existing image from Google Drive. This branch fails during the HTTP Request step, regardless of which credentials I use.

The error I get is:

Forbidden – perhaps check your credentials?

However, I’ve confirmed that:

  • Both sets of X OAuth2 credentials are valid and work correctly in the middle branch.
  • The Google Drive file is publicly accessible.
  • I’ve tried different configurations and small adjustments in the HTTP node, but the error persists.

Unfortunately, I can’t remove the HTTP Request node from this branch, because it’s used to decode and convert the image ID into a format that the Twitter node accepts.

I suspect the problem might be related to how the request is structured or how the image is being retrieved, possibly triggering Cloudflare security filters.

My questions:

  1. Has anyone faced a similar issue where an HTTP request works in one path but fails in another, using the same credentials?
  2. Could this be related to how the Google Drive image is handled or passed through the HTTP node?
  3. Is there an alternative way to transform the image ID without using a failing HTTP request?

Any ideas or guidance would be greatly appreciated. Thanks in advance!

Hey @Daniil_Postoian ,

The error “perhaps check your credentials” is a cloudflare error usually blocking bots or suspicious traffic. It clearly says that it has detected a suspicious behavior.

What are you doing exactly in the http node before the X node?

Hi @mrrobot!
Thanks for answering!

HTTP Request node (HTTP Request3) is used to upload an image to Twitter via the API https://api.x.com/2/media/upload.

Its function is to send the image (retrieved from Google Drive) to Twitter using multipart/form-data with the media parameter. The API responds with a media_id, which is then used in the Post with Image node to publish the tweet with the attached image.

This step is necessary because Twitter requires media files to be uploaded in advance via their API before they can be attached to a post.

Hey @Daniil_Postoian ,

Can you screenshot the http node or embed your Workflow please so i could help you.

1 Like

Hi @mrrobot , thank you for trying to help, but my teammate managed to solve the problem. It turned out the issue wasn’t with the credentials as I initially thought, but with the filename being passed from Google Drive.
Thanks again for paying attention to my issue!