LinkedInに画像付きで投稿
上級
これはSocial Media, Multimodal AI分野の自動化ワークフローで、17個のノードを含みます。主にIf, Code, Limit, GoogleDrive, HttpRequestなどのノードを使用。 Gemini AIでLinkedInコンテンツ(投稿と画像)をAIが24/7自動生成
前提条件
- •Google Drive API認証情報
- •ターゲットAPIの認証情報が必要な場合あり
- •Google Sheets API認証情報
- •Google Gemini API Key
使用ノード (17)
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
"id": "gzBmk756EHzLlf9X",
"meta": {
"instanceId": "aa8f1cf0c4d8087e25a2eea962da249799481d2fb992314793977a97a5e71d77"
},
"name": "Linkedin Post with Image",
"tags": [],
"nodes": [
{
"id": "b8d099c6-f87c-46e7-97fb-892b54e9edc7",
"name": "Google スプレッドシート Trigger",
"type": "n8n-nodes-base.googleSheetsTrigger",
"position": [
-704,
-400
],
"parameters": {
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 538465532,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1WhpYF60_oOtWxDlBAEQfgBiNpEgF5p_eefPrOR1hXLM/edit#gid=538465532",
"cachedResultName": "Posts"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1WhpYF60_oOtWxDlBAEQfgBiNpEgF5p_eefPrOR1hXLM",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1WhpYF60_oOtWxDlBAEQfgBiNpEgF5p_eefPrOR1hXLM/edit?usp=drivesdk",
"cachedResultName": "Linkedin Post"
}
},
"credentials": {
"googleSheetsTriggerOAuth2Api": {
"id": "7m0VyTZyXp0touOK",
"name": "Google Sheets Trigger account"
}
},
"typeVersion": 1
},
{
"id": "606cb9e6-b1c1-4315-b07b-9996c1547eeb",
"name": "If",
"type": "n8n-nodes-base.if",
"position": [
-512,
-400
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "bc74b0c2-aa46-4bcd-91f3-1eb6b0720167",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.Status }}",
"rightValue": "pending"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "11ac155f-8ae3-44bc-9105-5ef28ca33efa",
"name": "制限",
"type": "n8n-nodes-base.limit",
"position": [
-272,
-416
],
"parameters": {},
"typeVersion": 1
},
{
"id": "70e4bd3a-68a0-4edd-8547-57c09789e4f2",
"name": "AI エージェント",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-736,
-208
],
"parameters": {
"text": "=You are a LinkedIn post writer. You will be given a title and your task is to create an engaging LinkedIn post based on that title.\n\nYour post should:\n1. Begin with a compelling hook related to the title\n2. Include 3-4 paragraphs of informative content\n3. End with a question to encourage engagement\n4. Include 4-6 relevant hashtags\n5. Use appropiate emojis in between \n\nImportant formatting requirements:\n- Format all paragraphs with proper newline characters (\\n\\n) between them\n- Ensure the text is properly escaped for JSON\n- Do not use double quote (\"\") in response or any special character\n- Do not put asterisk\n- Keep the overall length appropriate for LinkedIn (under 3000 characters)\n\n\nNow, create a LinkedIn post based on the following title:\n{{ $json['LinkedIn Post Title'] }}\n\nRespond only with a JSON object in exactly this format:\n{\n \"title\": \"{{ $json['LinkedIn Post Title'] }}\",\n \"post\": \"<your LinkedIn post here>\"\n}",
"options": {},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.8
},
{
"id": "6de95faa-7591-4653-aec0-7909e34d8a46",
"name": "コード",
"type": "n8n-nodes-base.code",
"position": [
-384,
-208
],
"parameters": {
"jsCode": "const items = $input.all();\nconst updatedItems = items.map((item) => {\n if (\n item.json &&\n item.json.output &&\n typeof item.json.output.post === \"string\"\n ) {\n item.json.output.post = item.json.output.post.replace(/\\n/g, \"\\\\n\");\n }\n return item;\n});\nreturn updatedItems;"
},
"typeVersion": 2
},
{
"id": "0e95749d-da5f-4b66-807c-5816527e89cf",
"name": "HTTP リクエスト",
"type": "n8n-nodes-base.httpRequest",
"position": [
-736,
240
],
"parameters": {
"url": "https://api.linkedin.com/v2/userinfo",
"options": {},
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth"
},
"credentials": {
"httpHeaderAuth": {
"id": "gZliUVRX7RzQu1EP",
"name": "Linkedin Header"
}
},
"typeVersion": 4.2
},
{
"id": "79a6ea34-41f8-4de9-a073-6664d22b266d",
"name": "Register Image Upload",
"type": "n8n-nodes-base.httpRequest",
"position": [
-592,
240
],
"parameters": {
"url": "https://api.linkedin.com/v2/assets?action=registerUpload",
"method": "POST",
"options": {},
"jsonBody": "={\n \"registerUploadRequest\": {\n \"recipes\": [\n \"urn:li:digitalmediaRecipe:feedshare-image\"\n ],\n \"owner\": \"urn:li:person:{{ $('HTTP Request').item.json.sub }}\",\n \"serviceRelationships\": [\n {\n \"relationshipType\": \"OWNER\",\n \"identifier\": \"urn:li:userGeneratedContent\"\n }\n ]\n }\n}",
"sendBody": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth"
},
"credentials": {
"httpHeaderAuth": {
"id": "gZliUVRX7RzQu1EP",
"name": "Linkedin Header"
}
},
"typeVersion": 4.2
},
{
"id": "fcffdaff-a992-4018-abb4-c05343e61ca2",
"name": "Upload Image to LinkedIn",
"type": "n8n-nodes-base.httpRequest",
"position": [
-304,
240
],
"parameters": {
"url": "={{$node[\"Register Image Upload\"].json.value.uploadMechanism[\"com.linkedin.digitalmedia.uploading.MediaUploadHttpRequest\"].uploadUrl}}\n",
"method": "POST",
"options": {},
"sendBody": true,
"contentType": "binaryData",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "={{$binary.data.mimeType || 'image/png'}}"
}
]
},
"inputDataFieldName": "data"
},
"typeVersion": 4.2
},
{
"id": "6210d17b-8233-4c13-bdcf-eb3301610b06",
"name": "HTTP リクエスト2",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueRegularOutput",
"position": [
-160,
240
],
"parameters": {
"url": "https://api.linkedin.com/v2/ugcPosts",
"method": "POST",
"options": {},
"jsonBody": "={\n \"author\": \"urn:li:person:{{ $('HTTP Request').item.json.sub }}\",\n \"lifecycleState\": \"PUBLISHED\",\n \"specificContent\": {\n \"com.linkedin.ugc.ShareContent\": {\n \"shareCommentary\": {\n \"text\": \"{{ $('Code').item.json.output.post }}\"\n },\n \"shareMediaCategory\": \"IMAGE\",\n \"media\": [\n {\n \"status\": \"READY\",\n \"description\": {\n \"text\": \"{{ $('AI Agent').item.json.output.title }}\"\n },\n \"media\": \"{{ $('Register Image Upload').item.json.value.asset }}\",\n \"title\": {\n \"text\": \"{{ $('AI Agent').item.json.output.title }}\"\n }\n }\n ]\n }\n },\n \"visibility\": {\n \"com.linkedin.ugc.MemberNetworkVisibility\": \"PUBLIC\"\n }\n}",
"sendBody": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth"
},
"credentials": {
"httpHeaderAuth": {
"id": "gZliUVRX7RzQu1EP",
"name": "Linkedin Header"
}
},
"typeVersion": 4.2
},
{
"id": "24897dbd-72cf-4027-bbd4-afd62788435d",
"name": "構造化出力パーサー",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
-592,
0
],
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n \"type\": \"object\",\n \"properties\": {\n \"title\": { \"type\": \"string\" },\n \"post\": { \"type\": \"string\" }\n },\n \"required\": [\"title\",\"post\"],\n \"additionalProperties\": false\n}\n"
},
"typeVersion": 1.3
},
{
"id": "9b4c0624-c6fa-4af6-a087-cd191e088e47",
"name": "Update row in sheet",
"type": "n8n-nodes-base.googleSheets",
"position": [
-16,
240
],
"parameters": {
"columns": {
"value": {
"ID": "={{ $('Limit').item.json.ID }}",
"Status": "posted"
},
"schema": [
{
"id": "ID",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "ID",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Linkedin Post Title",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Linkedin Post Title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Status",
"type": "string",
"display": true,
"required": false,
"displayName": "Status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "string",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"ID"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 538465532,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1WhpYF60_oOtWxDlBAEgF5p_eefPrOR1hXLM/edit#gid=538465532",
"cachedResultName": "Posts"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1WhpYF60_oOtWxDlBAEQfgBiNpEgF5p_eefPrOR1hXLM",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1WhpYF60_oOtWxDlBAEQfgBiNpEgF5p_eefPrOR1hXLM/edit?usp=drivesdk",
"cachedResultName": "Linkedin Post"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "bAnK8T185A3Wr7Kj",
"name": "Google Sheets account"
}
},
"retryOnFail": false,
"typeVersion": 4.5,
"alwaysOutputData": false
},
{
"id": "b4c6f44c-b13d-4418-b768-8fdd27eef946",
"name": "GoogleGemini Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
-736,
0
],
"parameters": {
"options": {}
},
"credentials": {
"googlePalmApi": {
"id": "gfe4ixwgGvXB6ixs",
"name": "Google Gemini(PaLM) Api account"
}
},
"typeVersion": 1
},
{
"id": "e1ddbeca-41e4-4a65-b2dc-90656b431a28",
"name": "Generate Image with Gemini",
"type": "@n8n/n8n-nodes-langchain.googleGemini",
"position": [
-192,
-208
],
"parameters": {
"prompt": "=Create a high-quality, visually engaging image for a social media post based on the following text:\n\n\"{{ $json.output.post }}\"\n\nThe image should:\n• Depict a modern workspace with a person actively coding on a sleek MacBook laptop.\n• Surround the scene with Flutter development elements: Flutter logo-inspired shapes, Dart language motifs, mobile app UI mockups, performance graphs, and cross-platform design cues.\n• Show a bright, tech-focused environment with clean lighting and soft depth-of-field, suggesting focus and productivity.\n• Include subtle mobile development visuals such as smartphones, tablets, or floating app interface elements near the screen.\n• Use a professional, modern design aesthetic suitable for LinkedIn and Twitter audiences.\n• Apply a vibrant color palette with blues, whites, and gradients, inspired by Flutter’s branding, without using any copyrighted brand images.\n• Maintain a 16:9 aspect ratio, high resolution, and balanced composition.\n• **Do not include any text, captions, or lettering in the image under any circumstances.**\n",
"modelId": {
"__rl": true,
"mode": "list",
"value": "models/gemini-2.0-flash-exp-image-generation",
"cachedResultName": "models/gemini-2.0-flash-exp-image-generation"
},
"options": {},
"resource": "image"
},
"credentials": {
"googlePalmApi": {
"id": "gfe4ixwgGvXB6ixs",
"name": "Google Gemini(PaLM) Api account"
}
},
"typeVersion": 1
},
{
"id": "8a112d48-05e0-4923-bc99-69b97ab6321b",
"name": "Upload file",
"type": "n8n-nodes-base.googleDrive",
"position": [
-432,
32
],
"parameters": {
"name": "=linkedin_{{$now.format('YYYYMMDD_HHmmss')}}.{{$binary.data.fileExtension || 'png'}}\n",
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive",
"cachedResultUrl": "https://drive.google.com/drive/my-drive",
"cachedResultName": "My Drive"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "list",
"value": "19Q1PPe07QoE6hNXakiQ2nNU66MH85w5f",
"cachedResultUrl": "https://drive.google.com/drive/folders/19Q1PPe07QoE6hNXakiQ2nNU66MH85w5f",
"cachedResultName": "linkedin images"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "1Bnhm02w1dxE4FO6",
"name": "Farooq Google Drive account"
}
},
"typeVersion": 3
},
{
"id": "90d858e6-91d9-4f85-a0f0-2b489ee277bf",
"name": "Share file",
"type": "n8n-nodes-base.googleDrive",
"position": [
-288,
32
],
"parameters": {
"fileId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.id }}"
},
"options": {},
"operation": "share",
"permissionsUi": {
"permissionsValues": {
"role": "reader",
"type": "anyone"
}
}
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "1Bnhm02w1dxE4FO6",
"name": "Farooq Google Drive account"
}
},
"typeVersion": 3
},
{
"id": "fc8dcc39-9d98-4806-931a-9ba50c23133a",
"name": "Update row in sheet1",
"type": "n8n-nodes-base.googleSheets",
"position": [
-144,
32
],
"parameters": {
"columns": {
"value": {
"ID": "={{ $('If').item.json.ID }}",
"imageUrl": "={{$node[\"Upload file\"].json.webViewLink}}"
},
"schema": [
{
"id": "ID",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "ID",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "LinkedIn Post Title",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "LinkedIn Post Title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Status",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "imageUrl",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "imageUrl",
"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": [
"ID"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 538465532,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1WhpYF60_oOtWxDlBAEQfgBiNpEgF5p_eefPrOR1hXLM/edit#gid=538465532",
"cachedResultName": "Posts"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1WhpYF60_oOtWxDlBAEQfgBiNpEgF5p_eefPrOR1hXLM",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1WhpYF60_oOtWxDlBAEQfgBiNpEgF5p_eefPrOR1hXLM/edit?usp=drivesdk",
"cachedResultName": "Linkedin Post"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "bAnK8T185A3Wr7Kj",
"name": "Google Sheets account"
}
},
"typeVersion": 4.7
},
{
"id": "89176dcd-2000-44ce-8b89-b4abb30b7479",
"name": "Download file",
"type": "n8n-nodes-base.googleDrive",
"position": [
-448,
240
],
"parameters": {
"fileId": {
"__rl": true,
"mode": "url",
"value": "={{ $('Update row in sheet1').item.json.imageUrl }}"
},
"options": {},
"operation": "download"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "1Bnhm02w1dxE4FO6",
"name": "Farooq Google Drive account"
}
},
"typeVersion": 3
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "7357510d-3512-4579-b966-9179eac8d63e",
"connections": {
"606cb9e6-b1c1-4315-b07b-9996c1547eeb": {
"main": [
[
{
"node": "Limit",
"type": "main",
"index": 0
}
]
]
},
"Code": {
"main": [
[
{
"node": "e1ddbeca-41e4-4a65-b2dc-90656b431a28",
"type": "main",
"index": 0
}
]
]
},
"Limit": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
},
"90d858e6-91d9-4f85-a0f0-2b489ee277bf": {
"main": [
[
{
"node": "fc8dcc39-9d98-4806-931a-9ba50c23133a",
"type": "main",
"index": 0
}
]
]
},
"8a112d48-05e0-4923-bc99-69b97ab6321b": {
"main": [
[
{
"node": "90d858e6-91d9-4f85-a0f0-2b489ee277bf",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request": {
"main": [
[
{
"node": "79a6ea34-41f8-4de9-a073-6664d22b266d",
"type": "main",
"index": 0
}
]
]
},
"89176dcd-2000-44ce-8b89-b4abb30b7479": {
"main": [
[
{
"node": "fcffdaff-a992-4018-abb4-c05343e61ca2",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request2": {
"main": [
[
{
"node": "9b4c0624-c6fa-4af6-a087-cd191e088e47",
"type": "main",
"index": 0
}
]
]
},
"fc8dcc39-9d98-4806-931a-9ba50c23133a": {
"main": [
[
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
},
"Google Sheets Trigger": {
"main": [
[
{
"node": "606cb9e6-b1c1-4315-b07b-9996c1547eeb",
"type": "main",
"index": 0
}
]
]
},
"79a6ea34-41f8-4de9-a073-6664d22b266d": {
"main": [
[
{
"node": "89176dcd-2000-44ce-8b89-b4abb30b7479",
"type": "main",
"index": 0
}
]
]
},
"b4c6f44c-b13d-4418-b768-8fdd27eef946": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Structured Output Parser": {
"ai_outputParser": [
[
{
"node": "AI Agent",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"fcffdaff-a992-4018-abb4-c05343e61ca2": {
"main": [
[
{
"node": "HTTP Request2",
"type": "main",
"index": 0
}
]
]
},
"e1ddbeca-41e4-4a65-b2dc-90656b431a28": {
"main": [
[
{
"node": "8a112d48-05e0-4923-bc99-69b97ab6321b",
"type": "main",
"index": 0
}
]
]
}
}
}よくある質問
このワークフローの使い方は?
上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。
このワークフローはどんな場面に適していますか?
上級 - ソーシャルメディア, マルチモーダルAI
有料ですか?
このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。
関連ワークフロー
壁紙
Gemini 2.0、Google Sheets、Google Drive を使ってテキストプロンプトから AI 画像を生成
If
Code
Limit
+
If
Code
Limit
12 ノードMuhammad Farooq Iqbal
コンテンツ作成
Gemini AIを使用した感情物語作成:画像生成とVeo3 JSONプロンプト
Gemini AIを使って感情のある物語を作成:画像とVeo3 JSONプロンプトを生成する
If
Set
Code
+
If
Set
Code
35 ノードMuhammad Farooq Iqbal
コンテンツ作成
仕事の流れ9_旧バージョン
MagicHourとGeminiを使ってGoogleスプレッドシートから毎日YouTube動画を作成
If
Set
Code
+
If
Set
Code
31 ノードDivyansh Chauhan
コンテンツ作成
Claude、OpenAI、およびPerplexityを使用して品牌のなLinkedInコンテンツを自動生成・スケジュール
Claude、OpenAI、Perplexityを使ってブランド向けLinkedInコンテンツを自動生成してスケジュール
Code
Limit
Linked In
+
Code
Limit
Linked In
23 ノードAbdul Mir
ソーシャルメディア
Google GeminiとGoogleスプレッドシートを使用したShopify製品AIブログジェネレーター
GPT-4oとGoogleシートを使用したShopify製品AIブログジェネレーター
If
Code
Limit
+
If
Code
Limit
22 ノードMANISH KUMAR
その他
WordPressブログの自動化プロフェッショナル版(先端研究)v2.1マーケットプラグイン
GPT-4o、Perplexity AI、そして多言語対応を使ったSEO最適化ブログ作成の自動化
If
Set
Xml
+
If
Set
Xml
125 ノードDaniel Ng
コンテンツ作成