{
  "name": "Automatic email unsubscribe handler: Outlook to BigQuery integration",
  "nodes": [
    {
      "id": "3282f715-dba9-4078-93fd-a168340d2274",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2280,
        2560
      ],
      "parameters": {
        "width": 1720,
        "height": 860,
        "content": ""
      }
    },
    {
      "id": "d9e29f8b-982b-4dcb-b4ab-e73d3fdf20aa",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2280,
        2420
      ],
      "parameters": {
        "width": 1720,
        "height": 120,
        "content": "## Email Unsubscribe Handler for Outlook \n\n** Feel free to contact me if you need help implementing (rbreen@ynteractive.com) **"
      }
    },
    {
      "id": "7b151f06-fbe0-4103-a8cd-acd441086ad0",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3100,
        2420
      ],
      "parameters": {
        "width": 780,
        "height": 1000,
        "content": "## How to Implement This n8n Workflow\n\nFollow these steps to configure and deploy the workflow:\n\n1. Connect Your Outlook Account\nIn n8n, go to Credentials > Microsoft Outlook OAuth2.\n\nLog in with the "
      }
    },
    {
      "id": "737b8659-c432-4541-be15-6875136ac804",
      "name": "Loop Over Items1",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -1100,
        2900
      ]
    },
    {
      "id": "e93b95e9-b476-4bc9-af5f-f606b2ec1efa",
      "name": "Summarize",
      "type": "n8n-nodes-base.summarize",
      "position": [
        -960,
        2640
      ]
    },
    {
      "id": "746f69f6-1180-4bbc-ada5-5e797ce75527",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        -1580,
        2600
      ]
    },
    {
      "id": "29eb258f-2c62-47a8-a79e-17f9c4b02818",
      "name": "Edit Fields1",
      "type": "n8n-nodes-base.set",
      "position": [
        -1580,
        2920
      ]
    },
    {
      "id": "6831435f-b8f2-4c09-8d89-e6fca412da83",
      "name": "Run Ever 4 Hours",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -2240,
        2920
      ]
    },
    {
      "id": "0d20cc6c-0a1e-4d1b-aee8-0700fcb8e164",
      "name": "Query Bigquery for all Unsubscribes",
      "type": "n8n-nodes-base.googleBigQuery",
      "position": [
        -1960,
        3020
      ]
    },
    {
      "id": "ad0f0314-caf8-48a6-9854-a537ab929515",
      "name": "Today & 7 Days Ago",
      "type": "n8n-nodes-base.code",
      "position": [
        -2020,
        2780
      ]
    },
    {
      "id": "633e7061-39f9-4b30-95e1-137eb7e9e9ec",
      "name": "Get Emails in Past 7 Days",
      "type": "n8n-nodes-base.microsoftOutlook",
      "position": [
        -1840,
        2620
      ]
    },
    {
      "id": "8af28462-0892-40c4-8cf5-09c1e1fe31d7",
      "name": "Filter for Unsubscribes",
      "type": "n8n-nodes-base.filter",
      "position": [
        -1700,
        2800
      ]
    },
    {
      "id": "0b2e4262-5718-4c6f-b1a4-6884e385e277",
      "name": "Keep Only New Unsubs",
      "type": "n8n-nodes-base.merge",
      "position": [
        -1400,
        2700
      ]
    },
    {
      "id": "8fc0c4ef-6e1b-4626-ae2f-2c6911a30970",
      "name": "Aggregate to email level",
      "type": "n8n-nodes-base.summarize",
      "position": [
        -1240,
        2580
      ]
    },
    {
      "id": "f79c5b11-a65d-4dd6-a07c-7910f03fb6d9",
      "name": "Add unsubscribes to Table",
      "type": "n8n-nodes-base.googleBigQuery",
      "position": [
        -800,
        3060
      ]
    }
  ],
  "connections": {
    "Summarize": {
      "main": [
        []
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Keep Only New Unsubs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "Keep Only New Unsubs",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Loop Over Items1": {
      "main": [
        [
          {
            "node": "Summarize",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add unsubscribes to Table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Ever 4 Hours": {
      "main": [
        [
          {
            "node": "Today & 7 Days Ago",
            "type": "main",
            "index": 0
          },
          {
            "node": "Query Bigquery for all Unsubscribes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Today & 7 Days Ago": {
      "main": [
        [
          {
            "node": "Get Emails in Past 7 Days",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep Only New Unsubs": {
      "main": [
        [
          {
            "node": "Aggregate to email level",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter for Unsubscribes": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate to email level": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add unsubscribes to Table": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Emails in Past 7 Days": {
      "main": [
        [
          {
            "node": "Filter for Unsubscribes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Query Bigquery for all Unsubscribes": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}