This should be possible with the workflow you have described. Nodes will run once for each item they receive (with a few exceptions). So if your HTTP Request node returns 5 items, your Twitter node would run through each of these 5 items.
Looking at the example data you have provided you would need to transform the single result into individual n8n items first though. The Item Lists node can help you with that and split out the body.results field from your example data.
I am just read the documentation about Item lists and this is awesome. Split out the results set as list items and then twitter node can handle loop per item. Thank you!
Not via the node at the moment, I am afraid. However, you should be able to request elevated access by following the steps in the documentation (from step 14 onwards, assuming you have completed the previous ones):
Oh no , I am really sorry to hear that. If Twitter doesn’t grant you elevated access, it’s unfortunately not possible to use their API v1.1 endpoints used by the Twitter node.
That means until we have developed a node using Twitter’s v2 API you would have to use the HTTP Request node to talk to this Twitter API directly. A simple example workflow fetching Tweets would be available here. Other endpoints are listed in their docs, e.g. this one for posting Tweets.
The credentials I’ve used to authenticate with Twitter here are OAuth1 credentials with the following values:
Authorization URL: https://api.twitter.com/oauth/authorize
Access Token URL: https://api.twitter.com/oauth/access_token
Request Token URL: https://api.twitter.com/oauth/request_token
Consumer Key: The API Key shown in Twitter’s developer portal
Consumer Secret: The API Key Secret shown in Twitter’s developer portal
Signature Method: HMAC-SHA1
Let me know if you run into any trouble with this!
We did everything you said but this time we got error like;
{"status":"rejected","reason":{}}
NodeApiError: UNKNOWN ERROR - check the detailed error for more information
at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest/HttpRequest.node.js:882:27)
at async /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:447:47
Can you expand the error details (assuming you are seeing this error on the HTTP Request node)? This should reveal the full response from Twitter, like so:
Oh, so Twitter is not saying why they are rejecting your request? That’s very odd, I have not seen this before. Were you able to authenticate with Twitter previously, like so?
And could you share your HTTP Request node (seeing it seems to differ from the one in the example flow)? Simply select it on your canvas and press Ctrl+C, you should then be able to share the JSON here on the forum.
So your syntax seems to be correct. I also assume you’re not tweeting something Twitter might reject because of the content? Or in other words, does this also happen when trying to Tweet something like “hello world”?
Edit: Missed your last response, glad to hear it’s now working. Thanks so much for confirming @ued!