עברית 📰 Blog
← Back to Blog
AI Tools

How to Automatically Write and Schedule LinkedIn Posts With OpenAI and n8n

Or Livne
Social Media, Masterphub
October 27, 2026

Share this article

How to Automatically Write and Schedule LinkedIn Posts With OpenAI and n8n
Short answer: A five-node n8n workflow (Schedule Trigger, Edit Fields, OpenAI, LinkedIn, OpenAI) can write a LinkedIn post from your topic, publish it on a schedule, and summarize it. Test it with a safe draft first, and add a human approval step before trusting it with posts that carry your reputation.

Stop staring at a blank LinkedIn composer. Start building a repeatable content system.

Publishing consistently on LinkedIn takes more than a good idea. You need a content plan, a writing process, a publishing schedule, and a way to keep track of what went live.

With n8n and OpenAI, you can automate much of that work. A scheduled workflow can select a topic, generate a LinkedIn post, publish it to your account, and create a short summary for your records.

In this guide, you'll build the workflow from scratch, customize its writing style, connect your LinkedIn account, and test the whole process before enabling automatic publishing.

What You'll Build

The basic automation uses five connected nodes:

Schedule Trigger → Edit Fields → OpenAI → LinkedIn → OpenAI

  1. Schedule Trigger: Starts the workflow at a chosen time.
  2. Edit Fields: Stores the topic, target audience, angle, and writing preferences.
  3. OpenAI: Generates the LinkedIn post.
  4. LinkedIn: Publishes the generated text to the selected account.
  5. OpenAI: Summarizes the content that was processed.

The fifth node creates a summary, but it does not save it anywhere. You can add Google Sheets, Notion, a database, or another storage destination later.

What You Need Before Starting

  • An n8n Cloud account or a working self-hosted n8n installation.
  • An OpenAI credential in n8n, with access to a suitable model.
  • A LinkedIn account you are authorized to publish from.
  • A topic or content plan for your first test.

Official setup instructions: the n8n OpenAI documentation and the n8n LinkedIn documentation.

Important: LinkedIn authorization, and especially publishing to a company Page, can require extra configuration. An n8n account and an OpenAI API key do not grant permission to publish to every LinkedIn profile or Page.

Step 1: Create the Scheduled Workflow

Open n8n, create a new workflow, and add a Schedule Trigger node as the starting point.

Configure the schedule according to your publishing plan, for example every Tuesday and Thursday at 9:00 AM. Check the workflow timezone carefully. A schedule set to the wrong timezone can publish at an unexpected local time.

Keep the workflow inactive while you configure and test the remaining nodes.

A practical scheduling strategy

Start with two or three posts per week rather than publishing every day. This gives you time to review quality, spot repetitive content, and adjust your prompts before increasing frequency.

Remember that a scheduled trigger controls when the workflow starts. It does not guarantee that every step after it will succeed.

Step 2: Define the Content With Edit Fields

Add an Edit Fields (Set) node and connect it to the Schedule Trigger. Use Manual Mapping to create these fields:

  • topic: The subject of the post.
  • audience: The people you want to reach.
  • angle: The specific insight or argument.
  • tone: The desired writing style.
  • callToAction: The action you want readers to take.

Example values:

  • topic: How small businesses can use AI to save time
  • audience: Small business owners and independent professionals
  • angle: Start with one repetitive task instead of trying to automate the entire business
  • tone: Practical, conversational, credible, and direct
  • callToAction: Ask readers which repetitive task they would automate first

These values become the input for your OpenAI prompt, so you can change the topic or audience without rewriting the workflow. Later, you can replace the fixed fields with rows from a content calendar in Google Sheets, Airtable, Notion, or a database.

Step 3: Generate a LinkedIn Post With OpenAI

Add an OpenAI node and connect it to Edit Fields. Under the Text resource, the node offers Generate a Model Response (Responses API) and Generate a Chat Completion (Chat Completions API). Either works for this job. Connect your OpenAI credential and select a model available to your account.

Copy-ready prompt: LinkedIn post generator

Paste this prompt into the node's text input. The {{ $json.topic }} expressions pull values from the Edit Fields output when those fields are present in the incoming item.

You are an experienced LinkedIn content strategist and professional copywriter.

Create one original LinkedIn post using the following inputs.

TOPIC: {{ $json.topic }}

TARGET AUDIENCE: {{ $json.audience }}

CONTENT ANGLE: {{ $json.angle }}

TONE: {{ $json.tone }}

CALL TO ACTION: {{ $json.callToAction }}

REQUIREMENTS:

  1. Open with a compelling first line that gives the reader a reason to continue.
  2. Focus on one clear, useful idea.
  3. Use short paragraphs that are easy to read on mobile.
  4. Include practical insight rather than generic motivational advice.
  5. Write naturally, as a knowledgeable professional would.
  6. Avoid exaggerated promises, clickbait, and artificial enthusiasm.
  7. Do not invent personal experiences, customer stories, research, statistics, quotations, or business results.
  8. If a claim cannot be supported by the supplied information, omit it or explicitly identify what needs verification.
  9. Use the call to action provided above without making it feel forced.
  10. Include up to three relevant hashtags only when they add value.
  11. Aim for 120 to 220 words unless the topic requires a shorter post.
  12. Do not include a title, explanatory commentary, or labels such as "LinkedIn Post" in the final output.

