{
  "name": "01 Quote follow-up after 7 days (with approval)",
  "nodes": [
    {
      "id": "a4f463cc-6ae8-49d2-8b26-04b1573a768f",
      "name": "Weekdays 9:00",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        300
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 9 * * 1-5"
            }
          ]
        }
      }
    },
    {
      "id": "f8e7a1a1-d7ac-4ea9-af7c-54d4bb5b66c7",
      "name": "Sent quotes",
      "type": "n8n-nodes-base.dataTable",
      "typeVersion": 1,
      "position": [
        240,
        300
      ],
      "parameters": {
        "resource": "row",
        "operation": "get",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultName": "quotes"
        },
        "matchType": "allConditions",
        "filters": {
          "conditions": [
            {
              "keyName": "status",
              "condition": "eq",
              "keyValue": "sent"
            }
          ]
        },
        "returnAll": true
      },
      "alwaysOutputData": false
    },
    {
      "id": "edb09ae7-0106-49f6-9c59-aaef1e4c8d38",
      "name": "Older than 7 days, not yet reminded",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        480,
        300
      ],
      "parameters": {
        "jsCode": "const cutoff = Date.now() - 7*24*3600*1000;\nreturn $input.all().filter(i => !i.json.reminded_at && new Date(i.json.sent_at).getTime() < cutoff);"
      }
    },
    {
      "id": "6a16df72-e9ab-40be-900f-b6d34c98f241",
      "name": "Ask owner for approval",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        720,
        300
      ],
      "parameters": {
        "operation": "sendAndWait",
        "fromEmail": "info@example.com",
        "toEmail": "you@example.com",
        "subject": "=Send a reminder to {{ $json.client }}?",
        "message": "=The quote '{{ $json.description }}' (${{ $json.amount }}) to {{ $json.client }} has been open for more than 7 days.\n\nThis email goes to {{ $json.client_email }} when you click Send:\n\nHi {{ $json.client }},\n\nLast week we sent you our quote for {{ $json.description }}. Do you have any questions, or shall we set up a time to go through it?\n\nBest regards",
        "responseType": "approval",
        "approvalOptions": {
          "values": {
            "approvalType": "single",
            "approveLabel": "Send"
          }
        },
        "options": {
          "appendAttribution": false,
          "limitWaitTime": {
            "values": {
              "limitType": "afterTimeInterval",
              "resumeAmount": 2,
              "resumeUnit": "days"
            }
          }
        }
      },
      "notes": "A human signs off: nothing reaches the client without a click",
      "notesInFlow": true,
      "webhookId": "dd29d95d-dc7d-5447-9e0c-d1ef1fac78b5"
    },
    {
      "id": "a88f614d-7126-4b2f-9d2a-e62066bfa23d",
      "name": "Approved?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        960,
        300
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose",
            "version": 2
          },
          "conditions": [
            {
              "id": "a1",
              "leftValue": "={{ $json.data.approved }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "f6879108-1fd9-499b-a91e-bf3971cc93de",
      "name": "Reminder to client",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        1200,
        300
      ],
      "parameters": {
        "fromEmail": "info@example.com",
        "toEmail": "={{ $('Older than 7 days, not yet reminded').item.json.client_email }}",
        "subject": "=Our quote for {{ $('Older than 7 days, not yet reminded').item.json.description }}",
        "emailFormat": "text",
        "text": "=Hi {{ $('Older than 7 days, not yet reminded').item.json.client }},\n\nLast week we sent you our quote for {{ $('Older than 7 days, not yet reminded').item.json.description }}. Do you have any questions, or shall we set up a time to go through it?\n\nBest regards",
        "options": {
          "appendAttribution": false
        }
      }
    },
    {
      "id": "a14aa498-9fef-42ab-b020-447ce8198745",
      "name": "Save reminder date",
      "type": "n8n-nodes-base.dataTable",
      "typeVersion": 1,
      "position": [
        1440,
        300
      ],
      "parameters": {
        "resource": "row",
        "operation": "update",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultName": "quotes"
        },
        "matchType": "allConditions",
        "filters": {
          "conditions": [
            {
              "keyName": "id",
              "condition": "eq",
              "keyValue": "={{ $('Older than 7 days, not yet reminded').item.json.id }}"
            }
          ]
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "reminded_at": "={{ $now.toISO() }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "reminded_at",
              "displayName": "reminded_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "dateTime",
              "canBeUsedToMatch": true
            }
          ]
        },
        "options": {}
      }
    },
    {
      "id": "eb93574b-9277-487f-9640-78cb1fc6b8d5",
      "name": "Test manually",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        560
      ],
      "parameters": {}
    },
    {
      "id": "c32799a3-ca4e-4a12-9b41-4dde632297a0",
      "name": "Read me",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -40,
        -160
      ],
      "parameters": {
        "content": "## Quote follow-up with approval\nTested on November 11, 2026, with n8n 2.47.3.\n\n**Fill in:** an SMTP account in the three email nodes, your own address in 'Ask owner for approval', and the *quotes* table (columns: client, client_email, description, amount, status, sent_at, reminded_at).\n\n**Note:** n8n ignores clicks from link scanners. Click the button in the email yourself, in your browser.",
        "height": 220,
        "width": 520,
        "color": 7
      }
    }
  ],
  "connections": {
    "Weekdays 9:00": {
      "main": [
        [
          {
            "node": "Sent quotes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sent quotes": {
      "main": [
        [
          {
            "node": "Older than 7 days, not yet reminded",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Older than 7 days, not yet reminded": {
      "main": [
        [
          {
            "node": "Ask owner for approval",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ask owner for approval": {
      "main": [
        [
          {
            "node": "Approved?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Approved?": {
      "main": [
        [
          {
            "node": "Reminder to client",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reminder to client": {
      "main": [
        [
          {
            "node": "Save reminder date",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Test manually": {
      "main": [
        [
          {
            "node": "Sent quotes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  }
}