AIエージェントとGemini Chat APIを用いたLinkedInコンテンツの生成と投稿
上級
これはMultimodal AI分野の自動化ワークフローで、43個のノードを含みます。主にSet, Code, Gmail, Switch, LinkedInなどのノードを使用。 LinkedInコンテンツマシン:Gemini AIでEメール承認済み投稿を生成
前提条件
- •Googleアカウント + Gmail API認証情報
- •LinkedIn API認証情報
- •Google Sheets API認証情報
- •Google Gemini API Key
使用ノード (43)
カテゴリー
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
"id": "fDLwldlY6FV3fqJ2",
"meta": {
"instanceId": "cc015731fc495809b886aea182b15bbd667eb8429470d9c57541b0221b87b7e0",
"templateCredsSetupCompleted": true
},
"name": "Generate and post Content on Linkedin using AI Agent with Gemini Chat API",
"tags": [],
"nodes": [
{
"id": "d24cd7a9-52b3-4cde-8323-748f4a474e9f",
"name": "ワークフロー実行時",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-528,
-64
],
"parameters": {},
"typeVersion": 1
},
{
"id": "9d8dc5b0-603a-484a-b710-0484141017ec",
"name": "フィールド編集",
"type": "n8n-nodes-base.set",
"position": [
-304,
-64
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "baaa3fc3-f510-4af1-80ac-7b46619de020",
"name": "niche",
"type": "string",
"value": "startup founders in SaaS"
},
{
"id": "287ddc20-8032-4fc4-8913-ca52fbb58d29",
"name": "audience",
"type": "string",
"value": "growth-focused professionals"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "d7740a8c-0cf3-4bdc-84c9-4e5261ace324",
"name": "AIエージェント",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-80,
-64
],
"parameters": {
"text": "=You are a content strategist for LinkedIn.\nGiven a niche and audience, return 10 scroll-stopping post ideas as compact titles.\nOutput STRICT JSON:\n{\n \"ideas\": [\n {\"id\": 1, \"title\": \"...\"},\n ...\n {\"id\": 10, \"title\": \"...\"}\n ]\n}\nNiche: {{$json.niche}}\nAudience: {{$json.audience}}\n",
"options": {},
"promptType": "define"
},
"typeVersion": 2.2
},
{
"id": "80d63523-f0e3-4253-8d66-1de45233dfbe",
"name": "Google Gemini チャットモデル",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
-8,
160
],
"parameters": {
"options": {}
},
"credentials": {
"googlePalmApi": {
"id": "FfoNPWQzVaqAowCG",
"name": "Google Gemini(PaLM) Api account"
}
},
"typeVersion": 1
},
{
"id": "be593fa2-f68c-461d-994a-d5b7274c3a6a",
"name": "コード",
"type": "n8n-nodes-base.code",
"position": [
272,
-64
],
"parameters": {
"jsCode": "// 1) Get raw AI output from the previous node\nlet raw = $input.first().json.output || $json.data || \"\";\n\n// 2) Remove ```json fences if present\nraw = raw.replace(/```json/i, \"\").replace(/```/g, \"\").trim();\n\n// 3) Parse\nlet data;\ntry { data = JSON.parse(raw); }\ncatch (e) { throw new Error(\"Gemini did not return valid JSON:\\n\" + raw); }\n\nconst ideas = data.ideas || [];\n\n// 4) Create correlationId for this email thread/session\nconst correlationId = Date.now().toString() + '-' + Math.random().toString(36).slice(2,8);\n\n// 5) Build a nice email body\nlet body = `Here are 10 LinkedIn post ideas for “$('Edit Fields').first().json.audience” in “$('Edit Fields').first().json.niche”:\\n\\n`;\nideas.forEach(i => { body += `${i.id}. ${i.title}\\n`; });\nbody += `\\nReply with the number (1–10) to draft posts.\\n`;\n\n// 6) Return\nreturn [{\n correlationId,\n niche: $('Edit Fields').first().json.niche,\n audience: $('Edit Fields').first().json.audience,\n ideas,\n emailBody: body\n}];\n"
},
"typeVersion": 2
},
{
"id": "db32c86a-f3d3-4257-80cc-1d9c45f2d9df",
"name": "メッセージ送信",
"type": "n8n-nodes-base.gmail",
"position": [
720,
-64
],
"webhookId": "b2d6878b-8142-4621-bc13-36dc9ab30273",
"parameters": {
"sendTo": "yourmail@gmail.com ",
"message": "={{ $('Code').item.json.emailBody }}",
"options": {},
"subject": "=Your 10 LinkedIn Ideas [CID: {{ $json['correlationId '] }}]"
},
"credentials": {
"gmailOAuth2": {
"id": "UGcoN71TRNANpnvK",
"name": "Gmail account"
}
},
"typeVersion": 2.1
},
{
"id": "eeafee6c-8258-48d7-99f6-7cd80b1c95bf",
"name": "Gmail トリガー",
"type": "n8n-nodes-base.gmailTrigger",
"position": [
-528,
516
],
"parameters": {
"filters": {
"q": "to:me subject:\"[CID:\" is:inbox -category:promotions",
"sender": "yourmail@gmail.com ",
"includeSpamTrash": false
},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
}
},
"credentials": {
"gmailOAuth2": {
"id": "UGcoN71TRNANpnvK",
"name": "Gmail account"
}
},
"executeOnce": true,
"typeVersion": 1.3
},
{
"id": "812e4f0c-4d66-4fba-a7dc-882504ac3cd5",
"name": "コード1",
"type": "n8n-nodes-base.code",
"position": [
-304,
516
],
"parameters": {
"jsCode": "// Pull a plain text we can regex against (snippet is usually fine)\nconst text = ($input.first().json.snippet || '').trim();\n\n// First number in the reply\nconst numMatch = text.match(/\\d+/);\nconst selectedNumber = numMatch ? Number(numMatch[0]) : null;\n\n// Extract correlationId from Subject header\nlet subject = $input.first().json.Subject\nconst cidMatch = subject.match(/\\[CID:\\s*([^\\]]+)\\]/i);\nconst correlationId = cidMatch ? cidMatch[1] : null;\n\n// Who replied (optional, can be useful)\nlet from = '';\nif ($json.payload && $json.payload.headers) {\n const f = $json.payload.headers.find(h => h.name === 'From');\n from = f ? f.value : '';\n}\n\nif (!correlationId || !selectedNumber) {\n return [{ kind: 'unknown', reason: 'Missing CID or number', subject, text }];\n}\n\nreturn [{\n kind: 'numberReply',\n selectedNumber,\n correlationId,\n from\n}];\n"
},
"typeVersion": 2
},
{
"id": "fdcd4332-9481-48c9-98a0-00b9aa2f6d85",
"name": "コード2",
"type": "n8n-nodes-base.code",
"position": [
464,
384
],
"parameters": {
"jsCode": "// Parse ideas into array\nconst ideas = JSON.parse($input.first().json.ideas || \"[]\");\n\n// Convert selected number to string because ids are strings in your JSON\nconst selectedNumber = $('Code1').first().json.selectedNumber;\n\n// Find chosen idea\nconst chosen = ideas.find(i => i.id === selectedNumber);\n\nif (!chosen) {\n return [{\n error: true,\n msg: 'Idea not found',\n selectedNumber\n }];\n}\n\nreturn [{\n correlationId: $input.first().json['correlationId '],\n selectedTopic: chosen.title,\n niche: $input.first().json.niche,\n audience: $input.first().json.audience\n}];\n"
},
"typeVersion": 2
},
{
"id": "d809b62b-d5d9-4d87-8961-6be7ee9b2ae8",
"name": "AIエージェント1",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
704,
272
],
"parameters": {
"text": "=Create 3 LinkedIn post drafts about the topic below, tailored to the audience.\nLength: 120–200 words each, plain text. Avoid emojis unless natural.\nOutput strict JSON:\n{\n \"drafts\": [\n {\"id\": 1, \"text\": \"...\"},\n {\"id\": 2, \"text\": \"...\"},\n {\"id\": 3, \"text\": \"...\"}\n ]\n}\nTopic: {{$json.selectedTopic}}\nAudience: {{$json.audience}}\nNiche: {{$json.niche}}\nTone: insightful, practical, founder-friendly\n",
"options": {},
"promptType": "define"
},
"typeVersion": 2.2
},
{
"id": "2594ad03-fcb3-4ac8-b707-663cac6fb1b9",
"name": "Google Gemini チャットモデル1",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
768,
480
],
"parameters": {
"options": {}
},
"credentials": {
"googlePalmApi": {
"id": "FfoNPWQzVaqAowCG",
"name": "Google Gemini(PaLM) Api account"
}
},
"typeVersion": 1
},
{
"id": "aee41c79-9bce-4756-8603-15406165f11b",
"name": "シートに行を追加",
"type": "n8n-nodes-base.googleSheets",
"position": [
496,
-64
],
"parameters": {
"columns": {
"value": {
"ideas": "={{ $json.ideas }}",
"niche": "={{ $json.niche }}",
"stage": "=\"ideas\"",
"audience": "={{ $json.audience }}",
"correlationId ": "={{ $json.correlationId }}"
},
"schema": [
{
"id": "correlationId ",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "correlationId ",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "stage",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "stage",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "niche",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "niche",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "audience",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "audience",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "ideas",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "ideas",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "selectedTopic",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "selectedTopic",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "drafts",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "drafts",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "linkedinUrn",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "linkedinUrn",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"correlationId"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1O0ewqwJerpjv6h8Zq5jrA4NC-crh4CVcH1uT2PHuUQg",
"cachedResultUrl": "https://docs.google.com/spreadsheets/",
"cachedResultName": "Linkedin Post Idea"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "pToMN52MhgPTizJB",
"name": "Google Sheets account"
}
},
"typeVersion": 4.7
},
{
"id": "4a3db0b9-20c7-423e-b0e3-90d9249b63c9",
"name": "スイッチ",
"type": "n8n-nodes-base.switch",
"position": [
144,
500
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "Drafts Path",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "a7824eea-4a1c-4e56-abfb-7b01f2195d76",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.stage }}",
"rightValue": "\"ideas\""
}
]
},
"renameOutput": true
},
{
"outputKey": "Publish Path",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "9fcf7470-47bb-4ec6-bf94-dd154f4c5220",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.stage }}",
"rightValue": "\"drafts\""
}
]
},
"renameOutput": true
},
{
"outputKey": "END",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "c92dcf46-6b16-49d2-b4a8-9612c8615a42",
"operator": {
"type": "string",
"operation": "empty",
"singleValue": true
},
"leftValue": "={{ $json.stage }}",
"rightValue": ""
}
]
},
"renameOutput": true
}
]
},
"options": {}
},
"typeVersion": 3.2
},
{
"id": "6f8f75a6-2226-412f-9f2b-694f7cde6e10",
"name": "コード3",
"type": "n8n-nodes-base.code",
"position": [
1056,
272
],
"parameters": {
"jsCode": "let raw = $input.first().json.output || $json.data || \"\";\nraw = raw.replace(/```json/i, \"\").replace(/```/g, \"\").trim();\n\nlet data;\ntry { data = JSON.parse(raw); }\ncatch(e) { throw new Error(\"Gemini drafts JSON parse error:\\n\" + raw); }\n\nconst drafts = data.drafts || [];\nlet body = `Here are 3 drafts for:\\n“$('Code2').first().json.selectedTopic”\\n\\n`;\ndrafts.forEach(d => { body += `${d.id}. ${d.text}\\n\\n`; });\nbody += `Reply with 1, 2, or 3 to publish on LinkedIn.\\n`;\n\nreturn [{\n correlationId: $('Code2').first().json.correlationId,\n selectedTopic: $('Code2').first().json.selectedTopic,\n drafts,\n emailBody: body\n}];\n"
},
"typeVersion": 2
},
{
"id": "6570f3c1-e3a8-4a27-a600-e0d101bb0f03",
"name": "シートの行を更新",
"type": "n8n-nodes-base.googleSheets",
"position": [
1296,
272
],
"parameters": {
"columns": {
"value": {
"stage": "\"drafts\"",
"drafts": "={{ $json.drafts }}",
"selectedTopic": "={{ $json.selectedTopic }}",
"correlationId ": "={{ $json.correlationId }}"
},
"schema": [
{
"id": "correlationId ",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "correlationId ",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "stage",
"type": "string",
"display": true,
"required": false,
"displayName": "stage",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "niche",
"type": "string",
"display": true,
"required": false,
"displayName": "niche",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "audience",
"type": "string",
"display": true,
"required": false,
"displayName": "audience",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "ideas",
"type": "string",
"display": true,
"required": false,
"displayName": "ideas",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "selectedTopic",
"type": "string",
"display": true,
"required": false,
"displayName": "selectedTopic",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "drafts",
"type": "string",
"display": true,
"required": false,
"displayName": "drafts",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "linkedinUrn",
"type": "string",
"display": true,
"required": false,
"displayName": "linkedinUrn",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "number",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"correlationId "
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1O0ewqwJerpjv6h8Zq5jrA4NC-crh4CVcH1uT2PHuUQg",
"cachedResultUrl": "https://docs.google.com/spreadsheets/k",
"cachedResultName": "Linkedin Post Idea"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "pToMN52MhgPTizJB",
"name": "Google Sheets account"
}
},
"typeVersion": 4.7
},
{
"id": "eea1b34d-eb46-4ea6-b592-1143d11f7065",
"name": "メッセージ送信1",
"type": "n8n-nodes-base.gmail",
"position": [
1536,
272
],
"webhookId": "52a5c9a2-50c0-4bae-ae92-f779f993bf06",
"parameters": {
"sendTo": "yourmail@gmail.com",
"message": "={{ $('Code3').item.json.emailBody }}",
"options": {},
"subject": "=Drafts for \"{{$json.selectedTopic}}\" [CID: {{ $json['correlationId '] }}]"
},
"credentials": {
"gmailOAuth2": {
"id": "UGcoN71TRNANpnvK",
"name": "Gmail account"
}
},
"typeVersion": 2.1
},
{
"id": "af15a85f-d54b-49d1-9225-c1a6bc34a30c",
"name": "コード4",
"type": "n8n-nodes-base.code",
"position": [
464,
688
],
"parameters": {
"jsCode": "// Extract drafts from sheet row\nlet drafts = $input.first().json.drafts || [];\nif (typeof drafts === 'string') {\n try {\n drafts = JSON.parse(drafts);\n } catch (e) {\n return [{ error: true, msg: 'Failed to parse drafts JSON', raw: drafts }];\n }\n}\n\n// Get selected number from earlier node\nconst idx = $item(0).$node[\"Code1\"].json.selectedNumber;\nconst selected = drafts.find(d => Number(d.id) === Number(idx));\n\nif (!selected) {\n return [{\n error: true,\n msg: `Draft #${idx} not found`,\n availableDrafts: drafts.map(d => d.id)\n }];\n}\n\nreturn [{\n correlationId: $json.correlationId,\n selectedTopic: $json.selectedTopic,\n finalPost: selected.text\n}];\n"
},
"typeVersion": 2
},
{
"id": "d4da723f-bf55-4718-9e69-d928d1d871eb",
"name": "投稿作成",
"type": "n8n-nodes-base.linkedIn",
"position": [
752,
688
],
"parameters": {
"text": "={{ $json.finalPost }}",
"postAs": "organization",
"organization": "79935287",
"authentication": "communityManagement",
"additionalFields": {}
},
"credentials": {
"linkedInCommunityManagementOAuth2Api": {
"id": "TXRpzuZrkSg5k9FL",
"name": "LinkedIn Community Management account"
}
},
"typeVersion": 1
},
{
"id": "9f09d25f-4e52-4a32-b819-3801cd48b46a",
"name": "シートの行を更新1",
"type": "n8n-nodes-base.googleSheets",
"position": [
992,
688
],
"parameters": {
"columns": {
"value": {
"stage": "Posted",
"linkedinUrn": "={{ $json.urn }}",
"correlationId ": "={{ $('Get row(s) in sheet').item.json['correlationId '] }}"
},
"schema": [
{
"id": "correlationId ",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "correlationId ",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "stage",
"type": "string",
"display": true,
"required": false,
"displayName": "stage",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "niche",
"type": "string",
"display": true,
"required": false,
"displayName": "niche",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "audience",
"type": "string",
"display": true,
"required": false,
"displayName": "audience",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "ideas",
"type": "string",
"display": true,
"required": false,
"displayName": "ideas",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "selectedTopic",
"type": "string",
"display": true,
"required": false,
"displayName": "selectedTopic",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "drafts",
"type": "string",
"display": true,
"required": false,
"displayName": "drafts",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "linkedinUrn",
"type": "string",
"display": true,
"required": false,
"displayName": "linkedinUrn",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "number",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"correlationId "
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1O0ewqwJerpjv6h8Zq5jrA4NC-crh4CVcH1uT2PHuUQg",
"cachedResultUrl": "https://docs.google.com/spreadsheets/",
"cachedResultName": "Linkedin Post Idea"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "pToMN52MhgPTizJB",
"name": "Google Sheets account"
}
},
"typeVersion": 4.7
},
{
"id": "b7d82533-a238-4bb3-8ee5-a024344031dc",
"name": "メッセージ送信2",
"type": "n8n-nodes-base.gmail",
"position": [
1216,
688
],
"webhookId": "c4837158-b2b7-4230-be5a-6acc21cd8836",
"parameters": {
"sendTo": "yourmailcurrent@gmail.com",
"message": "=Published to LinkedIn ✅\n\nTopic:\n{{ $('Code4').item.json.selectedTopic }}\n\nPreview:\n{{($('Code4').item.json.finalPost).slice(0, 200) }}…\n",
"options": {},
"subject": "=Posted ✅ “{{ $('Code4').item.json.selectedTopic }}” [CID: {{ $json['correlationId '] }}]"
},
"credentials": {
"gmailOAuth2": {
"id": "UGcoN71TRNANpnvK",
"name": "Gmail account"
}
},
"typeVersion": 2.1
},
{
"id": "27456f83-4fab-47f3-b0da-967e0ceb578c",
"name": "付箋",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1440,
-288
],
"parameters": {
"width": 704,
"height": 1360,
"content": "Turn a simple email workflow into a **LinkedIn content machine**. Generate post ideas, draft full posts, and auto-publish to LinkedIn — all controlled by replying to emails. \n\n---\n\n## 📌 Purpose \nAutomate your LinkedIn posting pipeline using **AI + Email approvals**. \n- Generate **10 scroll-stopping post ideas** tailored to your niche & audience. \n- Approve your favorite by replying to the email with a number. \n- Receive **3 AI-written drafts** for the chosen idea. \n- Pick your favorite draft via email reply. \n- The selected post gets **auto-published to LinkedIn** ✅. \n- All steps are logged in **Google Sheets**. \n\n---\n\n## 🔗 Apps Used \n- **Google Gemini** → generates ideas & drafts \n- **Gmail** → email-based approval workflow \n- **Google Sheets** → tracks ideas, drafts, and published posts \n- **LinkedIn API** → posts directly to your company or personal account \n\n---\n\n## ✨ Highlights \n- 📬 Email-based approval → no dashboards, just reply with a number \n- 📝 10 AI-generated content ideas + 3 full drafts per topic \n- 🔄 End-to-end tracking in Google Sheets (`ideas → drafts → published`) \n- ⚡ Auto-posting directly to LinkedIn \n- ✅ Final confirmation email with preview \n\n---\n\n## 👤 Best For \n- Startup founders \n- Agencies managing multiple clients’ LinkedIn \n- Solopreneurs & creators who want consistent posting \n\n---\n\n## 🛠️ Workflow Overview \n\n```mermaid\nflowchart TD\n A[Manual Trigger] --> B[AI Agent - Generate 10 Ideas]\n B --> C[Code - Parse JSON + Correlation ID]\n C --> D[Google Sheets - Append Ideas]\n D --> E[Gmail - Send Ideas Email]\n E --> F[Gmail Trigger - Await Reply]\n F --> G[Code1 - Extract Reply Number]\n G --> H[Google Sheets - Fetch Row]\n H --> I{Switch Stage}\n I -->|Ideas| J[AI Agent - Generate 3 Drafts]\n J --> K[Code3 - Parse Drafts]\n K --> L[Google Sheets - Update Drafts]\n L --> M[Gmail - Send Drafts Email]\n I -->|Drafts| N[Code4 - Select Final Draft]\n N --> O[LinkedIn - Publish Post]\n O --> P[Google Sheets - Update Posted]\n P --> Q[Gmail - Send Confirmation]\n"
},
"typeVersion": 1
},
{
"id": "fd24d63f-ff08-4bbb-ad21-ef373f050b00",
"name": "付箋1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-616,
-160
],
"parameters": {
"color": 4,
"width": 272,
"height": 256,
"content": "### 1. Manual Trigger \nRuns workflow manually for testing or ad-hoc posting."
},
"typeVersion": 1
},
{
"id": "bf456d49-6752-4a42-a0e0-728b42c091fe",
"name": "付箋2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-368,
-160
],
"parameters": {
"content": "### 2. Edit Fields (Set Node) \nDefines **niche** & **audience** for content generation."
},
"typeVersion": 1
},
{
"id": "5fdf070e-5045-4178-ae6e-e97b5514711f",
"name": "付箋3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-112,
-256
],
"parameters": {
"color": 3,
"width": 288,
"height": 352,
"content": "### 3. AI Agent (LangChain Agent) \nGenerates **10 post ideas** in strict JSON format."
},
"typeVersion": 1
},
{
"id": "a99ee1f8-19df-4f85-8f5e-7029b76b893d",
"name": "付箋4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-352,
128
],
"parameters": {
"color": 3,
"width": 352,
"content": "### 4. Google Gemini Chat Model \nLLM backend for AI Agent. Requires Gemini API credentials."
},
"typeVersion": 1
},
{
"id": "f0dde27d-4d91-4ecb-808f-974cc27b93b5",
"name": "付箋5",
"type": "n8n-nodes-base.stickyNote",
"position": [
208,
-128
],
"parameters": {
"width": 224,
"height": 224,
"content": "### 5. Code (Parse AI Output) \nCleans JSON, generates correlationId, builds email body."
},
"typeVersion": 1
},
{
"id": "6e382e0e-864c-4804-8e52-fe61ee75b813",
"name": "付箋6",
"type": "n8n-nodes-base.stickyNote",
"position": [
424,
-192
],
"parameters": {
"color": 5,
"height": 288,
"content": "### 6. Append Row in Sheet (Google Sheets) \nLogs generated ideas, stage set to *ideas*."
},
"typeVersion": 1
},
{
"id": "f8163c49-3c9c-4587-8666-ec93ada62ce1",
"name": "付箋7",
"type": "n8n-nodes-base.stickyNote",
"position": [
672,
-240
],
"parameters": {
"color": 7,
"height": 336,
"content": "### 7. Send a Message (Gmail) \nEmails you the ideas. You reply with a number."
},
"typeVersion": 1
},
{
"id": "391c04c2-7832-4cd1-be7f-57b8d2783231",
"name": "付箋8",
"type": "n8n-nodes-base.stickyNote",
"position": [
-600,
324
],
"parameters": {
"color": 4,
"height": 352,
"content": "### 8. Gmail Trigger \nListens for replies with `[CID: ...]`."
},
"typeVersion": 1
},
{
"id": "ba7c562d-6bc2-47c9-a4d1-0e26d2f0c04b",
"name": "付箋9",
"type": "n8n-nodes-base.stickyNote",
"position": [
-376,
356
],
"parameters": {
"height": 320,
"content": "### 9. Code1 (Extract Reply) \nParses reply to extract chosen number & correlationId."
},
"typeVersion": 1
},
{
"id": "a86524e5-e4da-47ad-b2be-8f309d2860f3",
"name": "シートから行を取得",
"type": "n8n-nodes-base.googleSheets",
"position": [
-80,
516
],
"parameters": {
"options": {},
"filtersUI": {
"values": [
{
"lookupValue": "={{ $json.correlationId }}",
"lookupColumn": "correlationId "
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1O0ewqwJerpjv6h8Zq5jrA4NC-crh4CVcH1uT2PHuUQg/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1O0ewqwJerpjv6h8Zq5jrA4NC-crh4CVcH1uT2PHuUQg",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1O0ewqwJerpjv6h8Zq5jrA4NC-crh4CVcH1uT2PHuUQg/edit?usp=drivesdk",
"cachedResultName": "Linkedin Post Idea"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "pToMN52MhgPTizJB",
"name": "Google Sheets account"
}
},
"executeOnce": true,
"typeVersion": 4.7,
"alwaysOutputData": true
},
{
"id": "e22c031e-2559-4c29-af11-67fe606a259c",
"name": "付箋10",
"type": "n8n-nodes-base.stickyNote",
"position": [
-128,
356
],
"parameters": {
"color": 5,
"width": 192,
"height": 320,
"content": "### 10. Get Row(s) in Sheet \nFetches stored row by correlationId."
},
"typeVersion": 1
},
{
"id": "686e770c-ea46-4b41-aca6-a705fa093dbf",
"name": "付箋11",
"type": "n8n-nodes-base.stickyNote",
"position": [
80,
336
],
"parameters": {
"color": 6,
"height": 464,
"content": "### 11. Switch \nRoutes flow: **ideas → drafts → publish**."
},
"typeVersion": 1
},
{
"id": "62331774-9639-4eb2-a8bf-1fcf50971901",
"name": "付箋12",
"type": "n8n-nodes-base.stickyNote",
"position": [
368,
256
],
"parameters": {
"content": "### 12. Code2 (Match Selected Idea) \nFinds the chosen idea & extracts topic."
},
"typeVersion": 1
},
{
"id": "576bbe0f-f7fe-4de3-9fd7-fe19f7844e38",
"name": "付箋13",
"type": "n8n-nodes-base.stickyNote",
"position": [
656,
128
],
"parameters": {
"color": 3,
"width": 288,
"height": 320,
"content": "### 13. AI Agent1 (Draft Generator) \nGenerates **3 drafts** (120–200 words each)."
},
"typeVersion": 1
},
{
"id": "9d83589b-207f-40ec-b74a-16506a070b98",
"name": "付箋14",
"type": "n8n-nodes-base.stickyNote",
"position": [
864,
464
],
"parameters": {
"color": 3,
"width": 304,
"height": 112,
"content": "### 14. Google Gemini Chat Model1 \nBackend for AI Agent1."
},
"typeVersion": 1
},
{
"id": "39933d7c-28dc-4d6e-88a4-7142174ba3fe",
"name": "付箋15",
"type": "n8n-nodes-base.stickyNote",
"position": [
976,
144
],
"parameters": {
"height": 256,
"content": "### 15. Code3 (Parse Drafts) \nParses drafts JSON, builds email body."
},
"typeVersion": 1
},
{
"id": "796a69f9-2900-4f83-8d48-c254eeede8c3",
"name": "付箋16",
"type": "n8n-nodes-base.stickyNote",
"position": [
1232,
128
],
"parameters": {
"color": 5,
"height": 288,
"content": "### 16. Update Row in Sheet \nUpdates stage to *drafts*, logs drafts JSON."
},
"typeVersion": 1
},
{
"id": "6d2bb7da-ea48-46f7-a684-29fb4da0bad4",
"name": "付箋17",
"type": "n8n-nodes-base.stickyNote",
"position": [
1504,
96
],
"parameters": {
"color": 7,
"height": 320,
"content": "### 17. Send a Message1 (Gmail) \nEmails you the 3 drafts for approval."
},
"typeVersion": 1
},
{
"id": "72eb365d-0a75-4568-bcc9-5c9e837a150c",
"name": "付箋18",
"type": "n8n-nodes-base.stickyNote",
"position": [
384,
560
],
"parameters": {
"content": "### 18. Code4 (Match Selected Draft) \nExtracts final draft based on reply number."
},
"typeVersion": 1
},
{
"id": "2441751d-9a55-426d-995b-0c63313a41bc",
"name": "付箋19",
"type": "n8n-nodes-base.stickyNote",
"position": [
656,
624
],
"parameters": {
"color": 6,
"content": "### 19. Create a Post (LinkedIn) \nPublishes final post to LinkedIn."
},
"typeVersion": 1
},
{
"id": "13eedb37-8e92-4fad-994a-40948c2bccb5",
"name": "付箋20",
"type": "n8n-nodes-base.stickyNote",
"position": [
912,
608
],
"parameters": {
"color": 5,
"height": 256,
"content": "### 20. Update Row in Sheet1 \nUpdates sheet stage to *Posted* with LinkedIn URN."
},
"typeVersion": 1
},
{
"id": "fd76390c-8832-4ba6-a8c2-44e8d7913dd4",
"name": "付箋21",
"type": "n8n-nodes-base.stickyNote",
"position": [
1168,
592
],
"parameters": {
"color": 7,
"height": 256,
"content": "### 21. Send a Message2 (Gmail) \nSends final confirmation email with preview."
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"timezone": "Asia/Kolkata",
"callerPolicy": "workflowsFromSameOwner",
"errorWorkflow": "fDLwldlY6FV3fqJ2",
"executionOrder": "v1"
},
"versionId": "b50605e2-db09-447a-b131-1d982ed9c3ff",
"connections": {
"be593fa2-f68c-461d-994a-d5b7274c3a6a": {
"main": [
[
{
"node": "aee41c79-9bce-4756-8603-15406165f11b",
"type": "main",
"index": 0
}
]
]
},
"812e4f0c-4d66-4fba-a7dc-882504ac3cd5": {
"main": [
[
{
"node": "a86524e5-e4da-47ad-b2be-8f309d2860f3",
"type": "main",
"index": 0
}
]
]
},
"fdcd4332-9481-48c9-98a0-00b9aa2f6d85": {
"main": [
[
{
"node": "d809b62b-d5d9-4d87-8961-6be7ee9b2ae8",
"type": "main",
"index": 0
}
]
]
},
"6f8f75a6-2226-412f-9f2b-694f7cde6e10": {
"main": [
[
{
"node": "6570f3c1-e3a8-4a27-a600-e0d101bb0f03",
"type": "main",
"index": 0
}
]
]
},
"af15a85f-d54b-49d1-9225-c1a6bc34a30c": {
"main": [
[
{
"node": "d4da723f-bf55-4718-9e69-d928d1d871eb",
"type": "main",
"index": 0
}
]
]
},
"4a3db0b9-20c7-423e-b0e3-90d9249b63c9": {
"main": [
[
{
"node": "fdcd4332-9481-48c9-98a0-00b9aa2f6d85",
"type": "main",
"index": 0
}
],
[
{
"node": "af15a85f-d54b-49d1-9225-c1a6bc34a30c",
"type": "main",
"index": 0
}
],
[]
]
},
"d7740a8c-0cf3-4bdc-84c9-4e5261ace324": {
"main": [
[
{
"node": "be593fa2-f68c-461d-994a-d5b7274c3a6a",
"type": "main",
"index": 0
}
]
]
},
"d809b62b-d5d9-4d87-8961-6be7ee9b2ae8": {
"main": [
[
{
"node": "6f8f75a6-2226-412f-9f2b-694f7cde6e10",
"type": "main",
"index": 0
}
]
]
},
"9d8dc5b0-603a-484a-b710-0484141017ec": {
"main": [
[
{
"node": "d7740a8c-0cf3-4bdc-84c9-4e5261ace324",
"type": "main",
"index": 0
}
]
]
},
"d4da723f-bf55-4718-9e69-d928d1d871eb": {
"main": [
[
{
"node": "9f09d25f-4e52-4a32-b819-3801cd48b46a",
"type": "main",
"index": 0
}
]
]
},
"eeafee6c-8258-48d7-99f6-7cd80b1c95bf": {
"main": [
[
{
"node": "812e4f0c-4d66-4fba-a7dc-882504ac3cd5",
"type": "main",
"index": 0
}
]
]
},
"eea1b34d-eb46-4ea6-b592-1143d11f7065": {
"main": [
[]
]
},
"aee41c79-9bce-4756-8603-15406165f11b": {
"main": [
[
{
"node": "db32c86a-f3d3-4257-80cc-1d9c45f2d9df",
"type": "main",
"index": 0
}
]
]
},
"a86524e5-e4da-47ad-b2be-8f309d2860f3": {
"main": [
[
{
"node": "4a3db0b9-20c7-423e-b0e3-90d9249b63c9",
"type": "main",
"index": 0
}
]
]
},
"6570f3c1-e3a8-4a27-a600-e0d101bb0f03": {
"main": [
[
{
"node": "eea1b34d-eb46-4ea6-b592-1143d11f7065",
"type": "main",
"index": 0
}
]
]
},
"9f09d25f-4e52-4a32-b819-3801cd48b46a": {
"main": [
[
{
"node": "b7d82533-a238-4bb3-8ee5-a024344031dc",
"type": "main",
"index": 0
}
]
]
},
"80d63523-f0e3-4253-8d66-1de45233dfbe": {
"ai_languageModel": [
[
{
"node": "d7740a8c-0cf3-4bdc-84c9-4e5261ace324",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"2594ad03-fcb3-4ac8-b707-663cac6fb1b9": {
"ai_languageModel": [
[
{
"node": "d809b62b-d5d9-4d87-8961-6be7ee9b2ae8",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"d24cd7a9-52b3-4cde-8323-748f4a474e9f": {
"main": [
[
{
"node": "9d8dc5b0-603a-484a-b710-0484141017ec",
"type": "main",
"index": 0
}
]
]
}
}
}よくある質問
このワークフローの使い方は?
上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。
このワークフローはどんな場面に適していますか?
上級 - マルチモーダルAI
有料ですか?
このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。
関連ワークフロー
AI驱动のメール分诊与自動回复系统,統合OpenAIエージェントとGmail
AI驱动のメール分诊与自動回复系统,統合OpenAIエージェントとGmail
If
Set
Gmail
+
If
Set
Gmail
68 ノードAbdullahi Ahmed
コンテンツ作成
コンテンツ集約
Gemini AIを使ってウェブ記事からLinkedInとX/Twitterへのソーシャルメディア投稿を自動化する
If
Set
Xml
+
If
Set
Xml
34 ノードVadim
コンテンツ作成
LinkedInおよびXウイルスのなコンテンツ自動エンジン
AIを使ってLinkedInとXにウイルスのなコンテンツを自動生成して公開する
If
Set
Wait
+
If
Set
Wait
156 ノードDiptamoy Barman
コンテンツ作成
私のワークフロー5
ジョン
Set
Code
Html
+
Set
Code
Html
102 ノードHichul
コンテンツ作成
自動化学術論文メタデータおよび変数抽出(GeminiからGoogle Sheetsへ)
論文のメタデータおよび変数抽出の自動化:GeminiからGoogle Sheetsへ
Set
Code
Wait
+
Set
Code
Wait
39 ノードOwenLee
文書抽出
n8nノードの探索(可視化リファレンスライブラリ内)
n8nノードを可視化リファレンスライブラリで探索
If
Ftp
Set
+
If
Ftp
Set
113 ノードI versus AI
その他
ワークフロー情報
難易度
上級
ノード数43
カテゴリー1
ノードタイプ11
作成者
Parag Javale
@pollar-beerTech driven creative who turns ideas into impact. I blend storytelling, product strategy, and automation whether it’s hooky audio promos, smart LMS platforms, or AI driven workflows. I help businesses grab attention, streamline ops, and scale fast. Big on data, experiments, and building digital solutions that actually work.
外部リンク
n8n.ioで表示 →
このワークフローを共有