{
  "id": "Cg3JzxhpFTxUB3N1",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Turn new high-volume ranked keywords into Asana tasks with DataForSEO",
  "tags": [],
  "nodes": [
    {
      "id": "df437481-d38f-41b6-bb98-1f686d612da1",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        448,
        64
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "0711de42-6561-4057-a140-c8c5c7435c1d",
      "name": "Get ranked keywords",
      "type": "n8n-nodes-dataforseo.dataForSeoLabsApi",
      "position": [
        656,
        432
      ],
      "parameters": {
        "limit": 1000,
        "offset": "={{ $runIndex * 1000 }}",
        "filters": "[\"keyword_data.keyword_info.search_volume\", \">\", 1000]",
        "operation": "get-ranked-keywords",
        "target_any": "={{ $('Get targets').item.json.Domain }}",
        "language_name": "={{ $('Get targets').item.json.Language }}",
        "location_name": "={{ $('Get targets').item.json.Location }}"
      },
      "credentials": {
        "dataForSeoApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "cf54be10-4421-42d7-a6ec-0d2249009315",
      "name": "Get previous keywords",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        224,
        64
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1681593026,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1uCvVHKk8rWeQ_FKpZkBfrCB26Q6UebwwzsOdU7EmUYU/edit#gid=1681593026",
          "cachedResultName": "Keywords"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1uCvVHKk8rWeQ_FKpZkBfrCB26Q6UebwwzsOdU7EmUYU",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1uCvVHKk8rWeQ_FKpZkBfrCB26Q6UebwwzsOdU7EmUYU/edit?usp=drivesdk",
          "cachedResultName": "New Ranked Keywords with SV>1000 from Google with DataForSEO"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7,
      "alwaysOutputData": true
    },
    {
      "id": "f662de6b-233b-4543-9dd3-bde7512111d0",
      "name": "Get targets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1008,
        64
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1uCvVHKk8rWeQ_FKpZkBfrCB26Q6UebwwzsOdU7EmUYU/edit#gid=0",
          "cachedResultName": "Targets"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1uCvVHKk8rWeQ_FKpZkBfrCB26Q6UebwwzsOdU7EmUYU",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1uCvVHKk8rWeQ_FKpZkBfrCB26Q6UebwwzsOdU7EmUYU/edit?usp=drivesdk",
          "cachedResultName": "New Ranked Keywords with SV>1000 from Google with DataForSEO"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "b0bd7f7a-80d8-4eda-9b41-039fedcc34cf",
      "name": "Find new keywords",
      "type": "n8n-nodes-base.code",
      "position": [
        720,
        912
      ],
      "parameters": {
        "jsCode": "let oldKeywords = new Set([]);\nif ($('Aggregate').first().json.data) {\n oldKeywords = new Set($('Aggregate').first().json.data\n  .filter(item => item.Target == $('Get targets').first().json.Domain)\n  .map(item => item.Keyword));\n}\n\nlet newKeywords = [];\nif ($('Merge \"items\" with last response').first().json.items) {\n newKeywords = $('Merge \"items\" with last response').first().json.items\n  .map(item => item.keyword_data.keyword);\n}\n\nlet diff;\nif (oldKeywords.size > 0) {\n  diff = newKeywords.filter(x => !oldKeywords.has(x));\n} else {\n  diff = [];\n}\n\nreturn [\n  {\n    json: {\n      diff\n    }\n  }\n];"
      },
      "typeVersion": 2,
      "alwaysOutputData": true
    },
    {
      "id": "d5c87a26-9e87-4872-9d7e-5f98ebf842a4",
      "name": "Run every Monday",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        64
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "triggerAtDay": [
                1
              ],
              "triggerAtHour": 9
            }
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "84624107-b446-42d3-8bc9-fa30582c9d3d",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        176,
        -96
      ],
      "parameters": {
        "color": 6,
        "width": 656,
        "height": 320,
        "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](https://docs.google.com/spreadsheets/d/1uCvVHKk8rWeQ_FKpZkBfrCB26Q6UebwwzsOdU7EmUYU/edit?gid=1681593026#gid=1681593026)."
      },
      "typeVersion": 1
    },
    {
      "id": "39636210-7256-43fa-aac1-451747dc5e20",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        864,
        -96
      ],
      "parameters": {
        "color": 6,
        "width": 272,
        "height": 320,
        "content": "## Get targets\nSelect a spreadsheet with your target domains. The spreadsheet must have the same columns as in [this Example](https://docs.google.com/spreadsheets/d/1uCvVHKk8rWeQ_FKpZkBfrCB26Q6UebwwzsOdU7EmUYU/edit?gid=0#gid=0)."
      },
      "typeVersion": 1
    },
    {
      "id": "188bd135-29cd-4ee8-9883-6a700c8cdcdd",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        304
      ],
      "parameters": {
        "color": 6,
        "width": 1248,
        "height": 384,
        "content": "## Getn high-volume ranked keywords with DataForSEO\nCreate a DataForSEO connection and set up additional parameters if needed."
      },
      "typeVersion": 1
    },
    {
      "id": "68d73814-2f16-4a6f-a8af-d38d8b3924f2",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        752
      ],
      "parameters": {
        "color": 6,
        "width": 1328,
        "height": 336,
        "content": "## Save high-volume ranked keywords to the spreadsheet, create an Asana task and send a Slack notification\nSelect the same spreadsheet with your keywords as in the first Google Sheets node.\nCreate an Asana connection and select your Workspace ID, Project, Assignee ID, and other fields you need.\nCreate a Slack connection and set a receiver. Add additional information to the message if needed."
      },
      "typeVersion": 1
    },
    {
      "id": "e90caec5-2627-4b7f-beac-dba225fcb0d3",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -576,
        -64
      ],
      "parameters": {
        "width": 384,
        "height": 672,
        "content": "This workflow uses the DataForSEO Labs API to detect new high-volume search queries for which your domain started ranking on Google. Newly discovered keywords are logged in Google Sheets, follow-up tasks are created in Asana, and a short Slack summary is sent to you for a quick review.\n\n## How it works\n1. Runs on a predefined schedule (default: once a week).\n2. Reads your keywords and domains from Google Sheets.\n3. Extracts the latest Google results and keyword metrics via DataForSEO API.\n4. Compares current data with the previous snapshot.\n5. Logs newly ranked high-volume keywords to a dedicated Google Sheet.\n6. Creates follow-up tasks in Asana.\nSends a Slack summary.\n\n## Setup steps\n1. Indicate your spreadsheets with keywords and target domains.\n2. Create or select your DataForSEO connection (use [your API login and password](https://app.dataforseo.com/api-access)).\n3. Set up an Asana connection, select your Workspace, and task Assignee.\n4. Create a Slack connection and choose who gets the summary notification.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "1c0611f3-8bed-4d3f-8d6d-aecf92ddc69b",
      "name": "Aggregate1",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        528,
        912
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "e8b73185-5477-4ef8-9d16-68a1e7d642aa",
      "name": "Clear sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        672,
        64
      ],
      "parameters": {
        "operation": "clear",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1681593026,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1uCvVHKk8rWeQ_FKpZkBfrCB26Q6UebwwzsOdU7EmUYU/edit#gid=1681593026",
          "cachedResultName": "Keywords"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1uCvVHKk8rWeQ_FKpZkBfrCB26Q6UebwwzsOdU7EmUYU",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1uCvVHKk8rWeQ_FKpZkBfrCB26Q6UebwwzsOdU7EmUYU/edit?usp=drivesdk",
          "cachedResultName": "New Ranked Keywords with SV>1000 from Google with DataForSEO"
        },
        "keepFirstRow": true
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "98028427-d79e-4b6d-b3c5-3f5d07892852",
      "name": "Create a task",
      "type": "n8n-nodes-base.asana",
      "position": [
        1136,
        912
      ],
      "parameters": {
        "name": "Create content for new keywords with high search volume",
        "workspace": "112670807337085",
        "otherProperties": {
          "notes": "=New Keyword with SV > 1000 apeared for {{ $('Get targets').item.json.Domain }}: {{ $json.diff.join(', ') }}.\nCreate content for these keywords.",
          "assignee": "1207548230460014",
          "projects": [
            "1207548+1234567890"
          ]
        }
      },
      "credentials": {
        "asanaApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c1b1df43-8fd2-4c97-9d72-0b42ad1ec0b7",
      "name": "Initialize \"items\" field",
      "type": "n8n-nodes-base.set",
      "position": [
        208,
        512
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "0126c659-03a5-4fc8-bd76-62d2ecea1195",
              "name": "items",
              "type": "array",
              "value": "={{ [] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "40c8d87b-47d1-4aae-8f25-67c16a3524a6",
      "name": "Set \"items\" field",
      "type": "n8n-nodes-base.set",
      "position": [
        432,
        512
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "4b3c95a2-4e38-4e37-8e2f-a7e4544808d6",
              "name": "items",
              "type": "array",
              "value": "={{ $json.items }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "c00fc6b5-f9a4-4550-a986-4ffd3ab980fd",
      "name": "Merge \"items\" with DFS response",
      "type": "n8n-nodes-base.set",
      "position": [
        864,
        432
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ddd82419-e43e-44d8-919c-2d6602704da5",
              "name": "items",
              "type": "array",
              "value": "={{ [ ...$('Set \"items\" field').item.json.items, ...$json.tasks[0].result[0].items] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "e3eb66f8-8986-4a80-a6ef-7b49ca7edc66",
      "name": "Has more pages?",
      "type": "n8n-nodes-base.if",
      "position": [
        1072,
        512
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "cd5943f7-df0b-4329-8436-9a1af3ec7caf",
              "operator": {
                "type": "number",
                "operation": "lt"
              },
              "leftValue": "={{ $runIndex }}",
              "rightValue": "={{ $('Get ranked keywords').item.json.tasks[0].result[0].total_count / 1000 - 1}}"
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "85cd20c2-1977-44e1-a7f8-02b1788dc558",
      "name": "Merge \"items\" with last response",
      "type": "n8n-nodes-base.set",
      "position": [
        1264,
        528
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1e2c8353-5628-4948-abe6-35f8d0f660a5",
              "name": "items",
              "type": "array",
              "value": "={{ [...$('Set \"items\" field').item.json.items, ... $('Get ranked keywords').item.json.tasks[0].result[0].items]}}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "62d81cdb-9c64-4812-a02a-fb643822ffe2",
      "name": "Filter (has new keywords)",
      "type": "n8n-nodes-base.filter",
      "position": [
        928,
        912
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "da6f0b48-3db0-45ea-bea2-964604afea74",
              "operator": {
                "type": "array",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.diff }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "b84a4416-dda8-454b-ac3e-9f05692f229e",
      "name": "Split out (items)",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        160,
        912
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "items"
      },
      "typeVersion": 1
    },
    {
      "id": "7fd71859-19a4-4fc4-9800-2e0c41d39cde",
      "name": "Send a message",
      "type": "n8n-nodes-base.slack",
      "position": [
        1328,
        912
      ],
      "parameters": {
        "text": "=New ranked keywords with SV > 1000 for target {{ $('Get targets').item.json.Domain }}: {{ $json.diff.join(', ') }}",
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.4
    },
    {
      "id": "977445ac-eff5-4a12-9c11-4767034f6716",
      "name": "Append keyword in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        336,
        912
      ],
      "parameters": {
        "columns": {
          "value": {
            "Url": "={{ $json.ranked_serp_element.serp_item.url }}",
            "Date": "={{ new Date().toLocaleDateString('en-CA') }}",
            "Rank": "={{ $json.ranked_serp_element.serp_item.rank_group }}",
            "Target": "={{ $('Get targets').item.json.Domain }}",
            "Keyword": "={{ $json.keyword_data.keyword }}",
            "Search Volume": "={{ $json.keyword_data.keyword_info.search_volume }}",
            "SERP Item Types": "={{ $json.ranked_serp_element.serp_item_types.join(', ') }}"
          },
          "schema": [
            {
              "id": "Target",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Target",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Keyword",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Keyword",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Date",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Rank",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Rank",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Search Volume",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Search Volume",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Url",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "SERP Item Types",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "SERP Item Types",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1681593026,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1uCvVHKk8rWeQ_FKpZkBfrCB26Q6UebwwzsOdU7EmUYU/edit#gid=1681593026",
          "cachedResultName": "Keywords"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1uCvVHKk8rWeQ_FKpZkBfrCB26Q6UebwwzsOdU7EmUYU",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1uCvVHKk8rWeQ_FKpZkBfrCB26Q6UebwwzsOdU7EmUYU/edit?usp=drivesdk",
          "cachedResultName": "Get New High-Volume Ranked Keywords on Google with DataForSEO"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "7f2ccda1-8582-4c5e-b4b2-d93be1a5ea90",
      "name": "Loop over targets",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -16,
        496
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "ef09904f-fb95-42ae-bc94-84c854da4ad0",
  "connections": {
    "Aggregate": {
      "main": [
        [
          {
            "node": "Clear sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate1": {
      "main": [
        [
          {
            "node": "Find new keywords",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clear sheet": {
      "main": [
        [
          {
            "node": "Get targets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get targets": {
      "main": [
        [
          {
            "node": "Loop over targets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a task": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message": {
      "main": [
        [
          {
            "node": "Loop over targets",
            "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
          }
        ]
      ]
    },
    "Run every Monday": {
      "main": [
        [
          {
            "node": "Get previous keywords",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find new keywords": {
      "main": [
        [
          {
            "node": "Filter (has new keywords)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop over targets": {
      "main": [
        [],
        [
          {
            "node": "Initialize \"items\" field",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set \"items\" field": {
      "main": [
        [
          {
            "node": "Get ranked keywords",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split out (items)": {
      "main": [
        [
          {
            "node": "Append keyword in sheet",
            "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
          }
        ]
      ]
    },
    "Append keyword in sheet": {
      "main": [
        [
          {
            "node": "Aggregate1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Initialize \"items\" field": {
      "main": [
        [
          {
            "node": "Set \"items\" field",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter (has new keywords)": {
      "main": [
        [
          {
            "node": "Create a task",
            "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
          }
        ]
      ]
    }
  }
}