AI-Generated LinkedIn Posts with OpenAI, Google Sheets & Email Approval Workflow
Go to WorkflowDescription
How it works
This workflow automates the process of creating, approving, and optionally posting LinkedIn content from a Google Sheet. Here's a high-level overview:
Scheduled Trigger: Runs automatically based on your defined time interval (daily, weekly, etc.).
Fetch Data from Google Sheets: Pulls the first row from your sheet where Status is marked as Pending.
Generate LinkedIn Post Content: Uses OpenAI to create a professional LinkedIn post using the Post Description and Instructions from the sheet.
Format & Prepare Data: Formats the generated content along with the original instruction and post description for email.
Send for Approval: Sends an email to a predefined user (e.g., marketing team) with a custom form for approval, including a dropdown to accept/reject and an optional field for edits.
(Optional) Image Fetch: Downloads an image from a URL (if provided in the sheet) for future use in post visuals.
Set up steps
You’ll need the following before you start:
A Google Sheet with the following columns: Post Description, Instructions, Image (URL), Status
Access to an OpenAI API key
A connected Gmail account for sending approval emails
Your own Google Sheets and Gmail credentials added in n8n
Steps:
Google Sheet Preparation:
Create a new Google Sheet with the mentioned columns (Post Description, Instructions, Image, Status, Output, Post Link).
Add a row with test data and set Status to Pending.
Credentials:
In n8n, create OAuth2 credentials for:
a. Google Sheets
b. Gmail
c. OpenAI (API Key)
Assign these credentials to the respective nodes in the JSON.
OpenAI Model:
Choose a model like gpt-4o-mini (used here) or any other available in your plan.
Adjust the prompt in the "Generate Post Content" node if needed.
Email Configuration:
In the Gmail node, set the recipient email to your own or your team’s address.
Customize the email message template if necessary.
Schedule the Workflow:
Set the trigger interval (e.g., every morning at 9 AM).
Testing:
Run the workflow manually first to confirm everything works.
Check Gmail for the approval form, respond, and verify the results.