{
  "name": "Send weekly Local Falcon rank reports via email",
  "nodes": [
    {
      "parameters": {
        "content": "## Send Weekly Local Falcon Rank Reports via Email\n\n**Who is this for:** SEO agencies and marketers who want automated weekly ranking summaries delivered to their inbox or clients.\n\n**What this workflow does:**\n1. Runs automatically every Monday at 9am\n2. Fetches your most recent scan reports from Local Falcon\n3. Formats the ranking data into a clean HTML table\n4. Sends the report via email\n\n**How to set up:**\n1. Add your Local Falcon API credentials (get your key at https://www.localfalcon.com/api/credentials)\n2. Add your SMTP email credentials\n3. Update the email addresses in the \"Configure Report Settings\" node\n4. Activate the workflow\n\n**Requirements:**\n- Local Falcon account with API access\n- SMTP email credentials (Gmail, SendGrid, etc.)\n\n**How to customize:**\n- Change the schedule in the trigger node (daily, bi-weekly, etc.)\n- Modify the HTML template in the email node\n- Add filters for specific locations or keywords\n- Connect to Slack instead of email",
        "height": 480,
        "width": 420,
        "color": 5
      },
      "id": "sticky-main",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        180,
        -140
      ]
    },
    {
      "parameters": {
        "content": "### Step 1: Schedule\nTriggers every Monday at 9am. Adjust the schedule as needed.",
        "height": 100,
        "width": 220
      },
      "id": "sticky-step1",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        110,
        620
      ]
    },
    {
      "parameters": {
        "content": "### Step 2: Settings\nConfigure your email recipients and report limit here.",
        "height": 100,
        "width": 220
      },
      "id": "sticky-step2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        390,
        620
      ]
    },
    {
      "parameters": {
        "content": "### Step 3: Fetch Reports\nPulls recent scan reports from Local Falcon API.",
        "height": 100,
        "width": 220
      },
      "id": "sticky-step3",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        670,
        620
      ]
    },
    {
      "parameters": {
        "content": "### Step 4: Send Email\nFormats and sends the HTML report to configured recipients.",
        "height": 100,
        "width": 220
      },
      "id": "sticky-step4",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        950,
        620
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "triggerAtDay": [
                1
              ],
              "triggerAtHour": 9
            }
          ]
        }
      },
      "id": "schedule",
      "name": "Every Monday 9am",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        220,
        400
      ]
    },
    {
      "parameters": {
        "mode": "raw",
        "jsonOutput": "{\n  \"toEmail\": \"your-email@company.com\",\n  \"fromEmail\": \"reports@company.com\",\n  \"reportLimit\": 20\n}",
        "options": {}
      },
      "id": "settings",
      "name": "Configure Report Settings",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        500,
        400
      ]
    },
    {
      "parameters": {
        "resource": "scan",
        "operation": "listReports",
        "additionalFields": {
          "limit": "={{ $json.reportLimit }}"
        }
      },
      "id": "get-reports",
      "name": "Fetch Scan Reports",
      "type": "@local-falcon/n8n-nodes-localfalcon.localFalcon",
      "typeVersion": 1,
      "position": [
        780,
        400
      ],
      "credentials": {
        "localFalconApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "fromEmail": "={{ $('Configure Report Settings').item.json.fromEmail }}",
        "toEmail": "={{ $('Configure Report Settings').item.json.toEmail }}",
        "subject": "Weekly Local Falcon Rank Report - {{ $now.format('MMM d, yyyy') }}",
        "emailType": "html",
        "html": "<h1>Weekly Ranking Report</h1>\n<p>Generated: {{ $now.format('MMMM d, yyyy') }}</p>\n<p>Here are your latest Local Falcon scan results:</p>\n<table border=\"1\" cellpadding=\"8\" cellspacing=\"0\" style=\"border-collapse: collapse;\">\n<tr style=\"background-color: #f2f2f2;\">\n<th>Location</th>\n<th>Keyword</th>\n<th>Avg Rank</th>\n<th>Platform</th>\n<th>Scan Date</th>\n</tr>\n{{#each $json.reports}}\n<tr>\n<td>{{ this.location_name }}</td>\n<td>{{ this.keyword }}</td>\n<td>{{ this.avg_rank }}</td>\n<td>{{ this.platform }}</td>\n<td>{{ this.scan_date }}</td>\n</tr>\n{{/each}}\n</table>\n<p style=\"color: #666; font-size: 12px; margin-top: 20px;\">Powered by Local Falcon + n8n</p>"
      },
      "id": "send-email",
      "name": "Send Report Email",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        1060,
        400
      ],
      "credentials": {
        "smtp": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Every Monday 9am": {
      "main": [
        [
          {
            "node": "Configure Report Settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configure Report Settings": {
      "main": [
        [
          {
            "node": "Fetch Scan Reports",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Scan Reports": {
      "main": [
        [
          {
            "node": "Send Report Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "meta": {
    "templateCredsSetupCompleted": true
  }
}