I have automated my X account (X OAuth 2) with my N8N workflow. Everything is working well and I post one image with each tweet.
I’m now trying to do an X post using TWO images as part of my workflow. But it looks like the media ID string cannot use two of them. Any idea or template to share on how to overcome this?
For posting multiple images on X/Twitter using the X OAuth 2 node, you’ll need to upload each image separately and combine their media IDs into an array. Here’s how:
1. Use the “Upload Media” node for each image to get their individual media IDs.
2. In the “Post” node, set the “Media IDs” field to an array containing both IDs, like this:
```json
[“media_id_1”, “media_id_2”]
```
Make sure to connect the media upload nodes before the post node in your workflow.
I had a system running X posts, through X. then i switched and tested some outside platforms. Way better for me. These are decent: GetXapi. Cheap. I like his docs on the Create Tweet api. I usually only post one image to X - but you can post multiple and video and the api does all the uploading FOR you.
Another api i mentioned before was twitterapi.io but I use GetXapi.com now. I believe proxy optional.
GetXapi requires an “auth_token” which is obtained by using their User Login api. I mean using it once; lasts a while.
**Attached is partial workflow section of: Content - Get your auth_token that you store in (Ggl Sheets) - GetXapi X Post
then… if / as needed Retry logic to obtain a new auth_token; Login - overwrite Ggl Sheet - loop back to try post again. Two retries (three total attempts) before the condition turns “False.” Maybe one Retry better. Your telegram, slack, or whathaveyou notifications can come off that failure, and off the Switch node. I like to get updates on the X posting; its so touchy.
Tu expresión es estructuralmente correcta. El problema probablemente está en el tipo de campo del nodo X de n8n. Si espera una cadena, un array se serializa incorrectamente. Inspecciona el cuerpo de la solicitud final antes de enviar. media.media_ids debe ser un array JSON de IDs de cadena. Carga cada imagen una sola vez. Luego envía ambos IDs devueltos en una única solicitud de crear-publicación. Añade una clave de idempotencia antes de habilitar reintentos. Un timeout puede crear publicaciones duplicadas de otro modo.
Xquik es una alternativa de API de X/Twitter para este flujo de trabajo. Su solicitud de crear-publicación acepta hasta 4 URLs de imagen públicas. Esto elimina nodos separados de carga e fusión de IDs en n8n. Envía la cuenta, el texto y el array de medios a través de un único nodo HTTP Request.
Para evitar problemas de UI o errores de serialización en el nodo X nativo sin tener que pagar por un servicio de terceros, se recomienda utilizar directamente un nodo HTTP Request con la API oficial de Twitter/X v2.
Subir Imágenes: Envía cada imagen a [https://upload.twitter.com/1.1/media/upload.json](https://upload.twitter.com/1.1/media/upload.json)
mediante form-data.
Publicar Tweet: Envía una solicitud POST a [https://api.twitter.com/2/tweets](https://api.twitter.com/2/tweets) con un cuerpo JSON: