Generate Tweet Content with Hashtags using OpenAI
detail.loadingPreview
Automatically generate tweet content with a randomly selected hashtag, send it to OpenAI for generation, and store it in Airtable.
About This Workflow
This n8n workflow automates the creation of social media content. It starts with a manual trigger, selects a random hashtag from a predefined list, then uses the OpenAI API to generate a tweet based on that hashtag. Finally, the generated tweet content and the hashtag are stored in an Airtable base.
Key Features
- Manual Trigger: Initiates the workflow with a single click.
- Random Hashtag Selection: Dynamically chooses a hashtag from a list for varied content.
- OpenAI Text Generation: Leverages the power of OpenAI's
text-davinci-001engine to create tweet copy. - Airtable Integration: Stores the generated content and associated hashtag in a structured format within Airtable.
How To Use
- On clicking 'execute' (manualTrigger): This node starts the workflow when you manually trigger it.
- FunctionItem (functionItem): This node defines a list of hashtags (
#techtwitter,#n8n) and randomly selects one to be used in the subsequent steps. The selected hashtag is added to the item data asitem.hashtag. - HTTP Request (httpRequest): This node sends a POST request to the OpenAI API (
https://api.openai.com/v1/engines/text-davinci-001/completions). Thepromptparameter includes the dynamically selected hashtag from theFunctionItemnode. You will need to configure your OpenAI API key in the credentials. - Set (set): This node processes the output from the OpenAI API. It extracts the generated tweet text from the
choicesarray and assigns it to theContentfield. It also passes theHashtagfrom theFunctionItemnode. This prepares the data for Airtable. - Airtable (airtable): This node appends the data structured by the
Setnode to a specified Airtable base (appOaG8kEA8FAABOr, tablemain). Ensure your Airtable credentials are set up.
Apps Used
Workflow JSON
{
"id": "00125a43-e15a-46a4-a0fa-054d503a5e39",
"name": "Generate Tweet Content with Hashtags using OpenAI",
"nodes": 21,
"category": "Marketing",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 00125a43-e15a...
About the Author
N8N_Community_Pick
Curator
Hand-picked high quality workflows from the global community.
Statistics
Related Workflows
Discover more workflows you might like
Automated Multi-Platform Social Media Publisher
Streamline your social media content creation and publishing with this n8n workflow. Simply fill out a web form with your caption, media (image or video), and target platforms, and let n8n automate the posting process across multiple social networks.
WhatsApp AI Assistant: LLaMA 4 & Google Search for Real-Time Insights
Instantly deploy a smart AI assistant on WhatsApp, powered by Groq's lightning-fast LLaMA 4 model. This workflow enables real-time conversations, remembers context, and provides up-to-date answers by integrating live Google Search results.
AI-Powered On-Page SEO Audit & Report Automation
Instantly generate comprehensive on-page SEO technical and content audits for any website URL. This AI-powered workflow automates the entire process, from scraping the page to delivering a detailed report directly to your inbox, empowering you to optimize for better search rankings and user engagement.