{
  "name": "Auto-publish Facebook posts from Google Sheets with Slack & email alerts",
  "nodes": [
    {
      "id": "f0c752c3-2396-4c36-8300-e124323d4410",
      "name": "Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2000,
        -928
      ],
      "parameters": {
        "width": 498,
        "height": 608,
        "content": "## 📋 Auto-Publish Meta Posts\n\n### How it works\nThis workflow automatically posts new content from a Google Sheet to your Facebook Page and notifies your team when it succeeds or fails. It checks the s"
      }
    },
    {
      "id": "fcad0e1d-2523-492b-8c4e-8f77813fbe22",
      "name": "Sheets Setup",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1984,
        -288
      ],
      "parameters": {
        "width": 624,
        "height": 410,
        "content": "## Input & Filtering \n\n\nChecks the Google Sheet every minute and filters for rows where `status = pending`. \nThe Code node ensures only the latest pending row is used. \nThen the data is extracted for "
      }
    },
    {
      "id": "998b413e-7413-4f7f-af7c-aedcdc5f700c",
      "name": "Success Check",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1328,
        -336
      ],
      "parameters": {
        "width": 432,
        "height": 454,
        "content": "## Meta Publishing \n\n\nPublishes the image and caption to your Facebook Page using the Graph API. \nAfter posting, the IF node checks if a valid Post ID exists to confirm success before continuing.\n"
      }
    },
    {
      "id": "27171806-46fd-4889-a044-85766c8269a1",
      "name": "Success Notifications",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -864,
        -592
      ],
      "parameters": {
        "width": 480,
        "height": 598,
        "content": "## Success Notifications & Sheet Update \n\n\nIf the post succeeds, sends a Slack and Outlook/Email confirmation with caption, image, and post ID. \nFinally, updates the Google Sheet to mark the post as “"
      }
    },
    {
      "id": "9d764a80-d3ff-4d41-a074-405faac0100c",
      "name": "Error Notifications",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -864,
        16
      ],
      "parameters": {
        "width": 448,
        "height": 422,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Error Handling \n\n\nIf posting fails, sends a Slack and email alert containing the error message, caption, and image URL. \nHelps you quickly spot and fix issues with credentials or im"
      }
    },
    {
      "id": "bd4e17ad-641d-471b-ba10-60e4eb66396b",
      "name": "rigger – Fetch Pending Posts (Google Sheets)",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        -1936,
        -48
      ]
    },
    {
      "id": "46269dca-9c92-4ffb-8aae-638200b11e67",
      "name": "Filter Pending Posts (Code Node)",
      "type": "n8n-nodes-base.code",
      "position": [
        -1712,
        -48
      ]
    },
    {
      "id": "866cf0cb-bf26-48d7-9d07-efa7503b94a4",
      "name": "Prepare Post Data",
      "type": "n8n-nodes-base.set",
      "position": [
        -1488,
        -48
      ]
    },
    {
      "id": "46abb3e3-ee59-403e-b863-c9b927aaf628",
      "name": "Publish Post to Meta (Facebook Graph API)",
      "type": "n8n-nodes-base.facebookGraphApi",
      "position": [
        -1264,
        -48
      ]
    },
    {
      "id": "291b95ed-08b5-4fa1-a540-077a411d0ba6",
      "name": "Check Publish Success",
      "type": "n8n-nodes-base.if",
      "position": [
        -1040,
        -48
      ]
    },
    {
      "id": "c882a92b-b4a3-49c5-b65b-916f2be96537",
      "name": "Notify Success in Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        -816,
        -336
      ]
    },
    {
      "id": "aabd920d-ed41-4511-b722-411ee82d653c",
      "name": "Send Success Email (Outlook/SMTP)",
      "type": "n8n-nodes-base.microsoftOutlook",
      "position": [
        -816,
        -144
      ]
    },
    {
      "id": "6be47779-6759-4f2b-96e1-3973f21292a9",
      "name": "Update Post Status in Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -592,
        -336
      ]
    },
    {
      "id": "079b3340-1229-49b3-ae92-0d0e0a760383",
      "name": "Notify Failure in Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        -816,
        48
      ]
    },
    {
      "id": "03740964-7291-4b80-85d5-37baad0d38e6",
      "name": "Send Failure Email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        -608,
        64
      ]
    }
  ],
  "connections": {
    "Prepare Post Data": {
      "main": [
        [
          {
            "node": "Publish Post to Meta (Facebook Graph API)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Publish Success": {
      "main": [
        [
          {
            "node": "Notify Success in Slack",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Success Email (Outlook/SMTP)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Notify Failure in Slack",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Failure Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify Success in Slack": {
      "main": [
        [
          {
            "node": "Update Post Status in Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Pending Posts (Code Node)": {
      "main": [
        [
          {
            "node": "Prepare Post Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Publish Post to Meta (Facebook Graph API)": {
      "main": [
        [
          {
            "node": "Check Publish Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "rigger – Fetch Pending Posts (Google Sheets)": {
      "main": [
        [
          {
            "node": "Filter Pending Posts (Code Node)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}