OpenAI-powered tweet generator

Generate engaging tweets effortlessly with this OpenAI-powered workflow, transforming simple prompts into ready-to-post content. This workflow connects a FunctionItem node to an HTTP Request node, sending your tweet ideas to OpenAI for sophisticated text generation, then updates an Airtable base with the newly crafted tweet. Businesses and content creators can leverage this to rapidly produce social media updates, brainstorm marketing copy, or maintain a consistent online presence without manual drafting, saving significant time and creative effort in content production. By automating the tweet generation process and centralizing content in Airtable, this solution streamlines social media management and ensures a steady flow of fresh, relevant posts.

5 nodesmanual trigger93 views0 copiesSocial Media
Airtable

Workflow JSON

{"nodes": [{"name": "On clicking 'execute'", "type": "n8n-nodes-base.manualTrigger", "position": [250, 300], "parameters": {}, "typeVersion": 1}, {"name": "FunctionItem", "type": "n8n-nodes-base.functionItem", "position": [450, 300], "parameters": {"functionCode": "// hashtag list\nconst Hashtags = [\n \"#techtwitter\",\n \"#n8n\"\n];\n\n// random output function\nconst randomHashtag = Hashtags[Math.floor(Math.random() * Hashtags.length)];\nitem.hashtag = randomHashtag;\nreturn item;"}, "typeVersion": 1}, {"name": "HTTP Request", "type": "n8n-nodes-base.httpRequest", "position": [650, 300], "parameters": {"url": "https://api.openai.com/v1/engines/text-davinci-001/completions", "options": {}, "requestMethod": "POST", "authentication": "headerAuth", "jsonParameters": true, "bodyParametersJson": "={\n \"prompt\": \"Generate a tweet, with under 100 characters, about and including the hashtag {{$node[\"FunctionItem\"].json[\"hashtag\"]}}:\",\n \"temperature\": 0.7,\n \"max_tokens\": 64,\n \"top_p\": 1,\n \"frequency_penalty\": 0,\n \"presence_penalty\": 0\n}"}, "credentials": {"httpHeaderAuth": ""}, "typeVersion": 1}, {"name": "Airtable", "type": "n8n-nodes-base.airtable", "position": [1050, 300], "parameters": {"table": "main", "options": {}, "operation": "append", "application": "appOaG8kEA8FAABOr"}, "credentials": {"airtableApi": ""}, "typeVersion": 1}, {"name": "Set", "type": "n8n-nodes-base.set", "position": [850, 300], "parameters": {"values": {"string": [{"name": "Hashtag", "value": "={{$node[\"FunctionItem\"].json[\"hashtag\"]}}"}, {"name": "Content", "value": "={{$node[\"HTTP Request\"].json[\"choices\"][0][\"text\"]}}"}]}, "options": {}, "keepOnlySet": true}, "typeVersion": 1}], "connections": {"Set": {"main": [[{"node": "Airtable", "type": "main", "index": 0}]]}, "FunctionItem": {"main": [[{"node": "HTTP Request", "type": "main", "index": 0}]]}, "HTTP Request": {"main": [[{"node": "Set", "type": "main", "index": 0}]]}, "On clicking 'execute'": {"main": [[{"node": "FunctionItem", "type": "main", "index": 0}]]}}}

How to Import This Workflow

  1. 1Copy the workflow JSON above using the Copy Workflow JSON button.
  2. 2Open your n8n instance and go to Workflows.
  3. 3Click Import from JSON and paste the copied workflow.

Don't have an n8n instance? Start your free trial at n8nautomation.cloud

Related Templates

Telegram AI multi-format chatbot

Automate a multi-format AI chatbot on Telegram, allowing users to interact via text or voice. This workflow connects Telegram for user input and replies with OpenAI for AI processing and voice-to-text conversion. It's ideal for customer support, content generation, or interactive learning platforms. This saves significant time and effort in managing diverse user interactions.

15 nodes

Twitter Virtual AI Influencer

Automate the creation and scheduling of tweets for a virtual AI influencer profile, ensuring a consistent and engaging online presence. This workflow connects OpenAI to generate tweet content based on your configured influencer persona, then uses the Twitter/X integration to post these tweets automatically. It’s ideal for marketers, content creators, or businesses looking to maintain an active social media presence without constant manual intervention, solving the challenge of consistent content generation and scheduling. By leveraging a scheduled trigger to post every six hours, this automation frees up significant time and resources, allowing you to focus on broader strategic initiatives while your AI influencer continues to engage with its audience around the clock.

12 nodes

Post New YouTube Videos to X

Automatically share your latest YouTube video content on X (formerly Twitter) with this powerful n8n workflow. This automation regularly checks your YouTube channel for new uploads, then leverages OpenAI's ChatGPT to craft engaging X posts, and finally publishes them directly to your X account. Content creators, businesses, and marketers can use this to maintain a consistent social media presence, ensuring their audience on X is immediately notified of new video releases without manual intervention. This workflow eliminates the need to constantly monitor your YouTube channel and manually compose social media updates, saving significant time and effort while boosting content visibility and audience engagement.

6 nodes

Ready to automate with n8n?

Get affordable managed n8n hosting with 24/7 support.