{
  "name": "Send labeled email to a Notion database",
  "nodes": [
    {
      "id": "0bacf032-53d6-4ba6-ab71-e01625c49cc4",
      "name": "On schedule",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1960,
        160
      ]
    },
    {
      "id": "2e0d9aef-0a60-4506-9c11-c6c2cccb16ea",
      "name": "Derive last request time",
      "type": "n8n-nodes-base.dateTime",
      "position": [
        -1740,
        160
      ]
    },
    {
      "id": "f726c448-b4c4-4159-8ca5-c94c092127b7",
      "name": "Get emails from label and last request time",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -1520,
        160
      ]
    },
    {
      "id": "9b86331f-d33b-4266-ba34-bc0491a0da24",
      "name": "Create database page",
      "type": "n8n-nodes-base.notion",
      "position": [
        -620,
        60
      ]
    },
    {
      "id": "d7198578-4c83-4f57-8eba-5b5a9b89195c",
      "name": "Try get database page",
      "type": "n8n-nodes-base.notion",
      "position": [
        -1360,
        220
      ]
    },
    {
      "id": "f8188ab9-9a80-4aa9-b773-73cd90b8dbd3",
      "name": "If checked off",
      "type": "n8n-nodes-base.if",
      "position": [
        -1740,
        460
      ]
    },
    {
      "id": "bfcfeeb1-ad8b-47fb-8a09-b58e7b649a25",
      "name": "On updated database page",
      "type": "n8n-nodes-base.notionTrigger",
      "position": [
        -1960,
        460
      ]
    },
    {
      "id": "dc2c59b8-6e0d-46b3-946a-e48b0461c48f",
      "name": "Remove label from target email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -1520,
        460
      ]
    },
    {
      "id": "0f693c2f-ce89-4a2f-a85f-9230b7bcb94d",
      "name": "Not yet checked off, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -1520,
        660
      ]
    },
    {
      "id": "bf792470-fc0a-45a2-b655-df5c977faa97",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        -1220,
        100
      ]
    },
    {
      "id": "f910c34c-4c3d-481f-8223-a8aae710dbbd",
      "name": "If found, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -840,
        260
      ]
    },
    {
      "id": "7086cd15-9f2e-40e4-be3b-47d117dde670",
      "name": "If database page not found",
      "type": "n8n-nodes-base.if",
      "position": [
        -1060,
        160
      ]
    },
    {
      "id": "86ce380c-0810-4edb-94e4-fb67b0ca422c",
      "name": "Find my email address",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -840,
        60
      ]
    },
    {
      "id": "f576f785-49e4-4ed2-b83e-400b001b6c3a",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2540,
        100
      ],
      "parameters": {
        "width": 501.0810810810809,
        "height": 545.405405405404,
        "content": "## Send labeled email to a Notion database\nThis workflow sends the contents of an email to a Notion database. The email must be labeled with a specific label for the workflow to trigger. The email sub"
      }
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "If database page not found",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On schedule": {
      "main": [
        [
          {
            "node": "Derive last request time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If checked off": {
      "main": [
        [
          {
            "node": "Remove label from target email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Not yet checked off, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find my email address": {
      "main": [
        [
          {
            "node": "Create database page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Try get database page": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Derive last request time": {
      "main": [
        [
          {
            "node": "Get emails from label and last request time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On updated database page": {
      "main": [
        [
          {
            "node": "If checked off",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If database page not found": {
      "main": [
        [
          {
            "node": "Find my email address",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If found, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get emails from label and last request time": {
      "main": [
        [
          {
            "node": "Try get database page",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}