ChatGPTSalesRevenue growthAI score · 81/100AI-assisted edit · no obvious prompt-injection riskn8n.io

n8n Automated LinkedIn Posting: OpenAI Content Generation with Google Sheets Approval and Email Workflow

Read from Google Sheets → OpenAI generates LinkedIn post → Gmail approval → conditional posting with status writeback

Some experienceStepsWorkflowPrompt
Who
Marketing teams or social media operators needing a content approval workflow
You get
Automatically pull pending content from a spreadsheet, generate a LinkedIn post with AI, get email approval, then publish and update sheet status
You need
n8n · Google Sheets · Gmail · LinkedIn

Constraints

Prerequisites: n8n instance; Google Sheet with columns Post Description, Instructions, Image, Status, Output, Post Link, row_number; credentials openAiApi, googleSheetsOAuth2Api, gmailOAuth2, linkedInOAuth2Api. Costs depend on OpenAI usage and n8n hosting.

What they did

Template author shindearyan built an n8n workflow that uses a scheduled trigger to read pending rows from Google Sheets, generates a LinkedIn post with OpenAI GPT, sends an approval email via Gmail with a form, and routes by response (Yes/No/Cancel) to publish, regenerate with feedback, or cancel—writing status and link back to the sheet.

How it went

The author reports the template enables a full create-approve-publish loop (author_report). No specific ROI or success rate data is provided.

Worth knowing

The LinkedIn person field in the template is hardcoded to a sample value and must be replaced; the row_number column is essential for precise sheet updates; image URL is optional; this site has not imported or run the workflow (reproduction=not_tested)—test with sample data manually before production use.

n8n workflow template

Structure checked · Not run-tested

Use “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.

Setup and test checklist

Credentials to connect

  • httpRequest node: connect HTTP/API keys per node headers or query params.
  • lmChatOpenAi node: connect OpenAI API credentials.
  • googleSheets node: connect Google Sheets OAuth2 credentials.
  • gmail node: connect Gmail OAuth2 credentials.
  • linkedIn node: connect LinkedIn OAuth2 credentials.

Configuration to replace

  • Source template is n8n public workflow #4005 (~18 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
  • Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.

Test input and expected output

  • Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
  • Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.

Template changes

  • Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
  • No business-logic edits; verify keys, quotas and privacy compliance before use.

Template retrieved: 2026-10-24

Steps

  1. Prepare the Google Sheet

    Create a new Google Sheet with columns: Post Description, Instructions, Image (URL, optional), Status, Output, Post Link, and row_number (for precise updates). Add a test row and set Status to Pending.

  2. Configure n8n credentials

    In n8n, create and assign credentials to the respective nodes: a) Google Sheets OAuth2; b) Gmail OAuth2; c) OpenAI API Key; d) LinkedIn OAuth2. Update the credentials IDs in the workflow JSON for each node.

  3. Set trigger and AI model

    In the Schedule Trigger node, set the interval (e.g., every morning at 9 AM). In the OpenAI Chat Model node, select a model (default gpt-4o-mini, or gpt-4o). Adjust the prompt in the Generate Post Content node if you want to change the writing style.

  4. Generate content and send approval email

    The workflow reads the first row where Status is Pending, uses the Generate Post Content node to call OpenAI for the post body, formats it via Data Formatting 1, and sends it to the approver via Gmail with a custom form: dropdown Yes/No/Cancel and a textarea for change requests.

    Execution prompt · Source text。Generate Post Content node messages.messageValues[0].message (System instruction)

    =You are an expert social media and LinkedIn content writer.
    
    You will be provided with:
    - A brief post description
    - Specific instructions from the user
    
    Please follow these steps:
    
    1. Initial Creation:
    If you are given a post description and instructions, write a polished, professionally worded LinkedIn post suitable for sharing. Strictly follow the instructions and ensure the message is engaging and succinct.
    If instructed, add a call to action or particular phrase (for example, "Connect with me" at the bottom).
    
    2. Formatting:
    Keep the tone positive, inclusive, and professional.
    Add relevant hashtags in small case.
    Limit the content to within 1300 characters.
    Place the call to action or special instruction at the end if requested.
    Output ONLY the final LinkedIn post content. Do NOT include any explanations, markdown, headings, or commentary—just the post text, ready to copy and share on LinkedIn.

    Execution prompt · Source text。Generate Post Content node text field (User prompt)

    =# LinkedIn Post Generation
    
    ## Post Description:
    {{ $json["Post Description"] }}
    
    ## Instructions:
    {{ $json["Instructions"] }}
    
    ---
    
    **Task:**
    Using the information above, generate the content for a LinkedIn post:
    - Use the Description and Instructions to create a new post.
    - Ensure your output is positive, professional, clear, and follows all provided instructions and feedback.
    - Do not include any explanations, just the final post content only, ready to publish on LinkedIn.
    - Limit to 1300 characters.
    - If the user demands to keep the same post as the Post Descrioption (in the instructions), then keep the same post content as provided in the Post Description, and output it.
  5. Handle approval and publish

    The Content Confirmation Logic (Switch node) routes by response: Yes → check for image URL; if present download and post with image (Post With Image), else text-only post (Post Without Image), then update Google Sheet to Completed with post link. No → pass change requests to Regenerate Post Content and resend for approval. Cancel → update Google Sheet to Cancelled.

    Execution prompt · Source text。Regenerate Post Content node text field

    =Apply the modification requests on the following LinkedIn post. Besides applying the reqested modifications, return the same linkedin post.
    
    LinkedIn post:
    ```
    {{ $('Data Formatting 1').item.json['Post Content'] }}
    ```
    
    Change requests:
    {{ $('Send Content Confirmation').item.json.data['Any Changes?'] }}
    
    **Task:**
    Using the information above, update the LinkedIn post content:
    - Do not include any explanations, just the final post content only (with all the change requests included in the post), ready to publish on LinkedIn.
    - Limit to 1300 characters.
    - If the user demands to keep the same post as the Post Description (in the instructions), then keep the same post content as provided in the Post Description, and output it.

    Execution prompt · Source text。Post With Image node text field

    ={{ $('Data Formatting 1').item.json['Post Content'] }}

Prompt you can copy

Setup guidance · Editorial suggestion。Hand to setup assistant; confirm inputs and permissions first

This block is the prompt. Ads are never placed here.

You are setting up an n8n workflow that auto-generates LinkedIn content from Google Sheets and publishes after email approval. Before starting, confirm: 1) The Google Sheet is created with required columns; 2) All four credentials (Google Sheets, Gmail, OpenAI, LinkedIn) are configured in n8n; 3) You have imported the workflow JSON or built the nodes manually. To change the writing style, edit the system message and user prompt in the Generate Post Content node.

Prepare test data in Google Sheet and OAuth/API credentials for all four platforms before building

Source

AI-generated LinkedIn posts with OpenAI, Google Sheets & email approval workflow · shindearyan · n8n.io · 2025-05-12

Comments & feedback

Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.

Loading…

    Related