{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "eaf2563f-41a2-457a-8ad7-760b48b95489",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -848,
        288
      ],
      "parameters": {
        "url": "https://nfs.faireconomy.media/ff_calendar_thisweek.ics",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "16c889a9-2cb8-45d8-a136-eedbe0e9e8d0",
      "name": "Extract from File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -624,
        288
      ],
      "parameters": {
        "options": {},
        "operation": "fromIcs"
      },
      "typeVersion": 1
    },
    {
      "id": "2719cacf-8641-42b0-b1c8-50ae37fa41c4",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -400,
        288
      ],
      "parameters": {
        "include": "allOtherFields",
        "options": {},
        "fieldToSplitOut": "data.events"
      },
      "typeVersion": 1
    },
    {
      "id": "cfcb06d7-23a3-40eb-bcd8-e810255aece4",
      "name": "High Impact",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        48,
        96
      ],
      "parameters": {
        "end": "={{ $json['data.events'].end.date }}",
        "start": "={{ $json['data.events'].start.date }}",
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": " ",
          "cachedResultName": " "
        },
        "remindersUi": {
          "remindersValues": [
            {
              "method": "popup",
              "minutes": 30
            }
          ]
        },
        "additionalFields": {
          "summary": "={{ $json['data.events'].summary }}",
          "description": "={{ $json['data.events'].description }}"
        },
        "useDefaultReminders": false
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "0f501aa6-6d40-49b3-903f-c5acf7b6423e",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        -176,
        272
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "HIgh",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "79ddf6a3-4f9c-4978-b34f-5113e98b47b8",
                    "operator": {
                      "type": "string",
                      "operation": "contains"
                    },
                    "leftValue": "={{ $json['data.events'].description }}",
                    "rightValue": "High"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Medium",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "bba3fcc5-e494-496d-a840-3a6d5b693640",
                    "operator": {
                      "type": "string",
                      "operation": "contains"
                    },
                    "leftValue": "={{ $json['data.events'].description }}",
                    "rightValue": "Medium"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Low",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "fca7f801-ab1e-4ef5-946c-92835adce08f",
                    "operator": {
                      "type": "string",
                      "operation": "contains"
                    },
                    "leftValue": "={{ $json['data.events'].description }}",
                    "rightValue": "Low"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "f4009c16-66f3-4179-a39e-0fb1f45a4249",
      "name": "Medium Impact",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        48,
        288
      ],
      "parameters": {
        "end": "={{ $json['data.events'].end.date }}",
        "start": "={{ $json['data.events'].start.date }}",
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": " ",
          "cachedResultName": " "
        },
        "additionalFields": {
          "summary": "={{ $json['data.events'].summary }}",
          "description": "={{ $json['data.events'].description }}"
        },
        "useDefaultReminders": false
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "559811d1-a009-4f7e-86a5-4d0041487c56",
      "name": "Sunday 6 PM",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1072,
        480
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "triggerAtHour": 18
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "b698f665-d6d0-4db9-879e-af35de2b4e1a",
      "name": "If ForexFactory.com event",
      "type": "n8n-nodes-base.if",
      "position": [
        -176,
        624
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "e29bef4d-6889-4593-80a2-b063ee157730",
              "operator": {
                "type": "string",
                "operation": "contains"
              },
              "leftValue": "={{ $json.description }}",
              "rightValue": "forexfactory.com"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "6fe66cd3-059e-4df3-bbd0-1c7d8b9da58a",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        48,
        480
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "c9ae89bd-8b6a-43a7-9a7c-5ba44e9365a5",
      "name": "Delete an event",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        48,
        672
      ],
      "parameters": {
        "eventId": "={{ $json.id }}",
        "options": {},
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": " ",
          "cachedResultName": " "
        },
        "operation": "delete"
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "7168fabc-32de-4b25-a2b2-ae0c07881d12",
      "name": "Get All Event 10 Days Before",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        -400,
        624
      ],
      "parameters": {
        "options": {},
        "timeMax": "={{ $now }}",
        "timeMin": "={{ $now.minus(10, 'days') }}",
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": " ",
          "cachedResultName": " "
        },
        "operation": "getAll",
        "returnAll": true
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    }
  ],
  "connections": {
    "Switch": {
      "main": [
        [
          {
            "node": "High Impact",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Medium Impact",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sunday 6 PM": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get All Event 10 Days Before",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If ForexFactory.com event": {
      "main": [
        [
          {
            "node": "Delete an event",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get All Event 10 Days Before": {
      "main": [
        [
          {
            "node": "If ForexFactory.com event",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}