Return only the final post, ready to publish.

Why this prompt works

It separates the subject from the angle, audience, tone, and call to action. A topic such as AI automation is broad. An angle such as starting with one repetitive task gives the post a specific point.

The rules also reduce the risk of made-up statistics and fictional first-person stories. They cannot remove every factual error, so claims that matter should still be checked before publishing.

Test the OpenAI node

Execute the node manually and check that:

  • The post addresses the intended audience.
  • The opening is specific and relevant.
  • The content follows the requested angle.
  • The response contains only the post text.
  • There are no invented experiences or unsupported claims.

If the result is generic, sharpen the angle before adding complexity. A precise input usually beats a longer list of vague instructions.

Step 4: Connect LinkedIn and Publish the Post

Add a LinkedIn node after the first OpenAI node. Its operation is Post > Create. Connect your LinkedIn credential and authorize the account you intend to use.

The Post As setting lets you choose Person or Organization:

  • Person: pick the profile in Person Name or ID.
  • Organization: enter the organization number in the Organization URN field, without the urn:li:company: prefix. Your account and app also need the right Page permissions.

If authorization fails, see the official LinkedIn API access documentation.

Map the generated post into LinkedIn

In the LinkedIn node's Text field, insert an expression that points to the generated text from the first OpenAI node. Do not guess the property name:

  1. Execute the first OpenAI node.
  2. Open its output panel.
  3. Find the property that holds the final text.
  4. Drag it into the LinkedIn Text field with the expression editor.
  5. Check that the expression resolves to the post itself, not an empty value or a whole response object.

The output structure depends on the operation you chose, so inspecting the live output is safer than copying an expression from another version.

Test publishing carefully

Executing the LinkedIn node is not a preview. It creates a live post. Use a draft you are comfortable publishing publicly, and confirm the right account is selected. Never use a confidential or unreviewed draft as your first test.

Step 5: Generate a Summary With the Second OpenAI Node

After the LinkedIn node, add a second OpenAI node. It turns the published post into a short, structured summary for reporting, archiving, or content analysis.

Copy-ready prompt: LinkedIn post summarizer

You are a content analyst.

Review the LinkedIn post supplied below.

POST: {{ $json.postText }}

Produce a concise summary containing:

  1. MAIN IDEA: One sentence describing the central message.
  2. KEY ENTITIES: Important people, organizations, products, concepts, or tools explicitly mentioned.
  3. TARGET AUDIENCE: The audience the post appears to address.
  4. CALL TO ACTION: The action requested from readers, if any.
  5. FOLLOW-UP IDEA: One relevant topic that could become a future post.

Rules:

  • Do not invent facts or entities.
  • Do not infer that a person or organization was mentioned unless it appears in the supplied text.
  • Write clearly and concisely.
  • If information is missing, state "Not specified."
  • Do not claim that the post generated engagement or results.

Return the summary in a readable format.

Configuration detail: {{ $json.postText }} is an example. It works only if the incoming item has a field named postText. After publishing, the item arriving from the LinkedIn node may contain LinkedIn's response instead of your original text.

A sturdy workflow stores the generated post in its own field (for example with an extra Edit Fields node) and passes it to both the LinkedIn step and the summarizer, or references the first OpenAI node directly.

What happens to the summary?

In this five-node version, the summary only appears in the execution output. To keep a record, add a storage node after it and save the topic, final post text, publication time, LinkedIn response ID if available, and summary. That gives you a simple archive for avoiding repetition and planning future posts.

Step 6: Run a Full End-to-End Test

Once all five nodes are connected, test in sequence:

  • The Schedule Trigger fires at the intended local time.
  • Edit Fields supplies all required inputs.
  • OpenAI generates a usable post.
  • The LinkedIn node receives the correct text and the right account.
  • The post appears on LinkedIn as expected.
  • The second OpenAI node receives the original post text.
  • The summary is readable and consistent with the post.

Check the execution data of every node, not only the final output. Fix any failing step before you activate the workflow.

What automatic publishing means

Once activated, scheduled runs publish without asking you. That is useful for predictable, low-risk content. It can also cause problems if the model writes a misleading claim, repeats an old post, or gets an incomplete input. Treat it as a controlled production process, not a replacement for editorial judgment.

Step 7: Add Human Approval Before Publishing

If your posts represent your business, your reputation, or clients, add an approval step before the LinkedIn node:

Schedule Trigger → Edit Fields → OpenAI Draft → Approval → LinkedIn → OpenAI Summary

The approval can run through a supported integration such as Telegram, Slack, or email. The reviewer should be able to approve, reject, or ask for an edit, and only an explicit approval should let the workflow continue.

