Post a tweet via the Twitter node with a visual attached

Hello to all,

I would like to reopen a topic about the Twitter node that I can’t execute in my workflow.

In a parallel workflow I query a JSON database every hour and paste them into an Airtable.

As soon as an entry arrives on this Airtable, my other workflow containing the Twitter node runs to launch a series of actions including: generating a png visual via an HTTP request. The purpose of this workflow is to tweet the appearance of a new hashflag as soon as a new entry on Airtable appears.

I understood that I had to put a binary data in the input of the Twitter node (for the attached visuals). I make a GET request (screenshot attached) just after generating my visual to convert the data into binary data.

Right after my Twitter node runs with the previously generated “data” property. I realize that only when I manually run the node, it runs correctly. I always have to reconfigure the data property. Is it a bug or me who is not correctly configured the node?

I put you following this link: a recording of my screen so that you can understand the context. Also I leave you my workflow, but I doubt you can reproduce it without my logins…

Thanks for your help!

{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "text": "=🥳 A new hashflag has appeared:\n#{{$node[\"Airtable Trigger\"].json[\"fields\"][\"Hashtag à utiliser\"]}}\n\n⏳ This hashflag will be active until {{$node[\"Prettier date\"].json[\"prettierDate\"]}}.",
        "additionalFields": {
          "attachments": "data"
        }
      },
      "name": "Twitter",
      "type": "n8n-nodes-base.twitter",
      "typeVersion": 1,
      "position": [
        1040,
        300
      ],
      "credentials": {
        "twitterOAuth1Api": {
          "id": "3",
          "name": "Twitter OAuth account"
        }
      }
    },
    {
      "parameters": {
        "authentication": "basicAuth",
        "requestMethod": "POST",
        "url": "https://hcti.io/v1/image",
        "options": {},
        "bodyParametersUi": {
          "parameter": [
            {
              "name": "html",
              "value": "=<!DOCTYPE html>\n<html lang=\"fr\">\n  <head>\n    <meta charset=\"utf-8\">\n  </head>\n  <body style=\"width: 1200px; height: 675px; margin: 0px; display: flex; flex-direction: column; align-items: center; position: relative;\">\n    <div style=\"display: flex; justify-content: center;\">\n      <div style=\"display: flex; align-items: center; position: absolute; top: 0; bottom: 0;\">\n        <div style=\"font-size: 64px; color: #1D9BF0; margin-right: 15px; font-family: Helvetica; font-weight: 700;\">#{{$json[\"fields\"][\"Hashtag à utiliser\"]}}</div>\n        <div style=\"height: 72px; width: 72px;\"><img width=\"100%\" src=\"{{$json[\"fields\"][\"URL du hashflag\"]}}\"></div>\n      </div>\n      <div style=\"font-family: Helvetica; font-weight: 400; font-size: 18px; color: #AAB8C2; position: absolute; top: 394px;\">@WorldHashflags</div>\n    </div>\n    <div style=\"width: 40px; height: 32.51px; display: flex; align-items: center; justify-content: center; position: absolute; bottom: 50px;\"><img width=\"100%\" height=\"100%\" src=\"https://upload.wikimedia.org/wikipedia/fr/c/c8/Twitter_Bird.svg\"></div>\n  </body>\n</html>"
            },
            {
              "name": "viewport_height",
              "value": "675"
            },
            {
              "name": "viewport_width",
              "value": "1200"
            },
            {
              "name": "device_scale",
              "value": "1"
            }
          ]
        },
        "headerParametersUi": {
          "parameter": []
        },
        "queryParametersUi": {
          "parameter": []
        }
      },
      "name": "Generate image",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        640,
        300
      ],
      "credentials": {
        "httpBasicAuth": {
          "id": "2",
          "name": "HTCI API"
        }
      }
    },
    {
      "parameters": {
        "url": "={{$json[\"url\"]}}",
        "responseFormat": "file",
        "options": {}
      },
      "name": "Import image",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        840,
        300
      ]
    },
    {
      "parameters": {
        "value": "={{$json[\"fields\"][\"Timestamp (en S) désactivation > Date de désactivation (US)\"]}}",
        "dataPropertyName": "prettierDate",
        "custom": true,
        "toFormat": "MM/DD/YYYY",
        "options": {}
      },
      "name": "Prettier date",
      "type": "n8n-nodes-base.dateTime",
      "typeVersion": 1,
      "position": [
        640,
        480
      ]
    },
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyHour",
              "minute": 27
            }
          ]
        },
        "baseId": "appRLiD7rqM043ZrJ",
        "tableId": "Liste",
        "triggerField": "Date d'import",
        "additionalFields": {}
      },
      "name": "Airtable Trigger",
      "type": "n8n-nodes-base.airtableTrigger",
      "typeVersion": 1,
      "position": [
        440,
        300
      ],
      "credentials": {
        "airtableApi": {
          "id": "1",
          "name": "Arthur"
        }
      }
    }
  ],
  "connections": {
    "Generate image": {
      "main": [
        [
          {
            "node": "Import image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Import image": {
      "main": [
        [
          {
            "node": "Twitter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prettier date": {
      "main": [
        [
          {
            "node": "Twitter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Airtable Trigger": {
      "main": [
        [
          {
            "node": "Generate image",
            "type": "main",
            "index": 0
          },
          {
            "node": "Prettier date",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Hi @arthurcorre, from looking at your workflow, the Twitter node would run for every item it receives. So it will run when your Import image node passes on an item (or multiple items) as well as when Prettier date passes on an item.

Assuming all of these nodes depend on each other, you would typically want to put your nodes in a sequential order, e.g. like so:

Example Workflow
{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "text": "=🥳 A new hashflag has appeared:\n#{{$node[\"Airtable Trigger\"].json[\"fields\"][\"Hashtag à utiliser\"]}}\n\n⏳ This hashflag will be active until {{$node[\"Prettier date\"].json[\"prettierDate\"]}}.",
        "additionalFields": {
          "attachments": "data"
        }
      },
      "name": "Twitter",
      "type": "n8n-nodes-base.twitter",
      "typeVersion": 1,
      "position": [
        1420,
        300
      ],
      "credentials": {
        "twitterOAuth1Api": {
          "id": "55",
          "name": "Twitter OAuth account"
        }
      }
    },
    {
      "parameters": {
        "authentication": "basicAuth",
        "requestMethod": "POST",
        "url": "https://hcti.io/v1/image",
        "options": {},
        "bodyParametersUi": {
          "parameter": [
            {
              "name": "html",
              "value": "=<!DOCTYPE html>\n<html lang=\"fr\">\n  <head>\n    <meta charset=\"utf-8\">\n  </head>\n  <body style=\"width: 1200px; height: 675px; margin: 0px; display: flex; flex-direction: column; align-items: center; position: relative;\">\n    <div style=\"display: flex; justify-content: center;\">\n      <div style=\"display: flex; align-items: center; position: absolute; top: 0; bottom: 0;\">\n        <div style=\"font-size: 64px; color: #1D9BF0; margin-right: 15px; font-family: Helvetica; font-weight: 700;\">#{{$json[\"fields\"][\"Hashtag à utiliser\"]}}</div>\n        <div style=\"height: 72px; width: 72px;\"><img width=\"100%\" src=\"{{$json[\"fields\"][\"URL du hashflag\"]}}\"></div>\n      </div>\n      <div style=\"font-family: Helvetica; font-weight: 400; font-size: 18px; color: #AAB8C2; position: absolute; top: 394px;\">@WorldHashflags</div>\n    </div>\n    <div style=\"width: 40px; height: 32.51px; display: flex; align-items: center; justify-content: center; position: absolute; bottom: 50px;\"><img width=\"100%\" height=\"100%\" src=\"https://upload.wikimedia.org/wikipedia/fr/c/c8/Twitter_Bird.svg\"></div>\n  </body>\n</html>"
            },
            {
              "name": "viewport_height",
              "value": "675"
            },
            {
              "name": "viewport_width",
              "value": "1200"
            },
            {
              "name": "device_scale",
              "value": "1"
            }
          ]
        },
        "headerParametersUi": {
          "parameter": []
        },
        "queryParametersUi": {
          "parameter": []
        }
      },
      "name": "Generate image",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        1020,
        300
      ],
      "credentials": {
        "httpBasicAuth": {
          "id": "2",
          "name": "HTCI API"
        }
      }
    },
    {
      "parameters": {
        "url": "={{$json[\"url\"]}}",
        "responseFormat": "file",
        "options": {}
      },
      "name": "Import image",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        1220,
        300
      ]
    },
    {
      "parameters": {
        "value": "={{$json[\"fields\"][\"Timestamp (en S) désactivation > Date de désactivation (US)\"]}}",
        "dataPropertyName": "prettierDate",
        "custom": true,
        "toFormat": "MM/DD/YYYY",
        "options": {}
      },
      "name": "Prettier date",
      "type": "n8n-nodes-base.dateTime",
      "typeVersion": 1,
      "position": [
        760,
        300
      ]
    },
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyHour",
              "minute": 27
            }
          ]
        },
        "baseId": "appRLiD7rqM043ZrJ",
        "tableId": "Liste",
        "triggerField": "Date d'import",
        "additionalFields": {}
      },
      "name": "Airtable Trigger",
      "type": "n8n-nodes-base.airtableTrigger",
      "typeVersion": 1,
      "position": [
        520,
        280
      ],
      "credentials": {
        "airtableApi": {
          "id": "1",
          "name": "Arthur"
        }
      }
    }
  ],
  "connections": {
    "Generate image": {
      "main": [
        [
          {
            "node": "Import image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Import image": {
      "main": [
        [
          {
            "node": "Twitter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prettier date": {
      "main": [
        [
          {
            "node": "Generate image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Airtable Trigger": {
      "main": [
        [
          {
            "node": "Prettier date",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

This would prevent either of the branches running on its own and causing to launch the Twitter node without binary data.

(As you have said, I would not be able to run your workflow since I do not know what data your Airtable Trigger or your Generate image nodes would return, so the above is an untested example that might need further refining.