{
  "name": "Auto Review Request. A template by The Gridline Company",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "days",
              "daysInterval": 1,
              "triggerAtHour": 10
            }
          ]
        }
      },
      "id": "schedule-201",
      "name": "Daily Check at 10 AM",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [240, 300]
    },
    {
      "parameters": {
        "operation": "read",
        "documentId": {
          "__rl": true,
          "value": "REPLACE_WITH_YOUR_GOOGLE_SHEET_ID",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Sheet1",
          "mode": "list"
        },
        "options": {}
      },
      "id": "sheets-202",
      "name": "Read Project List",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.4,
      "position": [460, 300],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "REPLACE_WITH_YOUR_GOOGLE_SHEETS_CREDENTIAL_ID",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": false,
            "leftValue": "",
            "typeValidation": "loose"
          },
          "conditions": [
            {
              "id": "filter-status",
              "leftValue": "={{ $json.Status }}",
              "rightValue": "completed",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            },
            {
              "id": "filter-review-sent",
              "leftValue": "={{ $json['Review Requested'] }}",
              "rightValue": "no",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            },
            {
              "id": "filter-days-since",
              "leftValue": "={{ Math.floor(($now.toMillis() - new Date($json['Completed Date']).getTime()) / (1000 * 60 * 60 * 24)) }}",
              "rightValue": 7,
              "operator": {
                "type": "number",
                "operation": "gte"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "filter-203",
      "name": "Ready for Review Request?",
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.2,
      "position": [680, 300]
    },
    {
      "parameters": {
        "sendTo": "={{ $json['Client Email'] }}",
        "subject": "=Quick favor: would you mind leaving a review?",
        "emailType": "html",
        "message": "=<p>Hi {{ $json['Client Name'] }},</p>\n\n<p>Hope things are going well at {{ $json['Business Name'] }}! It was a pleasure working with you on {{ $json['Project Name'] }}.</p>\n\n<p>If you have a minute, would you be willing to leave a quick review? Honest reviews help small businesses like mine more than you'd think, and it would mean a lot.</p>\n\n<p><a href=\"REPLACE_WITH_YOUR_GOOGLE_REVIEW_LINK\" style=\"display: inline-block; padding: 10px 20px; background: #C45A3A; color: white; text-decoration: none; border-radius: 6px;\">Leave a quick review</a></p>\n\n<p>If anything wasn't perfect, please reply directly and let me know. I'd rather hear it from you than read it on Google.</p>\n\n<p>Thanks,<br>Adam</p>",
        "options": {}
      },
      "id": "gmail-204",
      "name": "Send Review Request",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [900, 300],
      "credentials": {
        "gmailOAuth2": {
          "id": "REPLACE_WITH_YOUR_GMAIL_CREDENTIAL_ID",
          "name": "Gmail account"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "REPLACE_WITH_YOUR_GOOGLE_SHEET_ID",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Sheet1",
          "mode": "list"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Project Name": "={{ $('Ready for Review Request?').item.json['Project Name'] }}",
            "Review Requested": "yes"
          },
          "matchingColumns": ["Project Name"]
        },
        "options": {}
      },
      "id": "sheets-205",
      "name": "Mark as Sent",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.4,
      "position": [1120, 300],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "REPLACE_WITH_YOUR_GOOGLE_SHEETS_CREDENTIAL_ID",
          "name": "Google Sheets account"
        }
      }
    }
  ],
  "connections": {
    "Daily Check at 10 AM": {
      "main": [
        [{ "node": "Read Project List", "type": "main", "index": 0 }]
      ]
    },
    "Read Project List": {
      "main": [
        [{ "node": "Ready for Review Request?", "type": "main", "index": 0 }]
      ]
    },
    "Ready for Review Request?": {
      "main": [
        [{ "node": "Send Review Request", "type": "main", "index": 0 }]
      ]
    },
    "Send Review Request": {
      "main": [
        [{ "node": "Mark as Sent", "type": "main", "index": 0 }]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "gridline-003",
  "meta": {
    "templateCredsSetupCompleted": false,
    "instanceId": "gridline-company-templates"
  },
  "tags": [
    { "name": "Gridline Company", "id": "gridline" },
    { "name": "Reviews", "id": "reviews" }
  ]
}
