{
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 9 * * 1"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.3,
      "position": [
        0,
        0
      ],
      "id": "549410ea-e56c-433b-9875-9c32938b2c18",
      "name": "Every Monday 9 AM"
    },
    {
      "parameters": {
        "databaseId": 458166,
        "tableId": 1010368,
        "additionalOptions": {}
      },
      "type": "n8n-nodes-base.baserow",
      "typeVersion": 1,
      "position": [
        208,
        0
      ],
      "id": "092c2d8f-c00b-4533-b19b-30fceb9a4bbd",
      "name": "Read keywords (Baserow)",
      "credentials": {
        "baserowApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "google_search",
        "query": "={{ $json.keyword }}",
        "geo": "United States",
        "results_limit": 10
      },
      "type": "@decodo/n8n-nodes-decodo.decodo",
      "typeVersion": 1,
      "position": [
        416,
        0
      ],
      "id": "9077255d-da4d-477d-8165-fcbebba48360",
      "name": "Scrape Google ranking",
      "credentials": {
        "decodoApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "create",
        "databaseId": 458166,
        "tableId": 1010369,
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": 8864513,
              "fieldValue": "={{ $json.results[0].query }}"
            },
            {
              "fieldId": 8864516,
              "fieldValue": "={{ $now.toFormat('yyyy-MM-dd') }}"
            },
            {
              "fieldId": 8864517,
              "fieldValue": "={{ String((($json.results[0].content.results.results.organic) || []).find(o => /:\\/\\/([^\\/]*\\.)?decodo\\.com([\\/:?#]|$)/i.test(o.url || ''))?.pos ?? 'not ranked') }}"
            },
            {
              "fieldId": 8864518,
              "fieldValue": "={{ (($json.results[0].content.results.results.organic) || []).find(o => /:\\/\\/([^\\/]*\\.)?decodo\\.com([\\/:?#]|$)/i.test(o.url || ''))?.url ?? '' }}"
            },
            {
              "fieldId": 8866766,
              "fieldValue": "={{ (($json.results[0].content.results.results.organic) || []).find(o => /:\\/\\/([^\\/]*\\.)?decodo\\.com([\\/:?#]|$)/i.test(o.url || ''))?.title ?? '' }}"
            },
            {
              "fieldId": 8866768,
              "fieldValue": "={{ (($json.results[0].content.results.results.organic) || []).some(o => /:\\/\\/([^\\/]*\\.)?decodo\\.com([\\/:?#]|$)/i.test(o.url || '')) ? 'yes' : 'no' }}"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.baserow",
      "typeVersion": 1,
      "position": [
        624,
        0
      ],
      "id": "4db78fe5-344d-4be2-907c-b798c6963211",
      "name": "Save rank (Baserow)",
      "credentials": {
        "baserowApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Every Monday 9 AM": {
      "main": [
        [
          {
            "node": "Read keywords (Baserow)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read keywords (Baserow)": {
      "main": [
        [
          {
            "node": "Scrape Google ranking",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape Google ranking": {
      "main": [
        [
          {
            "node": "Save rank (Baserow)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}