Publicador para X/Twitter basado en formularios

Intermedio

Este es unMarketingflujo de automatización del dominio deautomatización que contiene 8 nodos.Utiliza principalmente nodos como If, Code, Form, Twitter, FormTrigger. Publicador de X/Twitter basado en formularios

Requisitos previos
  • Credenciales de API de Twitter
  • Pueden requerirse credenciales de autenticación para la API de destino

Categoría

Vista previa del flujo de trabajo
Visualización de las conexiones entre nodos, con soporte para zoom y panorámica
Exportar flujo de trabajo
Copie la siguiente configuración JSON en n8n para importar y usar este flujo de trabajo
{
  "meta": {
    "instanceId": "7d8066d2f56a07000fe7d753d3eeabf0ecdf68413466f30d10afe0906f058427",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "02b20189-94ce-4608-9c8d-a29a9d97db32",
      "name": "Al enviar el formulario",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -340,
        -140
      ],
      "webhookId": "8d789827-135b-47a3-86ee-79492636d079",
      "parameters": {
        "options": {
          "buttonLabel": "Submit",
          "appendAttribution": false
        },
        "formTitle": "Post to X",
        "formFields": {
          "values": [
            {
              "fieldType": "textarea",
              "fieldLabel": "Post Content",
              "requiredField": true
            },
            {
              "fieldType": "file",
              "fieldLabel": "Media",
              "multipleFiles": false,
              "acceptFileTypes": ".jpg, .png, .mp4, .mov, .jpeg, .gif, .heif, .webp, .tiff "
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "750c5cb0-16fd-463f-ad6f-8558fbf51360",
      "name": "Extraer detalles del medio",
      "type": "n8n-nodes-base.code",
      "position": [
        -120,
        -140
      ],
      "parameters": {
        "jsCode": "const post_content = $input.first().json[\"Post Content\"];\nconst file = $input.first()?.json[\"Media\"]?.[0];\nconst binaryData = $input.first()?.binary?.[\"Media\"];\n\nlet mime_type = null;\nlet media_type = null;\n\nif (file && binaryData) {\n  mime_type = file.mimetype || \"\";\n\n  if (mime_type.startsWith(\"image/\")) {\n    media_type = \"IMAGE\";\n  } else if (mime_type.startsWith(\"video/\")) {\n    media_type = \"VIDEO\";\n  } else if (mime_type.startsWith(\"audio/\")) {\n    media_type = \"AUDIO\";\n  }\n}\n\nconst result = {\n  content: post_content,\n  mime_type,\n  media_type,\n};\n\nconst output = {\n  json: result,\n};\n\nif (binaryData) {\n  // @ts-ignore\n  output.binary = {\n    media: binaryData,\n  };\n}\n\nreturn [output];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "2be2cb40-2170-4388-b447-8e282f6ab85c",
      "name": "Subir medio (X)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        320,
        -240
      ],
      "parameters": {
        "url": "https://upload.twitter.com/1.1/media/upload.json?media_category=TWEET_IMAGE",
        "method": "POST",
        "options": {
          "response": {
            "response": {
              "responseFormat": "json"
            }
          }
        },
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "media",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "media"
            }
          ]
        },
        "nodeCredentialType": "twitterOAuth1Api"
      },
      "credentials": {
        "twitterOAuth1Api": {
          "id": "II0YlgWMqJBDlQ8f",
          "name": "X OAuth - Akhil"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "4c947ff2-3753-41a0-8ea7-ffa38bc159f2",
      "name": "X",
      "type": "n8n-nodes-base.twitter",
      "position": [
        540,
        -240
      ],
      "parameters": {
        "text": "={{ $('Extract Media Details').first().json.content }}",
        "additionalFields": {
          "attachments": "={{ $json.media_id_string }}"
        }
      },
      "credentials": {
        "twitterOAuth2Api": {
          "id": "1llweRRwiqe7gFwJ",
          "name": "X OAuth2 - Akhil"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "d4706df1-dce1-4005-8e82-e4cca57265f7",
      "name": "Si existe imagen",
      "type": "n8n-nodes-base.if",
      "position": [
        100,
        -140
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "43da4ad0-1edb-407c-afc8-5a2ba5ea5388",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.mime_type }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "4f53c3ab-8ec5-437f-8a94-93584590be9a",
      "name": "X1",
      "type": "n8n-nodes-base.twitter",
      "position": [
        540,
        -40
      ],
      "parameters": {
        "text": "={{ $json.content }}",
        "additionalFields": {}
      },
      "credentials": {
        "twitterOAuth2Api": {
          "id": "1llweRRwiqe7gFwJ",
          "name": "X OAuth2 - Akhil"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "4ca9c2b4-840a-4aa6-9b01-0e8f34eb1165",
      "name": "Finalizar formulario",
      "type": "n8n-nodes-base.form",
      "position": [
        760,
        -140
      ],
      "webhookId": "21143d55-557b-43e2-94f7-6d617af3e5dc",
      "parameters": {
        "options": {},
        "operation": "completion",
        "completionTitle": "Thank you so much for sharing your experience on X! 🖤 ",
        "completionMessage": "We truly appreciate your support and are so glad we could make a positive impact. Your words mean the world to us!"
      },
      "typeVersion": 1
    },
    {
      "id": "4b443e27-94fe-4c37-a851-9080ef799721",
      "name": "Nota adhesiva",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        -280
      ],
      "parameters": {
        "width": 300,
        "height": 120,
        "content": "## Customize Confirmation Message \nDisplays thank-you message post-submission."
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "4c947ff2-3753-41a0-8ea7-ffa38bc159f2": {
      "main": [
        [
          {
            "node": "4ca9c2b4-840a-4aa6-9b01-0e8f34eb1165",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4f53c3ab-8ec5-437f-8a94-93584590be9a": {
      "main": [
        [
          {
            "node": "4ca9c2b4-840a-4aa6-9b01-0e8f34eb1165",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d4706df1-dce1-4005-8e82-e4cca57265f7": {
      "main": [
        [
          {
            "node": "2be2cb40-2170-4388-b447-8e282f6ab85c",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "4f53c3ab-8ec5-437f-8a94-93584590be9a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2be2cb40-2170-4388-b447-8e282f6ab85c": {
      "main": [
        [
          {
            "node": "4c947ff2-3753-41a0-8ea7-ffa38bc159f2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "02b20189-94ce-4608-9c8d-a29a9d97db32": {
      "main": [
        [
          {
            "node": "750c5cb0-16fd-463f-ad6f-8558fbf51360",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "750c5cb0-16fd-463f-ad6f-8558fbf51360": {
      "main": [
        [
          {
            "node": "d4706df1-dce1-4005-8e82-e4cca57265f7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Preguntas frecuentes

¿Cómo usar este flujo de trabajo?

Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.

¿En qué escenarios es adecuado este flujo de trabajo?

Intermedio - Marketing

¿Es de pago?

Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.

Información del flujo de trabajo
Nivel de dificultad
Intermedio
Número de nodos8
Categoría1
Tipos de nodos7
Descripción de la dificultad

Adecuado para usuarios con experiencia intermedia, flujos de trabajo de complejidad media con 6-15 nodos

Autor
Akhil Varma Gadiraju

Akhil Varma Gadiraju

@akhilv7

I'm a full stack developer passionate about building intelligent, scalable solutions that automate workflows and enhance productivity. I love working at the intersection of AI, APIs, and automation—using tools like n8n to streamline processes, integrate data, and unlock smarter decision-making. Whether it's crafting custom backend services or designing intuitive frontends, I’m always exploring ways to build more with less manual effort.

Enlaces externos
Ver en n8n.io

Compartir este flujo de trabajo

Categorías

Categorías: 34