This article contains affiliate links. If you buy through them, we may earn a commission at no extra cost to you.
n8n + OpenAI: Build Your AI Content Writer in 20 Minutes
Writing content at scale is one of the biggest bottlenecks for marketers, solopreneurs and small teams. You need blog posts, social captions, email intros and product descriptions — all consistently, all regularly. The good news: you can wire up a fully functional AI content writer using n8n — an open-source workflow automation tool with 400+ integrations that you can self-host for free or run on n8n Cloud — and OpenAI's API in under 20 minutes.
This guide walks you through every node, every prompt and every connection you need. No prior coding experience required.
What You Will Build
By the end of this tutorial you will have a workflow that:
- Accepts a topic or keyword as input (manually, via form or from a Google Sheet)
- Sends a structured prompt to OpenAI's Chat Completions API
- Returns a formatted blog post draft or social media copy
- Optionally saves the output to Google Docs, Notion or Airtable
What You Need Before You Start
- n8n instance: a free self-hosted install or an n8n Cloud account
- OpenAI API key: available from platform.openai.com
- 5 minutes of setup time for credentials — the rest is drag and drop
Step 1 — Create a New Workflow and Add a Trigger
Open your n8n editor and click New Workflow. For a quick test, use the Manual Trigger node. Once you are happy with the output, swap it for a Schedule Trigger (to run daily) or a Webhook node (to trigger from a form or external app).
If you want to pull topics from a spreadsheet, add a Google Sheets node right after the trigger and connect it to a sheet that lists your content topics in column A.
Step 2 — Add the OpenAI Node
Search for OpenAI in the node panel and drag it onto the canvas. Connect it to your trigger. Configure it as follows:
- Resource: Chat
- Operation: Create a Completion
- Model: gpt-4o (or gpt-3.5-turbo for lower cost)
- System Message: You are an expert content writer. Write in a clear, engaging and SEO-friendly style. Use short paragraphs and active voice.
- User Message: Write a 600-word blog post introduction about: {{ $json["topic"] }}. Include a compelling hook, three key points and a call to action.
The {{ $json["topic"] }} expression pulls the topic dynamically from the previous node — whether that is a manual input field or a row from Google Sheets.
Step 3 — Extract and Format the Output
The OpenAI node returns a JSON object. The actual text lives at choices[0].message.content. Add a Set node after OpenAI and create a new field called content with the value:
{{ $json.choices[0].message.content }}
This keeps your downstream nodes clean and readable.
Step 4 — Save or Publish the Content
Now connect the output to wherever your content needs to go. Common destinations:
- Google Docs: use the Google Docs node to create a new document and paste the content field into the body
- Notion: use the Notion node to create a new page in a database
- Airtable: append a new record with the topic and generated content
- Email: send the draft straight to your inbox with the Gmail or SMTP node
Bonus: Add a Placid Node for Social Images
If you also need a matching social media image for each post, add Placid after the content node. Placid can generate on-brand social images and PDFs from templates via the n8n integration, so your visual and written content are produced in the same workflow run.
Step 5 — Test, Iterate and Activate
Click Execute Workflow with a sample topic. Review the output in the OpenAI node panel. Tweak the system message and user prompt until the tone, length and structure match your brand voice. When you are satisfied, toggle the workflow to Active.
Prompt Engineering Tips That Make a Big Difference
- Be specific about format: ask for H2 headings, bullet points or a word count limit directly in the prompt
- Set the audience: add Write for a non-technical small business owner to the system message
- Chain prompts: run a second OpenAI node to generate a Twitter thread or LinkedIn post from the same blog draft
- Add a review step: route the output to a human-review form before it goes live, using n8n's Wait node and a simple approval webhook
How to Scale This Workflow
Once the basic flow works, extend it:
- Loop through 20 topics from a Google Sheet in one run using the Loop Over Items node
- Add a Filter node to skip topics already marked as done in your sheet
- Connect to WordPress via the HTTP Request node and the WordPress REST API to publish drafts automatically
- Schedule the workflow to run every Monday morning so your content pipeline never runs dry
Self-Hosting vs n8n Cloud
If you prefer to keep your data local or want zero monthly SaaS fees, self-hosting n8n on a VPS is straightforward. The Docker install takes about five minutes. If you would rather skip server management entirely, n8n Cloud handles updates and infrastructure for you. Either way, all the nodes and features shown in this tutorial are available on both options.
Final Thoughts
An AI content writer built on n8n and OpenAI is not a replacement for your editorial judgement — it is a first-draft engine that removes the blank-page problem and keeps your content calendar moving. The workflow you built today can be cloned, extended and connected to any tool in your existing stack.
If you want to automate your content production without writing code, you can get started via n8n — including open-source workflow automation with 400+ integrations and a free self-hosting option — to build your AI content writer and keep your pipeline running automatically.