{
  "id": "3zXHJoUh9tbOisAL",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Check bulk domain ranks and save results to Google Sheets with DataForSEO",
  "tags": [],
  "nodes": [
    {
      "id": "14b95b29-4316-4ae2-93a5-7e03abade451",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "47a09b3b-3750-4cd1-b59f-78b671ec2434",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        416,
        0
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "ad8155a0-4122-472f-9d2d-9ae6911c9644",
      "name": "Update row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1040,
        0
      ],
      "parameters": {
        "columns": {
          "value": {
            "Date": "={{ $now.format('yyyy-MM-dd') }}",
            "Rank": "={{ $json.rank}}",
            "Target": "={{ $json.target }}"
          },
          "schema": [
            {
              "id": "Target",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Target",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Date",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Rank",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Rank",
              "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": [
            "Target"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1965912569,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/189GEF2UkVFE-KMvp3xGusCp-r7uz3U84qnb07OzwUvo/edit#gid=1965912569",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "189GEF2UkVFE-KMvp3xGusCp-r7uz3U84qnb07OzwUvo",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/189GEF2UkVFE-KMvp3xGusCp-r7uz3U84qnb07OzwUvo/edit?usp=drivesdk",
          "cachedResultName": "Bulk Rank Checker"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "1a449242-60d5-4b2c-8028-5288a387f08a",
      "name": "Get targets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        208,
        0
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1965912569,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/189GEF2UkVFE-KMvp3xGusCp-r7uz3U84qnb07OzwUvo/edit#gid=1965912569",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "189GEF2UkVFE-KMvp3xGusCp-r7uz3U84qnb07OzwUvo",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/189GEF2UkVFE-KMvp3xGusCp-r7uz3U84qnb07OzwUvo/edit?usp=drivesdk",
          "cachedResultName": "Bulk Rank Checker"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "8c23a748-9f59-43fe-893f-29e55373faa4",
      "name": "Split out (items)",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        832,
        0
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "tasks[0].result[0].items"
      },
      "typeVersion": 1
    },
    {
      "id": "4958d4d9-10f7-4703-8b1b-f5c5974979b0",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        176,
        -144
      ],
      "parameters": {
        "color": 6,
        "width": 384,
        "height": 304,
        "content": "## Get targets\nCreate a Google Sheets connection and select the spreadsheet with targets. The sheet must have the same columns as in [this Example](https://docs.google.com/spreadsheets/d/1VZfCa4w8YgGtHRQpGYDT6rq6UhwVOZxLhKzAHx5QyzY/edit?usp=sharing)."
      },
      "typeVersion": 1
    },
    {
      "id": "252b26ac-ace5-4b55-a46b-0f7100c29ce1",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        576,
        -144
      ],
      "parameters": {
        "color": 6,
        "width": 592,
        "height": 304,
        "content": "## Get bulk ranks with DataForSEO and save the data to the spreadsheet\nCreate a DataForSEO connection.\nSelect the same spreadsheet with your targets as in the first Google Sheets node."
      },
      "typeVersion": 1
    },
    {
      "id": "7a6a746b-1808-4211-8c40-14d29918707f",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -448,
        -224
      ],
      "parameters": {
        "width": 384,
        "height": 528,
        "content": "This workflow retrieves rank scores for multiple target domains using the DataForSEO Bulk Ranks endpoint and writes the results into a Google Sheet.\n\n## How it works\n1. Triggers manually.\n2. Reads target domains from your Google Sheet.\n3. Aggregates the domains into a single batch request.\n4. Sends the request to the DataForSEO Bulk Ranks endpoint.\n5. Fetches a rank score for each target.\n6. Organizes the results back into the Google Sheet.\n\n## Setup steps\n1. Create or select your DataForSEO connection (use your [API login and password](https://app.dataforseo.com/api-access)).\n2. Create or select your Google Sheets connection.\n3. Prepare your Google Sheet with target domains following the required column structure.\n4. Select the same spreadsheet in both Google Sheets nodes.\n5. Run the workflow."
      },
      "typeVersion": 1
    },
    {
      "id": "cf514f54-e7a5-47f7-8797-a43d06a65364",
      "name": "Get bulk ranks",
      "type": "n8n-nodes-dataforseo.dataForSeoBacklinksApi",
      "position": [
        624,
        0
      ],
      "parameters": {
        "operation": "get-bulk-ranks",
        "input_mode": "json",
        "targets_1000_json": "={{ $json.data.map(item => item.Target) }}"
      },
      "credentials": {
        "dataForSeoApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "4e4ce123-53dd-4513-b7a7-88abaff902b2",
  "connections": {
    "Aggregate": {
      "main": [
        [
          {
            "node": "Get bulk ranks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get targets": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get bulk ranks": {
      "main": [
        [
          {
            "node": "Split out (items)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split out (items)": {
      "main": [
        [
          {
            "node": "Update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Get targets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}