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 trigger131 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

Business WhatsApp AI RAG Chatbot

Automate your business's WhatsApp customer service with an intelligent AI chatbot that leverages your Google Drive documents for accurate, context-aware responses. This powerful workflow connects incoming WhatsApp messages, triggered by a webhook, to an OpenAI-powered AI Agent, which then queries a Qdrant Vector Store populated with information from your Google Drive files. When a customer sends a message, the workflow first verifies the webhook, then routes the message to the AI Agent. The AI Agent uses an OpenAI Chat Model and a Window Buffer Memory to maintain conversation context, retrieving relevant data from your Google Drive documents via the Qdrant Vector Store, which is kept up-to-date by the Refresh collection and Create collection HTTP requests. Google Drive's Get folder and Download Files nodes extract your business's knowledge base, which is then processed by the Embeddings OpenAI, Default Data Loader, and Token Splitter nodes before being stored in Qdrant. This setup allows businesses to provide instant, personalized support 24/7, reducing response times, freeing up staff from repetitive inquiries, and ensuring consistent, accurate information delivery directly through WhatsApp. It's ideal for sales teams answering product questions, support departments resolving common issues, or marketing teams providing information about services, significantly enhancing customer satisfaction and operational efficiency.

24 nodes

Discord AI bot

Automate the intelligent routing of incoming user requests from a webhook to the appropriate Discord department with this powerful workflow. This n8n workflow leverages OpenAI's advanced natural language processing to analyze user input, then directs the request to either the User Success Dept, IT Dept, or Helpdesk Discord channel based on the identified category. Imagine a customer submitting a query through a web form; this workflow instantly understands their need and posts it in the relevant team's Discord channel, eliminating manual triage and ensuring faster response times. This solution is ideal for businesses and support teams looking to streamline their customer service operations, reduce response delays, and improve internal communication by automatically categorizing and distributing inquiries, saving significant time and effort in managing support tickets.

9 nodes

Telegram AI-bot

Build an intelligent Telegram AI-bot that responds to user messages, generates images, and provides dynamic greetings. This workflow connects Telegram as the primary communication channel with OpenAI for advanced AI capabilities, including text generation for chat responses and image creation. Users can interact with the bot to ask questions, receive personalized greetings, or request images, making it ideal for customer support, community engagement, or creative content generation. By automating AI-powered interactions directly within Telegram, this solution significantly reduces manual effort in responding to common queries, generating visual content, and maintaining an active, engaging presence, ultimately saving time and resources for businesses and individuals alike.

16 nodes

Ready to automate with n8n?

Get affordable managed n8n hosting with 24/7 support.