{
  "name": "Get Gmail alerts for dropped top 10 keyword rankings with DataForSEO",
  "nodes": [
    {
      "id": "e8a35e6a-1a83-46f5-b26a-d7395533064a",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        432
      ]
    },
    {
      "id": "e37ec900-8560-4c3a-b18a-9c0b80ea705f",
      "name": "Get ranked keywords",
      "type": "n8n-nodes-dataforseo.dataForSeoLabsApi",
      "position": [
        1344,
        352
      ]
    },
    {
      "id": "f58585b8-d7c0-48ec-a0b4-615ed8e57f35",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        448,
        432
      ]
    },
    {
      "id": "a6dc99eb-ae28-4ee8-bbbe-1a1fbf3ec44d",
      "name": "Append row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2688,
        432
      ]
    },
    {
      "id": "5ef1ed8f-9551-4b02-86c5-0a56cc54d585",
      "name": "Aggregate1",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        3136,
        432
      ]
    },
    {
      "id": "12921ffe-4297-4eec-865f-6df4c6bca687",
      "name": "Filter items with rank > 10",
      "type": "n8n-nodes-base.filter",
      "position": [
        2464,
        432
      ]
    },
    {
      "id": "277510ef-7e7f-4911-8b58-a1856e1320af",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        912,
        1216
      ]
    },
    {
      "id": "e065ea70-b4aa-4a82-bc2a-a82c5231ffb0",
      "name": "Get live google organic SERP regular",
      "type": "n8n-nodes-dataforseo.dataForSeoSerpApi",
      "position": [
        1568,
        944
      ]
    },
    {
      "id": "dee22441-cf1c-4391-8276-6fffb39fdbdf",
      "name": "Get live google organic SERP regular1",
      "type": "n8n-nodes-dataforseo.dataForSeoSerpApi",
      "position": [
        1536,
        1248
      ]
    },
    {
      "id": "ff7c2ab4-a8d7-4056-b5ba-7997fbe77ce7",
      "name": "Get live google organic SERP regular2",
      "type": "n8n-nodes-dataforseo.dataForSeoSerpApi",
      "position": [
        1520,
        1584
      ]
    },
    {
      "id": "399eb5c0-6e0c-492e-898a-08d21730421e",
      "name": "Aggregate2",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2112,
        944
      ]
    },
    {
      "id": "bf79e569-784c-455d-b2b9-d65a9e2d3017",
      "name": "Aggregate3",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2112,
        1248
      ]
    },
    {
      "id": "d66f5e21-8e37-49c7-85f1-b3a68b33c041",
      "name": "Aggregate4",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2112,
        1584
      ]
    },
    {
      "id": "8d3d528e-e9fa-4e7e-89b6-d5fcf77b02c3",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        2672,
        1200
      ]
    },
    {
      "id": "e744c8b2-8e75-4385-9e55-80ec507f2ef5",
      "name": "Aggregate5",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2880,
        1216
      ]
    },
    {
      "id": "24713785-8aa8-4136-beaf-65c80fc4b1f0",
      "name": "Get previous keywords",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        224,
        432
      ]
    },
    {
      "id": "7fc57acc-f28d-441f-94b6-41fd81336875",
      "name": "Clear sheet (previous keywords)",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        672,
        432
      ]
    },
    {
      "id": "27316730-ae4f-4f92-988b-ee3659b47e5c",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        784
      ],
      "parameters": {
        "width": 432,
        "height": 672,
        "content": "This workflow uses the DataForSEO APIs to spot keywords for which your domain dropped out of Google’s top 10 results. It compares the latest rankings with the previous week’s snapshot, enriches each l"
      }
    },
    {
      "id": "ae363d85-059f-44a3-866d-28a9cf30a3bc",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        176,
        272
      ],
      "parameters": {
        "width": 640,
        "height": 368,
        "content": "## Get previous keywords and clear the sheet\nCreate a Google Sheets connection and select the spreadsheet where keywords should be saved. The sheet must have the same columns as in [this Example](http"
      }
    },
    {
      "id": "613d5984-bd6c-4d17-997c-f7fc3ea9ddd4",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        864,
        272
      ],
      "parameters": {
        "width": 1296,
        "height": 368,
        "content": "## Get ranked keywords keywords with DataForSEO\n Create a DataForSEO connection and specify the Target Domain, Location, and Language. Set up additional parameters if needed."
      }
    },
    {
      "id": "541e2a86-f2b2-4a2c-b711-77660b1667ec",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2224,
        272
      ],
      "parameters": {
        "width": 1472,
        "height": 368,
        "content": "## Add new Top 10 keywords to Google Sheets and calculate Top 1, Top 3, and Top 10 results\nSelect the same spreadsheet with your keywords as in the first Google Sheets node."
      }
    },
    {
      "id": "b905f0f6-c5d4-4b25-a04c-6474844f6c48",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        672,
        784
      ],
      "parameters": {
        "width": 2576,
        "height": 1072,
        "content": "## Find keywords that dropped from Top 1, Top 3, Top 10. Prepare data for email and send it\nCreate a DataForSEO connection and set up additional parameters if needed.\nCreate a Gmail connection and set"
      }
    },
    {
      "id": "fc2520f0-6cd6-4f48-b43a-59714c0f65da",
      "name": "Initialize \"items\" field",
      "type": "n8n-nodes-base.set",
      "position": [
        896,
        432
      ]
    },
    {
      "id": "24511182-e847-4420-b2e9-9cd38d63e04d",
      "name": "Set \"items\" field",
      "type": "n8n-nodes-base.set",
      "position": [
        1120,
        432
      ]
    },
    {
      "id": "40d4ef86-7c33-4305-a60e-fb77bec0cecc",
      "name": "Has more pages?",
      "type": "n8n-nodes-base.if",
      "position": [
        1792,
        416
      ]
    },
    {
      "id": "d24fc0bd-8a82-45bc-ba62-375140d9796b",
      "name": "Merge \"items\" with DFS response",
      "type": "n8n-nodes-base.set",
      "position": [
        1568,
        352
      ]
    },
    {
      "id": "f422f95f-a37c-47f2-a2d2-38fcbbc30af2",
      "name": "Merge \"items\" with last response",
      "type": "n8n-nodes-base.set",
      "position": [
        2016,
        432
      ]
    },
    {
      "id": "a8686a63-5f02-4041-a8c4-014cee7a3b88",
      "name": "Split out (items)",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        2240,
        432
      ]
    },
    {
      "id": "0d2eafc4-da2c-46fa-b367-6f12f5fb53df",
      "name": "Filter (data for comparing is not empty)",
      "type": "n8n-nodes-base.filter",
      "position": [
        3328,
        432
      ]
    },
    {
      "id": "a8e6696f-fc00-4501-b301-408aa84ec06a",
      "name": "Split out (previous keywords)",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        688,
        1232
      ]
    },
    {
      "id": "65f1285a-7a96-4e56-9c21-1d3de176cca6",
      "name": "Split out (SERP results)",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1760,
        944
      ]
    },
    {
      "id": "b791d00f-4369-42fa-8279-d02876fc8102",
      "name": "Split out (SERP results)1",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1744,
        1248
      ]
    },
    {
      "id": "b6593867-8b2c-47a0-a8b9-acf1041ea7ba",
      "name": "Split out (SERP results)2",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1728,
        1584
      ]
    },
    {
      "id": "a2964b99-b37b-42e5-9aaf-e1beab103bbf",
      "name": "Send a message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        3104,
        1216
      ]
    },
    {
      "id": "bf6f80af-a0e9-409c-be75-d7a0eda1ca0b",
      "name": "Set Top 1, Top 3, Top 10",
      "type": "n8n-nodes-base.set",
      "position": [
        2912,
        432
      ]
    },
    {
      "id": "8bc0409d-0c83-4979-aa09-c09a9133470e",
      "name": "Filter Top 1, Top 2, Top 3",
      "type": "n8n-nodes-base.set",
      "position": [
        3520,
        432
      ]
    },
    {
      "id": "39a4437a-6fd6-4ef3-b949-b48d78bda22e",
      "name": "Filter (dropped from Top 3)",
      "type": "n8n-nodes-base.filter",
      "position": [
        1152,
        1232
      ]
    },
    {
      "id": "10e2e4a5-49e0-4c01-b98c-cf7496115e63",
      "name": "Filter (dropped from Top 10)",
      "type": "n8n-nodes-base.filter",
      "position": [
        1136,
        1568
      ]
    },
    {
      "id": "7c3b8c6b-5b07-4ad9-abd5-b766019a20e1",
      "name": "Loop Over Top 1 Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1376,
        928
      ]
    },
    {
      "id": "fbcafc38-9b18-4b4e-b475-dce32a85d7d9",
      "name": "Loop Over Top 2 Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1376,
        1232
      ]
    },
    {
      "id": "f0bdfa67-f9df-485e-95e2-6431e1b4d7ba",
      "name": "Loop Over Top 3 Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1344,
        1568
      ]
    },
    {
      "id": "2c4a910d-2d9b-4135-927e-a8acd0a2367b",
      "name": "Filter (dropped from Top 1)",
      "type": "n8n-nodes-base.filter",
      "position": [
        1152,
        1008
      ]
    },
    {
      "id": "cddb9271-365d-4711-8b36-2e21b1f2d5fd",
      "name": "Prepare email content",
      "type": "n8n-nodes-base.set",
      "position": [
        1936,
        944
      ]
    },
    {
      "id": "d7ee6b85-2d02-4145-bc1b-e96f36c8ddcf",
      "name": "Prepare email content1",
      "type": "n8n-nodes-base.set",
      "position": [
        2288,
        944
      ]
    },
    {
      "id": "1f74d853-8226-4978-869a-940e7477f8aa",
      "name": "Prepare email content2",
      "type": "n8n-nodes-base.set",
      "position": [
        1936,
        1248
      ]
    },
    {
      "id": "29b9a73a-27ec-4b9b-a189-23853af1774a",
      "name": "Prepare email content3",
      "type": "n8n-nodes-base.set",
      "position": [
        2304,
        1248
      ]
    },
    {
      "id": "87a9cf06-0731-4ec2-81d1-6113267654c5",
      "name": "Prepare email content4",
      "type": "n8n-nodes-base.set",
      "position": [
        1920,
        1584
      ]
    },
    {
      "id": "c3506482-2b1e-4fe4-b0c1-4130285c81f3",
      "name": "Prepare email content5",
      "type": "n8n-nodes-base.set",
      "position": [
        2272,
        1584
      ]
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Aggregate5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Filter (dropped from Top 1)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Filter (dropped from Top 3)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Filter (dropped from Top 10)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Clear sheet (previous keywords)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate1": {
      "main": [
        [
          {
            "node": "Filter (data for comparing is not empty)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate2": {
      "main": [
        [
          {
            "node": "Prepare email content1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate3": {
      "main": [
        [
          {
            "node": "Prepare email content3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate4": {
      "main": [
        [
          {
            "node": "Prepare email content5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate5": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has more pages?": {
      "main": [
        [
          {
            "node": "Set \"items\" field",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Merge \"items\" with last response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get previous keywords",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set \"items\" field": {
      "main": [
        [
          {
            "node": "Get ranked keywords",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split out (items)": {
      "main": [
        [
          {
            "node": "Filter items with rank > 10",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append row in sheet": {
      "main": [
        [
          {
            "node": "Set Top 1, Top 3, Top 10",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get ranked keywords": {
      "main": [
        [
          {
            "node": "Merge \"items\" with DFS response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get previous keywords": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Top 1 Items": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get live google organic SERP regular",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Top 2 Items": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ],
        [
          {
            "node": "Get live google organic SERP regular1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Top 3 Items": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 2
          }
        ],
        [
          {
            "node": "Get live google organic SERP regular2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare email content": {
      "main": [
        [
          {
            "node": "Aggregate2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare email content1": {
      "main": [
        [
          {
            "node": "Loop Over Top 1 Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare email content2": {
      "main": [
        [
          {
            "node": "Aggregate3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare email content3": {
      "main": [
        [
          {
            "node": "Loop Over Top 2 Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare email content4": {
      "main": [
        [
          {
            "node": "Aggregate4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare email content5": {
      "main": [
        [
          {
            "node": "Loop Over Top 3 Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Initialize \"items\" field": {
      "main": [
        [
          {
            "node": "Set \"items\" field",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Top 1, Top 3, Top 10": {
      "main": [
        [
          {
            "node": "Aggregate1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split out (SERP results)": {
      "main": [
        [
          {
            "node": "Prepare email content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split out (SERP results)1": {
      "main": [
        [
          {
            "node": "Prepare email content2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split out (SERP results)2": {
      "main": [
        [
          {
            "node": "Prepare email content4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Top 1, Top 2, Top 3": {
      "main": [
        [
          {
            "node": "Split out (previous keywords)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter (dropped from Top 1)": {
      "main": [
        [
          {
            "node": "Loop Over Top 1 Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter (dropped from Top 3)": {
      "main": [
        [
          {
            "node": "Loop Over Top 2 Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter items with rank > 10": {
      "main": [
        [
          {
            "node": "Append row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter (dropped from Top 10)": {
      "main": [
        [
          {
            "node": "Loop Over Top 3 Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split out (previous keywords)": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clear sheet (previous keywords)": {
      "main": [
        [
          {
            "node": "Initialize \"items\" field",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge \"items\" with DFS response": {
      "main": [
        [
          {
            "node": "Has more pages?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge \"items\" with last response": {
      "main": [
        [
          {
            "node": "Split out (items)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get live google organic SERP regular": {
      "main": [
        [
          {
            "node": "Split out (SERP results)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get live google organic SERP regular1": {
      "main": [
        [
          {
            "node": "Split out (SERP results)1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get live google organic SERP regular2": {
      "main": [
        [
          {
            "node": "Split out (SERP results)2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter (data for comparing is not empty)": {
      "main": [
        [
          {
            "node": "Filter Top 1, Top 2, Top 3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}