{
  "name": "9 Social Media Auto Posting",
  "nodes": [
    {
      "id": "trigger",
      "name": "Cron Trigger",
      "type": "n8n-nodes-base.cron",
      "position": [
        200,
        300
      ],
      "parameters": {
        "schedule": {
          "hourly": [
            {
              "minute": 0
            }
          ]
        }
      }
    },
    {
      "id": "get_posts",
      "name": "Get Pending Posts",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        420,
        300
      ],
      "parameters": {
        "operation": "read",
        "sheetId": "YOUR_GOOGLE_SHEET_ID",
        "range": "Sheet1!A:Z"
      }
    },
    {
      "id": "filter_pending",
      "name": "Filter Pending",
      "type": "n8n-nodes-base.if",
      "position": [
        620,
        300
      ],
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{$json.status}}",
              "operation": "equals",
              "value2": "pending"
            }
          ]
        }
      }
    },
    {
      "id": "split",
      "name": "Split In Batches",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        820,
        300
      ],
      "parameters": {
        "batchSize": 1
      }
    },
    {
      "id": "reddit",
      "name": "Reddit Post",
      "type": "n8n-nodes-base.reddit",
      "position": [
        1050,
        80
      ],
      "parameters": {
        "resource": "post",
        "operation": "submit",
        "title": "={{$json.caption_reddit}}",
        "text": "={{$json.caption_reddit}}"
      }
    },
    {
      "id": "tumblr",
      "name": "Tumblr Post",
      "type": "n8n-nodes-base.tumblr",
      "position": [
        1050,
        200
      ],
      "parameters": {
        "operation": "create",
        "body": "={{$json.caption_tumblr}}"
      }
    },
    {
      "id": "instagram",
      "name": "Instagram (HTTP)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1050,
        320
      ],
      "parameters": {
        "method": "POST",
        "url": "https://graph.facebook.com/v18.0/INSTAGRAM_ID/media",
        "jsonParameters": true,
        "bodyParametersJson": "{ \"caption\": \"{{$json.caption_instagram}}\", \"image_url\": \"{{$json.image_url}}\" }",
        "authentication": "headerAuth"
      }
    },
    {
      "id": "threads",
      "name": "Threads (HTTP)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1050,
        440
      ],
      "parameters": {
        "method": "POST",
        "url": "https://graph.facebook.com/v18.0/THREADS_ID/posts",
        "jsonParameters": true,
        "bodyParametersJson": "{ \"text\": \"{{$json.caption_threads}}\" }",
        "authentication": "headerAuth"
      }
    },
    {
      "id": "tiktok",
      "name": "TikTok (HTTP)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1050,
        560
      ],
      "parameters": {
        "method": "POST",
        "url": "https://open.tiktokapis.com/v2/post/publish/",
        "jsonParameters": true,
        "bodyParametersJson": "{ \"caption\": \"{{$json.caption_tiktok}}\", \"video_url\": \"{{$json.video_url}}\" }",
        "authentication": "headerAuth"
      }
    },
    {
      "id": "x",
      "name": "X / Twitter (HTTP)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1050,
        680
      ],
      "parameters": {
        "method": "POST",
        "url": "https://api.twitter.com/2/tweets",
        "jsonParameters": true,
        "bodyParametersJson": "{ \"text\": \"{{$json.caption_x}}\" }",
        "authentication": "headerAuth"
      }
    },
    {
      "id": "pinterest",
      "name": "Pinterest (HTTP)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1050,
        800
      ],
      "parameters": {
        "method": "POST",
        "url": "https://api.pinterest.com/v5/pins",
        "jsonParameters": true,
        "bodyParametersJson": "{ \"title\": \"{{$json.caption_pinterest}}\", \"media_source\": {\"source_type\": \"image_url\",\"url\": \"{{$json.image_url}}\"} }",
        "authentication": "headerAuth"
      }
    },
    {
      "id": "bsky",
      "name": "Bluesky (HTTP)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1050,
        920
      ],
      "parameters": {
        "method": "POST",
        "url": "https://bsky.social/xrpc/com.atproto.repo.createRecord",
        "jsonParameters": true,
        "bodyParametersJson": "{ \"text\": \"{{$json.caption_bsky}}\" }",
        "authentication": "headerAuth"
      }
    },
    {
      "id": "mark_posted",
      "name": "Mark as Posted",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1300,
        300
      ],
      "parameters": {
        "operation": "update",
        "sheetId": "YOUR_GOOGLE_SHEET_ID",
        "updateKey": "id",
        "data": {
          "status": "posted",
          "error": ""
        }
      }
    },
    {
      "id": "mark_error",
      "name": "Mark as Error",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1300,
        480
      ],
      "parameters": {
        "operation": "update",
        "sheetId": "YOUR_GOOGLE_SHEET_ID",
        "updateKey": "id",
        "data": {
          "status": "error",
          "error": "Posting failed"
        }
      }
    }
  ],
  "connections": {
    "Cron Trigger": {
      "main": [
        [
          {
            "node": "Get Pending Posts",
            "type": "main"
          }
        ]
      ]
    },
    "Get Pending Posts": {
      "main": [
        [
          {
            "node": "Filter Pending",
            "type": "main"
          }
        ]
      ]
    },
    "Filter Pending": {
      "main": [
        [
          {
            "node": "Split In Batches",
            "type": "main"
          }
        ]
      ]
    },
    "Split In Batches": {
      "main": [
        [
          {
            "node": "Reddit Post",
            "type": "main"
          },
          {
            "node": "Tumblr Post",
            "type": "main"
          },
          {
            "node": "Instagram (HTTP)",
            "type": "main"
          },
          {
            "node": "Threads (HTTP)",
            "type": "main"
          },
          {
            "node": "TikTok (HTTP)",
            "type": "main"
          },
          {
            "node": "X / Twitter (HTTP)",
            "type": "main"
          },
          {
            "node": "Pinterest (HTTP)",
            "type": "main"
          },
          {
            "node": "Bluesky (HTTP)",
            "type": "main"
          }
        ]
      ]
    }
  }
}