{
  "id": "BwKpDrRwv6SfId8Y",
  "meta": {
    "builderVariant": "mcp",
    "aiBuilderAssisted": true
  },
  "name": "Generate and publish LinkedIn posts from AI ideas with Gmail approval",
  "tags": [],
  "nodes": [
    {
      "id": "d854d207-4fd1-4f8f-949f-e8fa0344b5f7",
      "name": "Start Content Cycle",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        0,
        208
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f9cfe268-d1d8-4d91-b72a-0b5099b7b4f1",
      "name": "Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        224,
        208
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "cfg-niche",
              "name": "niche",
              "type": "string",
              "value": "startup founders in SaaS"
            },
            {
              "id": "cfg-audience",
              "name": "audience",
              "type": "string",
              "value": "growth-focused professionals"
            },
            {
              "id": "cfg-num-ideas",
              "name": "num_ideas",
              "type": "number",
              "value": 10
            },
            {
              "id": "cfg-num-drafts",
              "name": "num_drafts",
              "type": "number",
              "value": 3
            },
            {
              "id": "cfg-openai-model",
              "name": "openai_model",
              "type": "string",
              "value": "gpt-5-mini"
            },
            {
              "id": "cfg-notif-email",
              "name": "notification_email",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Your email address to receive approval requests, e.g. you@company.com__>"
            },
            {
              "id": "cfg-draft-min",
              "name": "draft_min_words",
              "type": "number",
              "value": 120
            },
            {
              "id": "cfg-draft-max",
              "name": "draft_max_words",
              "type": "number",
              "value": 200
            },
            {
              "id": "cfg-linkedin-post-as",
              "name": "linkedin_post_as",
              "type": "string",
              "value": "organization"
            },
            {
              "id": "cfg-linkedin-org-urn",
              "name": "linkedin_organization_urn",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Your LinkedIn organization URN (only if linkedin_post_as = organization)__>"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "53c37895-100f-4c99-9faa-494a95044b12",
      "name": "Generate LinkedIn Post Ideas",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        496,
        208
      ],
      "parameters": {
        "text": "=Generate exactly {{ $json.num_ideas }} scroll-stopping LinkedIn post idea titles.\nNiche: {{ $json.niche }}\nAudience: {{ $json.audience }}",
        "options": {
          "systemMessage": "You are an expert LinkedIn content strategist. Given a niche and an audience, produce concise, scroll-stopping post title ideas. Always return exactly the number of ideas requested, each under 12 words, numbered starting at 1."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "dc45f981-d916-4f03-97e7-e89b08f37138",
      "name": "OpenAI Chat Model (Ideas)",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        496,
        528
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Configuration').item.json.openai_model }}"
        },
        "options": {},
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "5f13a448-a8b8-4f93-b6bb-fb4c43d6e242",
      "name": "Ideas Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        560,
        432
      ],
      "parameters": {
        "autoFix": true,
        "schemaType": "manual",
        "inputSchema": "{\"type\":\"object\",\"properties\":{\"ideas\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"integer\"},\"title\":{\"type\":\"string\"}},\"required\":[\"id\",\"title\"]}}},\"required\":[\"ideas\"]}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "e7491c9a-3331-45eb-968b-ae93bd23dfd3",
      "name": "Prepare Ideas Email & Log Data",
      "type": "n8n-nodes-base.set",
      "position": [
        800,
        208
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ie-cid",
              "name": "correlationId",
              "type": "string",
              "value": "={{ $execution.id }}"
            },
            {
              "id": "ie-niche",
              "name": "niche",
              "type": "string",
              "value": "={{ $(\"Configuration\").item.json.niche }}"
            },
            {
              "id": "ie-audience",
              "name": "audience",
              "type": "string",
              "value": "={{ $(\"Configuration\").item.json.audience }}"
            },
            {
              "id": "ie-ideas",
              "name": "ideas",
              "type": "array",
              "value": "={{ $json.output.ideas }}"
            },
            {
              "id": "ie-num-drafts",
              "name": "num_drafts",
              "type": "number",
              "value": "={{ $(\"Configuration\").item.json.num_drafts }}"
            },
            {
              "id": "ie-openai-model",
              "name": "openai_model",
              "type": "string",
              "value": "={{ $(\"Configuration\").item.json.openai_model }}"
            },
            {
              "id": "ie-draft-min",
              "name": "draft_min_words",
              "type": "number",
              "value": "={{ $(\"Configuration\").item.json.draft_min_words }}"
            },
            {
              "id": "ie-draft-max",
              "name": "draft_max_words",
              "type": "number",
              "value": "={{ $(\"Configuration\").item.json.draft_max_words }}"
            },
            {
              "id": "ie-post-as",
              "name": "linkedin_post_as",
              "type": "string",
              "value": "={{ $(\"Configuration\").item.json.linkedin_post_as }}"
            },
            {
              "id": "ie-org-urn",
              "name": "linkedin_organization_urn",
              "type": "string",
              "value": "={{ $(\"Configuration\").item.json.linkedin_organization_urn }}"
            },
            {
              "id": "ie-notif",
              "name": "notification_email",
              "type": "string",
              "value": "={{ $(\"Configuration\").item.json.notification_email }}"
            },
            {
              "id": "ie-body",
              "name": "emailBody",
              "type": "string",
              "value": "=Here are {{ $json.output.ideas.length }} LinkedIn post ideas for {{ $(\"Configuration\").item.json.audience }} in the {{ $(\"Configuration\").item.json.niche }} niche:\n\n{{ $json.output.ideas.map(i => i.id + \". \" + i.title).join(\"\\n\") }}\n\nReply to this email with just the number (1-{{ $json.output.ideas.length }}) to get 3 draft posts for that idea."
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "0be0000f-04c9-4d6b-b281-cfd910fd80bd",
      "name": "Log Idea Batch to Tracking Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1024,
        208
      ],
      "parameters": {
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultName": "LinkedIn Content Tracker"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "5587cc41-f60b-4ab1-91ea-f62971031e92",
      "name": "Email Ideas for Approval",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1248,
        208
      ],
      "parameters": {
        "sendTo": "={{ $(\"Prepare Ideas Email & Log Data\").item.json.notification_email }}",
        "message": "={{ $(\"Prepare Ideas Email & Log Data\").item.json.emailBody }}",
        "options": {},
        "subject": "=Your {{ $(\"Prepare Ideas Email & Log Data\").item.json.ideas.length }} LinkedIn Ideas [CID: {{ $(\"Prepare Ideas Email & Log Data\").item.json.correlationId }}]",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "827ff961-d4b8-4de0-9161-2b17515656d6",
      "name": "Gmail Trigger - Await Reply",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        0,
        1248
      ],
      "parameters": {
        "simple": false,
        "filters": {
          "q": "subject:\"[CID:\" is:inbox -category:promotions",
          "readStatus": "unread"
        },
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.4
    },
    {
      "id": "751da0a2-abae-404d-8c3a-d23c82fe061d",
      "name": "Extract Reply Number & Correlation ID",
      "type": "n8n-nodes-base.set",
      "position": [
        224,
        1248
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "er-cid",
              "name": "correlationId",
              "type": "string",
              "value": "={{ $json.subject.match(/\\[CID:\\s*([^\\]]+)\\]/i)[1] }}"
            },
            {
              "id": "er-num",
              "name": "selectedNumber",
              "type": "number",
              "value": "={{ Number(($json.text || \"\").match(/\\d+/)[0]) }}"
            },
            {
              "id": "er-from",
              "name": "replierEmail",
              "type": "string",
              "value": "={{ $json.from }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "f737e9a7-a7f5-466a-a724-052fab563cf7",
      "name": "Get Row by Correlation ID",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        448,
        1248
      ],
      "parameters": {
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultName": "LinkedIn Content Tracker"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "b7fc75d0-9975-45dc-ae01-149e89667912",
      "name": "Route by Approval Stage",
      "type": "n8n-nodes-base.switch",
      "position": [
        672,
        1232
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Ideas Stage",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": false,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.stage }}",
                    "rightValue": "ideas"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Drafts Stage",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": false,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.stage }}",
                    "rightValue": "drafts"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra",
          "renameFallbackOutput": "Unrecognized"
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "87ba4b68-794b-445e-93e7-73f88f207153",
      "name": "Prepare Draft Request",
      "type": "n8n-nodes-base.set",
      "position": [
        896,
        848
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "dr-cid",
              "name": "correlationId",
              "type": "string",
              "value": "={{ $json.correlationId }}"
            },
            {
              "id": "dr-niche",
              "name": "niche",
              "type": "string",
              "value": "={{ $json.niche }}"
            },
            {
              "id": "dr-audience",
              "name": "audience",
              "type": "string",
              "value": "={{ $json.audience }}"
            },
            {
              "id": "dr-topic",
              "name": "selectedTopic",
              "type": "string",
              "value": "={{ JSON.parse($json.ideas).find(i => i.id === $(\"Extract Reply Number & Correlation ID\").item.json.selectedNumber)?.title || \"\" }}"
            },
            {
              "id": "dr-num",
              "name": "num_drafts",
              "type": "number",
              "value": "={{ $json.num_drafts }}"
            },
            {
              "id": "dr-model",
              "name": "openai_model",
              "type": "string",
              "value": "={{ $json.openai_model }}"
            },
            {
              "id": "dr-min",
              "name": "draft_min_words",
              "type": "number",
              "value": "={{ $json.draft_min_words }}"
            },
            {
              "id": "dr-max",
              "name": "draft_max_words",
              "type": "number",
              "value": "={{ $json.draft_max_words }}"
            },
            {
              "id": "dr-notif",
              "name": "notification_email",
              "type": "string",
              "value": "={{ $json.notification_email }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "d4cccaac-5646-44f1-90b7-16b6789027bc",
      "name": "Generate LinkedIn Post Drafts",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1120,
        640
      ],
      "parameters": {
        "text": "=Write {{ $json.num_drafts }} LinkedIn post drafts about the topic below, tailored to the audience.\nLength: {{ $json.draft_min_words }}-{{ $json.draft_max_words }} words each, plain text, no emojis unless natural.\nTopic: {{ $json.selectedTopic }}\nAudience: {{ $json.audience }}\nNiche: {{ $json.niche }}\nTone: insightful, practical, professional, founder-friendly",
        "options": {
          "systemMessage": "You are a professional LinkedIn ghostwriter. Write authentic, non-salesy posts that spark discussion. Follow the requested word count closely and number each draft starting at 1."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "82caaa27-84fd-4b48-89c1-ced3f19e8356",
      "name": "OpenAI Chat Model (Drafts)",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1120,
        976
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Prepare Draft Request').item.json.openai_model }}"
        },
        "options": {},
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "d3185993-c5fc-425c-a509-7b34dacd90da",
      "name": "Drafts Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1184,
        864
      ],
      "parameters": {
        "autoFix": true,
        "schemaType": "manual",
        "inputSchema": "{\"type\":\"object\",\"properties\":{\"drafts\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"integer\"},\"text\":{\"type\":\"string\"}},\"required\":[\"id\",\"text\"]}}},\"required\":[\"drafts\"]}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "ad7c8d9a-e9bf-424c-a8e8-edcb886b40b6",
      "name": "Prepare Drafts Email & Log Data",
      "type": "n8n-nodes-base.set",
      "position": [
        1472,
        848
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "de-cid",
              "name": "correlationId",
              "type": "string",
              "value": "={{ $(\"Prepare Draft Request\").item.json.correlationId }}"
            },
            {
              "id": "de-topic",
              "name": "selectedTopic",
              "type": "string",
              "value": "={{ $(\"Prepare Draft Request\").item.json.selectedTopic }}"
            },
            {
              "id": "de-drafts",
              "name": "drafts",
              "type": "array",
              "value": "={{ $json.output.drafts }}"
            },
            {
              "id": "de-notif",
              "name": "notification_email",
              "type": "string",
              "value": "={{ $(\"Prepare Draft Request\").item.json.notification_email }}"
            },
            {
              "id": "de-body",
              "name": "emailBody",
              "type": "string",
              "value": "=Here are {{ $json.output.drafts.length }} drafts for: {{ $(\"Prepare Draft Request\").item.json.selectedTopic }}\n\n{{ $json.output.drafts.map(d => d.id + \". \" + d.text).join(\"\\n\\n\") }}\n\nReply with the number (1-{{ $json.output.drafts.length }}) to publish that draft on LinkedIn."
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "bc374796-e16c-4242-a579-2eba020671ea",
      "name": "Update Sheet with Drafts",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1696,
        848
      ],
      "parameters": {
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultName": "LinkedIn Content Tracker"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "ab79bb21-4ffb-4aee-b7ea-046f0acb5072",
      "name": "Email Drafts for Approval",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1936,
        848
      ],
      "parameters": {
        "sendTo": "={{ $(\"Prepare Drafts Email & Log Data\").item.json.notification_email }}",
        "message": "={{ $(\"Prepare Drafts Email & Log Data\").item.json.emailBody }}",
        "options": {},
        "subject": "=Drafts for {{ $(\"Prepare Drafts Email & Log Data\").item.json.selectedTopic }} [CID: {{ $(\"Prepare Drafts Email & Log Data\").item.json.correlationId }}]",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "b04e4201-b3c1-4f8e-b842-a529251fd370",
      "name": "Select Final Draft to Publish",
      "type": "n8n-nodes-base.set",
      "position": [
        896,
        1248
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "fd-cid",
              "name": "correlationId",
              "type": "string",
              "value": "={{ $json.correlationId }}"
            },
            {
              "id": "fd-topic",
              "name": "selectedTopic",
              "type": "string",
              "value": "={{ $json.selectedTopic }}"
            },
            {
              "id": "fd-post",
              "name": "finalPost",
              "type": "string",
              "value": "={{ JSON.parse($json.drafts).find(d => Number(d.id) === $(\"Extract Reply Number & Correlation ID\").item.json.selectedNumber)?.text || \"\" }}"
            },
            {
              "id": "fd-postas",
              "name": "linkedin_post_as",
              "type": "string",
              "value": "={{ $json.linkedin_post_as }}"
            },
            {
              "id": "fd-org",
              "name": "linkedin_organization_urn",
              "type": "string",
              "value": "={{ $json.linkedin_organization_urn }}"
            },
            {
              "id": "fd-notif",
              "name": "notification_email",
              "type": "string",
              "value": "={{ $json.notification_email }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "756aea63-16e9-437c-b065-bf88f506a85e",
      "name": "Publish Post to LinkedIn",
      "type": "n8n-nodes-base.linkedIn",
      "position": [
        1184,
        1248
      ],
      "parameters": {
        "text": "={{ $json.finalPost }}",
        "person": "<__PLACEHOLDER_VALUE__Your LinkedIn person URN (only if linkedin_post_as = person)__>",
        "postAs": "={{ $json.linkedin_post_as }}",
        "organization": "={{ $json.linkedin_organization_urn }}",
        "authentication": "communityManagement",
        "additionalFields": {
          "visibility": "PUBLIC"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1dbb7de4-4434-4532-a82e-22aaf07415a0",
      "name": "Update Sheet as Posted",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1472,
        1248
      ],
      "parameters": {
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultName": "LinkedIn Content Tracker"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "75c9b48b-0dce-484e-ae84-31b909c840a2",
      "name": "Email Publish Confirmation",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1696,
        1248
      ],
      "parameters": {
        "sendTo": "={{ $(\"Select Final Draft to Publish\").item.json.notification_email }}",
        "message": "=Your LinkedIn post has been published.\n\nTopic:\n{{ $(\"Select Final Draft to Publish\").item.json.selectedTopic }}\n\nPreview:\n{{ $(\"Select Final Draft to Publish\").item.json.finalPost.slice(0, 200) }}...",
        "options": {},
        "subject": "=Published to LinkedIn - {{ $(\"Select Final Draft to Publish\").item.json.selectedTopic }} [CID: {{ $(\"Select Final Draft to Publish\").item.json.correlationId }}]",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "7e0ab691-bc12-4d93-87c3-c61d3b8d8646",
      "name": "Ignore Unrecognized Reply",
      "type": "n8n-nodes-base.noOp",
      "position": [
        896,
        1440
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "69df7078-54c7-4379-a0a3-04857d05d5fd",
      "name": "Sticky Note b6ab7038",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -608,
        -208
      ],
      "parameters": {
        "color": 4,
        "width": 480,
        "height": 1844,
        "content": "# \ud83d\udce5  [Open full documentation on Notion](https://automatisation.notion.site/Course-Generate-and-publish-LinkedIn-posts-from-AI-ideas-with-Gmail-approval-39f3d6550fd981f1b644e1926f21e134)\n# Generate and publish LinkedIn posts from AI ideas with Gmail approval\n\nTurn a simple email inbox into a LinkedIn content machine. Generate post ideas with OpenAI, approve your favorite by replying with a number, get 3 AI-written drafts, pick one, and it auto-publishes to LinkedIn - all tracked in Google Sheets.\n\n## How it works\n- Click \"Start Content Cycle\" (or run on a schedule) to generate 10 post ideas tailored to your niche and audience, using an OpenAI-powered agent.\n- The ideas are logged to a Google Sheet and emailed to you.\n- Reply to that email with a number (1-10) to receive 3 full AI-written drafts for that idea.\n- Reply again with a number (1-3) and the chosen draft is published straight to LinkedIn, with every stage tracked in the sheet.\n\n## Setup\n1. Connect your OpenAI account, Gmail account, Google Sheets account and LinkedIn account credentials.\n2. Open the Configuration node and set your niche, audience, notification email and OpenAI model.\n3. Create a Google Sheet with columns: correlationId, stage, niche, audience, ideas, selectedTopic, drafts, linkedinUrn, num_drafts, openai_model, draft_min_words, draft_max_words, linkedin_post_as, linkedin_organization_urn, notification_email. Select it on all 4 Google Sheets nodes.\n4. Select your LinkedIn person or organization on the Publish Post to LinkedIn node.\n\n## Requirements\n- OpenAI account (GPT-5 family)\n- Gmail account (OAuth2)\n- Google Sheets account (OAuth2)\n- LinkedIn account (Community Management OAuth2, for posting as an organization or person)\n\n## Customization\n- Adjust niche, audience, number of ideas/drafts, word count range and OpenAI model in the single Configuration node.\n- Change the Gmail search query on the \"Gmail Trigger - Await Reply\" node if you use a dedicated approvals inbox.\n- Swap the LinkedIn node for a Blotato multi-network post if you want to publish to more than one platform.\n\nNeed help customizing?\nContact me for consulting and support : [Linkedin](https://www.linkedin.com/in/doctor-firass/)\n\n# MY NEW YOUTUBE CHANNEL\n\ud83d\udc49 [Subscribe to my new YouTube channel](https://www.youtube.com/@DrFiras_AI). Here I'll share videos and Shorts with practical tutorials and FREE templates for n8n.\n\n[![The AI Doctor](https://www.dr-firas.com/the-ai-doctor.png)](https://www.youtube.com/@DrFiras_AI)"
      },
      "typeVersion": 1
    },
    {
      "id": "04c73d59-a975-4dca-ab3c-fb2666d144a5",
      "name": "Sticky Note 18a4af09",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        -96
      ],
      "parameters": {
        "color": 7,
        "width": 300,
        "height": 216,
        "content": "### 1. Configuration\nSingle place to set niche, audience, counts, OpenAI model, notification email and LinkedIn posting mode."
      },
      "typeVersion": 1
    },
    {
      "id": "74aeceab-9bfc-4fb1-ae03-d4355eba96ea",
      "name": "Sticky Note f39c1b7b",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        304,
        -96
      ],
      "parameters": {
        "color": 3,
        "width": 300,
        "height": 216,
        "content": "### 2. Generate ideas with OpenAI\nAn AI Agent (GPT-5 family) returns structured JSON ideas via the Ideas Output Parser - no manual JSON parsing needed."
      },
      "typeVersion": 1
    },
    {
      "id": "4d61b0f6-ef1b-447b-8381-7eab8deed2e7",
      "name": "Sticky Note 9e29cbea",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        624,
        -96
      ],
      "parameters": {
        "color": 5,
        "width": 300,
        "height": 216,
        "content": "### 3. Log & email ideas\nLogs the batch (with all run settings) to Google Sheets, then emails you the numbered list for approval."
      },
      "typeVersion": 1
    },
    {
      "id": "ff5742dd-0a6c-47c0-ab73-bacd7942858e",
      "name": "Sticky Note e6ef2272",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        944,
        -96
      ],
      "parameters": {
        "color": 4,
        "width": 300,
        "height": 216,
        "content": "### 4. Capture your reply\nPolls Gmail for replies containing the correlation ID, extracts the chosen number straight from the plain-text body and subject - no header parsing needed."
      },
      "typeVersion": 1
    },
    {
      "id": "30490c75-5f8f-4c9e-9b85-12202b33cc26",
      "name": "Sticky Note e79b2118",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1280,
        -96
      ],
      "parameters": {
        "color": 6,
        "width": 300,
        "height": 216,
        "content": "### 5. Route by stage\nThe tracking sheet row remembers where this content cycle is at: still choosing an idea, or choosing a draft."
      },
      "typeVersion": 1
    },
    {
      "id": "bd971adf-71b8-437d-a349-fd9b374dc5e4",
      "name": "Sticky Note 4c5ad765",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1600,
        -96
      ],
      "parameters": {
        "color": 3,
        "width": 300,
        "height": 216,
        "content": "### 6. Generate & send drafts\nMatches your reply to the chosen idea, writes 3 drafts with OpenAI, logs them, and emails them for your final pick."
      },
      "typeVersion": 1
    },
    {
      "id": "7a948862-ef6e-498d-80e5-d156b3927e27",
      "name": "Sticky Note 5c400ab4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1936,
        -96
      ],
      "parameters": {
        "color": 5,
        "width": 300,
        "height": 216,
        "content": "### 7. Publish & confirm\nMatches your final reply to the chosen draft, publishes it to LinkedIn, marks the sheet row as Posted, and emails you a confirmation with a preview."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": true,
    "executionOrder": "v1"
  },
  "versionId": "e5000bd6-7085-4111-9615-6bc6c88bad9a",
  "nodeGroups": [],
  "connections": {
    "Configuration": {
      "main": [
        [
          {
            "node": "Generate LinkedIn Post Ideas",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ideas Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Generate LinkedIn Post Ideas",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Start Content Cycle": {
      "main": [
        [
          {
            "node": "Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Drafts Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Generate LinkedIn Post Drafts",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Draft Request": {
      "main": [
        [
          {
            "node": "Generate LinkedIn Post Drafts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Sheet as Posted": {
      "main": [
        [
          {
            "node": "Email Publish Confirmation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Approval Stage": {
      "main": [
        [
          {
            "node": "Prepare Draft Request",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Select Final Draft to Publish",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Ignore Unrecognized Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Publish Post to LinkedIn": {
      "main": [
        [
          {
            "node": "Update Sheet as Posted",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Sheet with Drafts": {
      "main": [
        [
          {
            "node": "Email Drafts for Approval",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Row by Correlation ID": {
      "main": [
        [
          {
            "node": "Route by Approval Stage",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model (Ideas)": {
      "ai_languageModel": [
        [
          {
            "node": "Generate LinkedIn Post Ideas",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Ideas Output Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model (Drafts)": {
      "ai_languageModel": [
        [
          {
            "node": "Generate LinkedIn Post Drafts",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Drafts Output Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Trigger - Await Reply": {
      "main": [
        [
          {
            "node": "Extract Reply Number & Correlation ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate LinkedIn Post Ideas": {
      "main": [
        [
          {
            "node": "Prepare Ideas Email & Log Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate LinkedIn Post Drafts": {
      "main": [
        [
          {
            "node": "Prepare Drafts Email & Log Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Select Final Draft to Publish": {
      "main": [
        [
          {
            "node": "Publish Post to LinkedIn",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Ideas Email & Log Data": {
      "main": [
        [
          {
            "node": "Log Idea Batch to Tracking Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Drafts Email & Log Data": {
      "main": [
        [
          {
            "node": "Update Sheet with Drafts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Idea Batch to Tracking Sheet": {
      "main": [
        [
          {
            "node": "Email Ideas for Approval",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Reply Number & Correlation ID": {
      "main": [
        [
          {
            "node": "Get Row by Correlation ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}