LINKEDIN POST REVIEW

Topic: {{ $json.topic }}

Draft: {{ $json.postText }}

Review the draft for:

  • Factual accuracy
  • Relevance to the target audience
  • Brand voice
  • Unsupported claims
  • Repetition of previous content

Choose one action: APPROVE REJECT EDIT

Do not publish unless approval is explicitly received.

This is a message template, not a full approval system. The workflow still needs to capture the reply, confirm it came from an authorized reviewer, and route the run accordingly.

Step 8: Prevent Duplicate Posts and Handle Errors

If a request times out after LinkedIn already accepted the post, a blind retry can publish the same content twice. Use these safeguards:

  • Preserve the original draft even after the LinkedIn node returns its response.
  • Record each publication attempt with a unique ID, status, and timestamp.
  • Check for duplicates against recent posts before publishing.
  • Handle errors separately with an error workflow that notifies you when generation, authentication, publishing, or summarizing fails.
  • Avoid blind retries. After a timeout, first check whether the post went live.
  • Separate publishing from reporting. A failed summary does not mean the post failed.
  • Keep credentials secure. Use n8n credentials. Never paste API keys or tokens into prompts or ordinary fields.

Step 9: Make the Content More Original

A daily workflow can still sound repetitive if every post follows the same structure. Mix formats: practical tutorials, lessons learned, myth-busting, industry observations, questions, and short case studies based on verified information. You can also give the model a list of recent topics to avoid.

Copy-ready prompt: Weekly content plan

You are a LinkedIn editorial strategist.

Create a five-post content plan for the coming week.

Brand or professional focus: [INSERT BRAND OR EXPERTISE]

Target audience: [INSERT AUDIENCE]

Business objective: [INSERT OBJECTIVE]

Recent topics already published: [INSERT RECENT TOPICS]

Create five distinct post ideas.

For each idea, provide:

  1. Topic
  2. Target reader
  3. Specific angle
  4. Post format
  5. Suggested opening line
  6. Desired reader action

Requirements:

  • Each idea must serve a distinct purpose.
  • Avoid repeating the supplied recent topics.
  • Prefer practical, specific ideas over generic motivation.
  • Do not invent current events, statistics, or case studies.
  • Do not claim that an idea will guarantee engagement or leads.
  • Use a natural professional voice.

Return a numbered list of five ideas.

Run it once a week and feed the ideas into your content calendar. A separate workflow can then generate and publish each approved post on its date.

Step 10: Measure Performance and Improve

Useful fields for a content log:

  • Topic and content category
  • Final published text
  • Publication date and time
  • Post link or ID, when available
  • Impressions and engagement, if you have authorized access to them
  • Notes from your review

The LinkedIn node in n8n only creates posts. It does not return analytics, and access to metrics depends on your LinkedIn API permissions. Review your results from time to time and use the patterns you find to improve topics, openings, and prompts.

Common Problems and How to Fix Them

The OpenAI node returns an error. Check the credential, model availability, account access, and node settings.

The LinkedIn node cannot publish. Check the OAuth connection, permissions, target account, and the Person or Organization ID. For a company Page, confirm the organization permissions.

The LinkedIn post is empty. Inspect the first OpenAI node's output and fix the expression in the Text field.

The summary has no post text. The LinkedIn node may have replaced the item with its own response. Keep the draft in its own field or reference the first OpenAI node directly.

The workflow publishes at the wrong time. Check the Schedule Trigger settings and the workflow timezone.

Duplicate posts. Check the execution history and add a publication log and duplicate check.

The posts sound generic. Improve the angle, give the model source material, and rotate formats. Tone instructions alone will not make writing distinctive.

Final Thoughts

Start with the five-node workflow. Test it with a safe draft, confirm the live post, and make sure the summary receives the right text. Then add approval, logging, duplicate checks, and error handling before trusting it with important communication.

Let automation handle the repeatable steps while you stay responsible for the ideas, facts, and reputation behind every post.

Frequently Asked Questions

Can n8n automatically publish AI-generated LinkedIn posts?

Yes. A scheduled n8n workflow can generate text with OpenAI and pass it to the LinkedIn node, provided the credentials, account, and permissions are set up correctly.

Do I need coding skills?

Not necessarily. The workflow is built in n8n's visual editor. You will need to set up credentials, use simple expressions, and inspect node outputs.

Can I publish to a personal profile and a company Page?

The LinkedIn node supports posting as a Person or an Organization. Whether it works for a specific Page depends on your account's permissions.

Does the second OpenAI node save the summary?

No. It only produces the summary in the execution. Connect a storage node such as Google Sheets, Notion, or a database to keep it.

How much does it cost?

It depends on your n8n plan, the OpenAI model and usage, and any extra integrations. Check the current pricing of each service before you deploy.

Can this guarantee more engagement?

No. Automation helps you publish consistently, but results depend on content quality and audience fit.

More AI tools and ready prompts at masterphub.io

Share this article