AIとGoogle Sheetsを使用したマルチプラットフォームでのソーシャルメディアコンテンツの生成とスケジュール

上級

これはMultimodal AI分野の自動化ワークフローで、16個のノードを含みます。主にIf, Set, Code, Cron, HttpRequestなどのノードを使用。 Google SheetsからGPT-4とBufferを使ってソーシャルメディアコンテンツを生成してスケジュールする

前提条件
  • ターゲットAPIの認証情報が必要な場合あり
  • Google Sheets API認証情報
  • OpenAI API Key
  • HTTP Webhookエンドポイント(n8nが自動生成)
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "name": "Generate and schedule social media content across platforms using AI and Google Sheets",
  "tags": [
    {
      "id": "social-media",
      "name": "Social Media",
      "createdAt": "2025-01-01T00:00:00.000Z",
      "updatedAt": "2025-01-01T00:00:00.000Z"
    },
    {
      "id": "ai-content",
      "name": "AI Content",
      "createdAt": "2025-01-01T00:00:00.000Z",
      "updatedAt": "2025-01-01T00:00:00.000Z"
    }
  ],
  "nodes": [
    {
      "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
      "name": "デイリーコンテンツ生成トリガー",
      "type": "n8n-nodes-base.cron",
      "position": [
        240,
        300
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 9 * * *"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b2c3d4e5-f6g7-8901-2345-678901bcdefg",
      "name": "ワークフロー説明",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -200,
        100
      ],
      "parameters": {
        "color": 4,
        "width": 432,
        "height": 464,
        "content": "## 📱 AI Social Media Content Automation\n\n**What this workflow does:**\nAutomatically generates and schedules social media content across multiple platforms using AI, based on your content calendar in Google Sheets.\n\n**How it works:**\n1. Runs daily at 9 AM to check your content calendar\n2. Reads scheduled topics from Google Sheets\n3. Uses OpenAI to generate platform-specific content\n4. Creates accompanying images with DALL-E\n5. Schedules posts across Twitter, LinkedIn, and Instagram\n6. Updates the spreadsheet with posting status\n7. Tracks engagement and performance metrics\n\n**Setup Requirements:**\n- Google Sheets with content calendar template\n- OpenAI API key (GPT-4 + DALL-E)\n- Buffer or Hootsuite account for scheduling\n- Social media platform API access\n- Google Drive for image storage\n\n**Customization Options:**\n- Adjust posting times and frequency\n- Customize AI prompts for your brand voice\n- Add more social platforms\n- Modify content types and formats\n- Include hashtag research and trends\n\n**Perfect for:**\n- Marketing teams managing multiple accounts\n- Content creators with consistent posting schedules\n- Small businesses automating social presence\n- Agencies managing client social media"
      },
      "typeVersion": 1
    },
    {
      "id": "c3d4e5f6-g7h8-9012-3456-789012cdefgh",
      "name": "設定変数",
      "type": "n8n-nodes-base.set",
      "position": [
        480,
        300
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "GOOGLE_SHEET_ID",
              "name": "GOOGLE_SHEET_ID",
              "type": "string",
              "value": "your-sheet-id-here"
            },
            {
              "id": "CONTENT_WORKSHEET",
              "name": "CONTENT_WORKSHEET",
              "type": "string",
              "value": "Content Calendar"
            },
            {
              "id": "BRAND_VOICE",
              "name": "BRAND_VOICE",
              "type": "string",
              "value": "professional, engaging, and informative"
            },
            {
              "id": "COMPANY_NAME",
              "name": "COMPANY_NAME",
              "type": "string",
              "value": "Your Company"
            },
            {
              "id": "TARGET_AUDIENCE",
              "name": "TARGET_AUDIENCE",
              "type": "string",
              "value": "marketing professionals and business owners"
            }
          ]
        }
      },
      "typeVersion": 3.2
    },
    {
      "id": "d4e5f6g7-h8i9-0123-4567-890123defghi",
      "name": "カレンダーノートを読み取る",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        120
      ],
      "parameters": {
        "width": 280,
        "height": 180,
        "content": "📊 **Step 1: Read Content Calendar**\n\nReads today's scheduled content from Google Sheets:\n- Topic/theme for the day\n- Target platforms\n- Content type (educational, promotional, etc.)\n- Special instructions or keywords\n- Posting times\n\nExpected sheet columns:\nDate | Topic | Platforms | Content Type | Keywords | Status"
      },
      "typeVersion": 1
    },
    {
      "id": "e5f6g7h8-i9j0-1234-5678-901234efghij",
      "name": "コンテンツカレンダーを読み取る",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        720,
        300
      ],
      "parameters": {
        "options": {
          "range": "A:G"
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "={{ $('Configuration Variables').first().json.CONTENT_WORKSHEET }}"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Configuration Variables').first().json.GOOGLE_SHEET_ID }}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "YOUR_GOOGLE_SHEETS_CREDENTIAL_ID",
          "name": "Google Sheets OAuth2"
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "f6g7h8i9-j0k1-2345-6789-012345fghijk",
      "name": "コンテンツノートをフィルタリング",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        120
      ],
      "parameters": {
        "width": 280,
        "height": 160,
        "content": "🎯 **Step 2: Filter Today's Content**\n\nFilters the calendar data to find:\n- Posts scheduled for today\n- Pending/unprocessed content\n- Valid topic entries\n- Platform-specific requirements\n\nSkips completed posts and invalid entries."
      },
      "typeVersion": 1
    },
    {
      "id": "g7h8i9j0-k1l2-3456-7890-123456ghijkl",
      "name": "本日のコンテンツをフィルタリング",
      "type": "n8n-nodes-base.code",
      "position": [
        960,
        300
      ],
      "parameters": {
        "jsCode": "// Filter content calendar for today's posts\nconst today = new Date().toISOString().split('T')[0];\nconst calendarData = $input.all();\n\n// Skip header row and filter for today's content\nconst todaysContent = calendarData.slice(1).filter(row => {\n  const rowData = row.json;\n  \n  if (!rowData.Date || !rowData.Topic) return false;\n  \n  let postDate;\n  if (rowData.Date.includes('/')) {\n    const [month, day, year] = rowData.Date.split('/');\n    postDate = `${year}-${month.padStart(2, '0')}-${day.padStart(2, '0')}`;\n  } else {\n    postDate = rowData.Date;\n  }\n  \n  return postDate === today && \n         rowData.Status !== 'Completed' && \n         rowData.Status !== 'Posted' &&\n         rowData.Topic.trim() !== '';\n});\n\nif (todaysContent.length === 0) {\n  return [{\n    json: {\n      message: \"No content scheduled for today\",\n      date: today,\n      hasContent: false\n    }\n  }];\n}\n\n// Process each content item\nreturn todaysContent.map((item, index) => {\n  const rowData = item.json;\n  \n  return {\n    json: {\n      rowIndex: index + 2,\n      topic: rowData.Topic || '',\n      platforms: rowData.Platforms || 'Twitter,LinkedIn',\n      contentType: rowData['Content Type'] || 'Educational',\n      keywords: rowData.Keywords || '',\n      date: today,\n      hasContent: true,\n      brandVoice: $('Configuration Variables').first().json.BRAND_VOICE,\n      companyName: $('Configuration Variables').first().json.COMPANY_NAME,\n      targetAudience: $('Configuration Variables').first().json.TARGET_AUDIENCE\n    }\n  };\n});"
      },
      "typeVersion": 2
    },
    {
      "id": "h8i9j0k1-l2m3-4567-8901-234567hijklm",
      "name": "コンテンツの存在確認",
      "type": "n8n-nodes-base.if",
      "position": [
        1200,
        300
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "has_content",
              "operator": {
                "type": "boolean",
                "operation": "equal"
              },
              "leftValue": "={{ $json.hasContent }}",
              "rightValue": true
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "i9j0k1l2-m3n4-5678-9012-345678ijklmn",
      "name": "AIコンテンツノート",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1360,
        120
      ],
      "parameters": {
        "width": 280,
        "height": 180,
        "content": "🤖 **Step 3: Generate AI Content**\n\nFor each platform, creates optimized content:\n- **Twitter**: 280 chars, trending hashtags, engaging hooks\n- **LinkedIn**: Professional tone, 1300 chars, industry insights\n- **Instagram**: Visual focus, story-driven, 2200 chars\n\nUses platform-specific best practices and your brand voice."
      },
      "typeVersion": 1
    },
    {
      "id": "j0k1l2m3-n4o5-6789-0123-456789jklmno",
      "name": "AIによるソーシャルコンテンツ生成",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1440,
        260
      ],
      "parameters": {
        "options": {
          "maxTokens": 1000,
          "temperature": 0.7
        },
        "resource": "chat",
        "chatInput": {
          "messages": {
            "values": [
              {
                "role": "system",
                "content": "You are an expert social media content creator. Generate platform-specific content that drives engagement.\n\nFor each platform:\n\n**TWITTER:**\n- Max 280 characters\n- Include 2-3 hashtags\n- Engaging hooks\n- Strategic emojis\n\n**LINKEDIN:**\n- Professional tone, 1000-1300 characters\n- Industry insights\n- 3-5 hashtags\n- Call-to-action\n\n**INSTAGRAM:**\n- Visual-first, up to 2200 characters\n- Storytelling format\n- 5-10 hashtags\n- Questions for engagement\n\nReturn JSON:\n{\n  \"twitter\": {\n    \"text\": \"content\",\n    \"hashtags\": [\"tag1\", \"tag2\"],\n    \"character_count\": number\n  },\n  \"linkedin\": {\n    \"text\": \"content\",\n    \"hashtags\": [\"tag1\", \"tag2\"],\n    \"character_count\": number\n  },\n  \"instagram\": {\n    \"text\": \"content\",\n    \"hashtags\": [\"tag1\", \"tag2\"],\n    \"character_count\": number\n  }\n}"
              },
              {
                "role": "user",
                "content": "Create social media content for:\n\n**Topic:** {{ $json.topic }}\n**Content Type:** {{ $json.contentType }}\n**Brand Voice:** {{ $json.brandVoice }}\n**Company:** {{ $json.companyName }}\n**Target Audience:** {{ $json.targetAudience }}\n**Keywords:** {{ $json.keywords }}\n**Platforms:** {{ $json.platforms }}"
              }
            ]
          }
        },
        "operation": "create"
      },
      "credentials": {
        "openAiApi": {
          "id": "YOUR_OPENAI_CREDENTIAL_ID",
          "name": "OpenAI API"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "k1l2m3n4-o5p6-7890-1234-567890klmnop",
      "name": "処理とスケジュールノート",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1600,
        120
      ],
      "parameters": {
        "width": 280,
        "height": 160,
        "content": "✅ **Step 4: Process & Schedule**\n\nProcesses AI response and schedules via Buffer:\n- Parses platform-specific content\n- Validates character limits\n- Schedules posts at optimal times\n- Updates spreadsheet status\n- Sends success notifications"
      },
      "typeVersion": 1
    },
    {
      "id": "l2m3n4o5-p6q7-8901-2345-678901lmnopq",
      "name": "生成コンテンツの処理",
      "type": "n8n-nodes-base.code",
      "position": [
        1680,
        260
      ],
      "parameters": {
        "jsCode": "// Process AI content and prepare for scheduling\nconst contentInput = $('Generate Social Content with AI').first();\nconst originalData = $('Filter Today\\'s Content').first();\n\nlet socialContent;\ntry {\n  const aiResponse = contentInput.json.choices[0].message.content;\n  socialContent = JSON.parse(aiResponse);\n} catch (error) {\n  // Fallback content\n  socialContent = {\n    twitter: {\n      text: `Sharing insights about ${originalData.json.topic}! 🚀`,\n      hashtags: [\"business\", \"insights\"],\n      character_count: 80\n    },\n    linkedin: {\n      text: `Today let's explore ${originalData.json.topic}. What are your thoughts?`,\n      hashtags: [\"business\", \"leadership\"],\n      character_count: 120\n    },\n    instagram: {\n      text: `✨ ${originalData.json.topic} ✨\\n\\nWhat's your experience? Share below! 👇`,\n      hashtags: [\"business\", \"motivation\"],\n      character_count: 100\n    }\n  };\n}\n\n// Process platforms\nconst requestedPlatforms = originalData.json.platforms.toLowerCase().split(',').map(p => p.trim());\nconst results = [];\n\nrequerestedPlatforms.forEach(platform => {\n  const platformKey = platform === 'twitter' ? 'twitter' : \n                     platform === 'linkedin' ? 'linkedin' : \n                     platform === 'instagram' ? 'instagram' : null;\n  \n  if (platformKey && socialContent[platformKey]) {\n    results.push({\n      json: {\n        platform: platform,\n        content: socialContent[platformKey].text,\n        hashtags: socialContent[platformKey].hashtags || [],\n        topic: originalData.json.topic,\n        row_index: originalData.json.rowIndex,\n        date: originalData.json.date,\n        scheduled_time: new Date().toISOString()\n      }\n    });\n  }\n});\n\nreturn results.length > 0 ? results : [{\n  json: {\n    error: \"No valid platforms found\",\n    topic: originalData.json.topic\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "m3n4o5p6-q7r8-9012-3456-789012mnopqr",
      "name": "Buffer経由で投稿をスケジュール",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1920,
        260
      ],
      "parameters": {
        "url": "https://api.bufferapp.com/1/updates/create.json",
        "method": "POST",
        "sendBody": true,
        "contentType": "form-urlencoded",
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "text",
              "value": "={{ $json.content }}"
            },
            {
              "name": "profile_ids[]",
              "value": "YOUR_PROFILE_ID_HERE"
            },
            {
              "name": "now",
              "value": "false"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/x-www-form-urlencoded"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "YOUR_BUFFER_CREDENTIAL_ID",
          "name": "Buffer API"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "n4o5p6q7-r8s9-0123-4567-890123nopqrs",
      "name": "シートのステータスを更新",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2160,
        260
      ],
      "parameters": {
        "fieldsUi": {
          "values": [
            {
              "column": "F",
              "fieldValue": "Scheduled"
            },
            {
              "column": "G",
              "fieldValue": "{{ $json.content.substring(0, 100) }}..."
            }
          ]
        },
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "={{ $('Configuration Variables').first().json.CONTENT_WORKSHEET }}"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Configuration Variables').first().json.GOOGLE_SHEET_ID }}"
        },
        "valueToMatchOn": "={{ $json.date }}",
        "columnToMatchOn": "A"
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "YOUR_GOOGLE_SHEETS_CREDENTIAL_ID",
          "name": "Google Sheets OAuth2"
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "o5p6q7r8-s9t0-1234-5678-901234opqrst",
      "name": "セットアップ手順",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        500
      ],
      "parameters": {
        "color": 6,
        "width": 400,
        "height": 320,
        "content": "⚙️ **CONFIGURATION REQUIRED**\n\n**Before using:**\n\n1. **Set up credentials:**\n   - OpenAI API key\n   - Google Sheets OAuth2\n   - Buffer API token\n\n2. **Create Google Sheets template:**\n   - Column A: Date (YYYY-MM-DD)\n   - Column B: Topic\n   - Column C: Platforms\n   - Column D: Content Type\n   - Column E: Keywords\n   - Column F: Status\n   - Column G: Generated Content\n\n3. **Update Configuration Variables:**\n   - GOOGLE_SHEET_ID\n   - BRAND_VOICE\n   - COMPANY_NAME\n   - TARGET_AUDIENCE\n\n4. **Configure Buffer:**\n   - Get profile IDs\n   - Update Schedule Post node\n\n5. **Test workflow:**\n   - Add test content\n   - Run manually\n   - Verify posts scheduled"
      },
      "typeVersion": 1
    },
    {
      "id": "p6q7r8s9-t0u1-2345-6789-012345pqrstu",
      "name": "コンテンツなし時の応答",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1200,
        420
      ],
      "parameters": {
        "options": {},
        "respondWith": "json",
        "responseBody": "{\n  \"status\": \"no_content\",\n  \"message\": \"No content scheduled for today\",\n  \"date\": \"{{ $json.date }}\"\n}"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "updatedAt": "2025-01-01T00:00:00.000Z",
  "versionId": "auto-generate",
  "staticData": {},
  "connections": {
    "e5f6g7h8-i9j0-1234-5678-901234efghij": {
      "main": [
        [
          {
            "node": "g7h8i9j0-k1l2-3456-7890-123456ghijkl",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "g7h8i9j0-k1l2-3456-7890-123456ghijkl": {
      "main": [
        [
          {
            "node": "h8i9j0k1-l2m3-4567-8901-234567hijklm",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "h8i9j0k1-l2m3-4567-8901-234567hijklm": {
      "main": [
        [
          {
            "node": "j0k1l2m3-n4o5-6789-0123-456789jklmno",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "p6q7r8s9-t0u1-2345-6789-012345pqrstu",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c3d4e5f6-g7h8-9012-3456-789012cdefgh": {
      "main": [
        [
          {
            "node": "e5f6g7h8-i9j0-1234-5678-901234efghij",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "m3n4o5p6-q7r8-9012-3456-789012mnopqr": {
      "main": [
        [
          {
            "node": "n4o5p6q7-r8s9-0123-4567-890123nopqrs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "l2m3n4o5-p6q7-8901-2345-678901lmnopq": {
      "main": [
        [
          {
            "node": "m3n4o5p6-q7r8-9012-3456-789012mnopqr",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "j0k1l2m3-n4o5-6789-0123-456789jklmno": {
      "main": [
        [
          {
            "node": "l2m3n4o5-p6q7-8901-2345-678901lmnopq",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "a1b2c3d4-e5f6-7890-1234-567890abcdef": {
      "main": [
        [
          {
            "node": "c3d4e5f6-g7h8-9012-3456-789012cdefgh",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "triggerCount": 1
}
よくある質問

このワークフローの使い方は?

上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。

このワークフローはどんな場面に適していますか?

上級 - マルチモーダルAI

有料ですか?

このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。

関連ワークフロー

GPT-4o Vision と Claude 3.5 + セールス分析で Shopify 製品説明文を生成
GPT-4o Vision と Claude 3.5 + 販売分析を使用して、Shopify製品の説明文を生成する
If
Set
Code
+
If
Set
Code
43 ノードKumar Shivam
コンテンツ作成
AI駆動型動画制作&Instagram/TikTok/YouTubeへの自動アップロード
クラウドドライブからAI駆動の動画作成およびInstagram、TikTok、YouTubeへのアップロード
If
Set
Code
+
If
Set
Code
53 ノードDevCode Journey
コンテンツ作成
AIを活用したリードジェネレーション(Apollo、LinkedInリサーチ、4段階のパーソナライズメール)
AIを活用したリードジェネレーション:Apollo、LinkedInリサーチ、4段階のパーソナライズメールを使用
If
Set
Code
+
If
Set
Code
30 ノードGain FLow AI
リード獲得
競合他社コンテンツギャップ分析ツール:構題マッピングの自動化
Gemini AI、Apify、Google Sheetsを使用して競合企業のコンテンツギャップを分析
If
Set
Code
+
If
Set
Code
30 ノードMychel Garzon
その他
OpenAIのgpt-image-1とAIキャプションを使ってInstagramカルーセルを作成し、公開する
Google SheetsからGPT-Image-1とAIキャプションを使用してInstagramカルーセルを自動生成
If
Set
Code
+
If
Set
Code
32 ノードJorge Martínez
マルチモーダルAI
Printifyの自動化 - タイトルと説明を更新 - AlexK1919
GPT-4o-miniによるPrintify向け自動SEO製品タイトル・説明生成
If
Set
Code
+
If
Set
Code
26 ノードAmit Mehta
コンテンツ作成
ワークフロー情報
難易度
上級
ノード数16
カテゴリー1
ノードタイプ9
難易度説明

上級者向け、16ノード以上の複雑なワークフロー

作成者
PhilanthropEAK Automation

PhilanthropEAK Automation

@philanthropeak

AI-powered automation specialist building practical, accessible workflows for businesses of all sizes. We design solutions that save time, cut errors, and boost customer experience—without complexity. Specialties include AI-driven customer support, social media scheduling, e-commerce automation, beginner-friendly workflows, and free templates. Every workflow is tested, documented, and ready to deliver real business value.

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34