{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "425810c5-874c-41db-8fdd-59450e7f280e",
      "name": "Send a message",
      "type": "n8n-nodes-base.microsoftOutlook",
      "position": [
        -784,
        9472
      ],
      "parameters": {
        "subject": "Build AI Agents & Automations with n8n",
        "bodyContent": "Hi There,\n\nI help people learn how to build AI agents and create powerful AI automations using n8n. If you\u2019re exploring ways to save time or scale your workflows, I\u2019d love to share what\u2019s possible.\n\nYou can check out my n8n Creator profile here with 70+ ready-to-use automations:\n\ud83d\udc49 https://n8n.io/creators/rbreen\n\nIf you\u2019d like help getting started or want to see what AI + n8n can do for your business, just reply to this email.\n\nBest,\nRobert Breen\n\ud83d\udcde +1234567890\n\ud83d\udd17 https://www.linkedin.com/in/robert-breen-29429625/",
        "toRecipients": "={{ $json.Email }}",
        "additionalFields": {}
      },
      "credentials": {
        "microsoftOutlookOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2,
      "alwaysOutputData": true
    },
    {
      "id": "e84f0281-eb13-4afa-b831-eae6f1a5cf54",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -2416,
        9072
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 9
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "1d3ef656-0288-45c2-8b82-a9aa7b57e2b0",
      "name": "Get row(s) in sheet3",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -2080,
        9232
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1sXXVbl2kKdYTzCmZDe7QyeMp1N9wZg9K63oGK2UIaeU/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1sXXVbl2kKdYTzCmZDe7QyeMp1N9wZg9K63oGK2UIaeU",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1sXXVbl2kKdYTzCmZDe7QyeMp1N9wZg9K63oGK2UIaeU/edit?usp=drivesdk",
          "cachedResultName": "New Leads"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "7fa47640-1e65-491d-9457-ef32d0b7f600",
      "name": "Filter1",
      "type": "n8n-nodes-base.filter",
      "position": [
        -1744,
        9088
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "914418a9-8c96-4959-abb7-ad3bb52f420d",
              "operator": {
                "type": "string",
                "operation": "empty",
                "singleValue": true
              },
              "leftValue": "={{ $json.Contacted }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "3b4a33f6-c810-4dcb-9b19-3abc6b982e9f",
      "name": "Append or update row in sheet1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1312,
        8736
      ],
      "parameters": {
        "columns": {
          "value": {
            "Email": "={{ $json.Email }}",
            "Contacted": "Yes"
          },
          "schema": [
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Contacted",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Contacted",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Created",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Created",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Email"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/14T6rilaOl1LBTwNnu7ILE3T1equWOz0noI-OIUaI3zU/edit#gid=0",
          "cachedResultName": "leads"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "14T6rilaOl1LBTwNnu7ILE3T1equWOz0noI-OIUaI3zU",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/14T6rilaOl1LBTwNnu7ILE3T1equWOz0noI-OIUaI3zU/edit?usp=drivesdk",
          "cachedResultName": "New Leads - Real"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "65e19508-beb8-4b3d-8ec8-55093f437fd5",
      "name": "Sticky Note58",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2688,
        8576
      ],
      "parameters": {
        "color": 7,
        "width": 2144,
        "height": 1056,
        "content": "## Email new leads from Google Sheets via Outlook on a schedule\n\nSend a templated outreach email to **new leads** in a Google Sheet on a **daily schedule**, then **mark each lead as contacted** so they won\u2019t be emailed twice. Built with: **Schedule Trigger \u2192 Google Sheets \u2192 Filter \u2192 Outlook Send Email \u2192 Google Sheets (append/update)**.\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "6736dbfa-79fc-4aa6-9890-5b60b3b98cd1",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3120,
        8576
      ],
      "parameters": {
        "width": 400,
        "height": 1056,
        "content": "## How to set up\n### 1) Google Sheets (OAuth2)\n- In **n8n \u2192 Credentials \u2192 New \u2192 Google Sheets (OAuth2)**, sign in and grant access.  \n- In **Get rows**: select your **Lead Source** sheet (e.g., \u201cNew Leads\u201d).  \n- In **Append/Update**: select the sheet you want to mark as contacted (can be the same sheet or a CRM sheet).  \n- Make sure your sheet has at least: `Email`, `Contacted` (blank for new).\n\n### 2) Outlook (Microsoft Graph) OAuth2\n- **n8n Cloud (quick connect):**  \n  - In **Credentials \u2192 New \u2192 Microsoft Outlook OAuth2**, choose **Connect**, sign in with your Microsoft account, and accept permissions.\n- **Self-hosted (Azure App Registration):**  \n  1) Azure Portal \u2192 **App registrations** \u2192 **New registration**.  \n  2) Add redirect URL: `https://YOUR_N8N_URL/rest/oauth2-credential/callback`.  \n  3) **API permissions (Delegated):** `offline_access`, `Mail.Send`, `User.Read`. Grant admin consent if required.  \n  4) Create a **Client secret**; copy **Application (client) ID** and **Directory (tenant) ID**.  \n  5) In n8n, create **Microsoft Outlook OAuth2** credential with those values and scopes: `offline_access Mail.Send openid email profile`.  \n- In the **Send a message** node, select that credential and keep `To` mapped to `{{$json.Email}}`.  \n- Customize **Subject** and **Body** to your brand (default provided).\n\n---\n\n\n- \ud83d\udce7 **rbreen@ynteractive.com**  \n- \ud83d\udd17 **Robert Breen** \u2014 https://www.linkedin.com/in/robert-breen-29429625/  \n- \ud83c\udf10 **ynteractive.com** \u2014 https://ynteractive.com\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "79a41cd6-d72f-4cd5-81a2-3341a21ceeb8",
      "name": "Sticky Note70",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2144,
        8784
      ],
      "parameters": {
        "color": 3,
        "width": 224,
        "height": 656,
        "content": "### 1) Connect Google Sheets (OAuth2)\n1. In **n8n \u2192 Credentials \u2192 New \u2192 Google Sheets (OAuth2)**  \n2. Sign in with your Google account and grant access  \n3. In each Google Sheets node, select your **Spreadsheet** and the appropriate **Worksheet**:  \n\n\nhttps://docs.google.com/spreadsheets/d/1sXXVbl2kKdYTzCmZDe7QyeMp1N9wZg9K63oGK2UIaeU/edit#gid=0"
      },
      "typeVersion": 1
    },
    {
      "id": "49825745-adc3-4a5e-ba1c-0a65e31fd177",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -848,
        8608
      ],
      "parameters": {
        "color": 3,
        "height": 992,
        "content": "### 2) Outlook (Microsoft Graph) OAuth2\n- **n8n Cloud (quick connect):**  \n  - In **Credentials \u2192 New \u2192 Microsoft Outlook OAuth2**, choose **Connect**, sign in with your Microsoft account, and accept permissions.\n- **Self-hosted (Azure App Registration):**  \n  1) Azure Portal \u2192 **App registrations** \u2192 **New registration**.  \n  2) Add redirect URL: `https://YOUR_N8N_URL/rest/oauth2-credential/callback`.  \n  3) **API permissions (Delegated):** `offline_access`, `Mail.Send`, `User.Read`. Grant admin consent if required.  \n  4) Create a **Client secret**; copy **Application (client) ID** and **Directory (tenant) ID**.  \n  5) In n8n, create **Microsoft Outlook OAuth2** credential with those values and scopes: `offline_access Mail.Send openid email profile`.  \n- In the **Send a message** node, select that credential and keep `To` mapped to `{{$json.Email}}`.  \n- Customize **Subject** and **Body** to your brand (default provided).\n"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Filter1": {
      "main": [
        [
          {
            "node": "Append or update row in sheet1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet3": {
      "main": [
        [
          {
            "node": "Filter1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}