{
  "id": "KvtiflL8appirMde",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "\ud83d\udcc8 Crypto Price Alert",
  "tags": [],
  "nodes": [
    {
      "id": "33a95d3d-6ed1-4930-aad4-9332ffdca917",
      "name": "CoinGecko",
      "type": "n8n-nodes-base.coinGecko",
      "position": [
        -40,
        -60
      ],
      "parameters": {
        "options": {
          "ids": "bitcoin"
        },
        "operation": "market",
        "baseCurrency": "usd"
      },
      "typeVersion": 1
    },
    {
      "id": "273ef562-bc09-41f1-86d4-105b98ff5752",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -440,
        -200
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "32a3380a-1f73-476d-a5ae-60c8f2b74968",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -440,
        20
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "7ab0b8b0-55cb-44a7-8364-e258dc35878f",
      "name": "Set Low and High",
      "type": "n8n-nodes-base.set",
      "position": [
        180,
        -60
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "4f11efb0-2e18-46b9-a56c-e00e77f46981",
              "name": "high",
              "type": "number",
              "value": 100500
            },
            {
              "id": "f1660885-1fad-49cd-9039-a27391216826",
              "name": "low",
              "type": "number",
              "value": 100000
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "f473f8df-9f4b-4cba-940a-7c2fac36301f",
      "name": "Check movement",
      "type": "n8n-nodes-base.if",
      "position": [
        480,
        -60
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "c8869aa4-102c-4d87-bcbd-108b1c6ec2ba",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $('CoinGecko').item.json.current_price }}",
              "rightValue": "={{ $json.high }}"
            },
            {
              "id": "94f0ee9d-744c-4a19-889c-f8e85f5e4081",
              "operator": {
                "type": "number",
                "operation": "lt"
              },
              "leftValue": "={{ $('CoinGecko').item.json.current_price }}",
              "rightValue": "={{ $json.low }}"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "cd5bbd3e-9e4b-4270-91db-525656e63da2",
      "name": "Check Direction",
      "type": "n8n-nodes-base.if",
      "position": [
        740,
        -60
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "c8869aa4-102c-4d87-bcbd-108b1c6ec2ba",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $('CoinGecko').item.json.current_price }}",
              "rightValue": "={{ $json.high }}"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "deea1b59-20ec-462e-8721-c30c253d2774",
      "name": "Message High",
      "type": "n8n-nodes-base.discord",
      "position": [
        1260,
        -160
      ],
      "parameters": {
        "content": "=\ud83d\udcb9 {{ $json.name }} is now {{ $json.current_price }} ",
        "guildId": {
          "__rl": true,
          "mode": "id",
          "value": "[SELECT YOUR CHANEL]"
        },
        "options": {},
        "resource": "message",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "[SELECT YOUR CHANEL]"
        }
      },
      "credentials": {
        "discordBotApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "4724b211-3046-431d-875e-df88cfeb298a",
      "name": "Message Low",
      "type": "n8n-nodes-base.discord",
      "position": [
        1260,
        80
      ],
      "parameters": {
        "content": "=\u2757\u303d\ufe0f {{ $json.name }} is now {{ $json.current_price }} ",
        "guildId": {
          "__rl": true,
          "mode": "id",
          "value": "[SELECT YOUR CHANEL]"
        },
        "options": {},
        "resource": "message",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "[SELECT YOUR CHANEL]"
        }
      },
      "credentials": {
        "discordBotApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "5f95d096-759a-4563-abac-a4e7484ce6f9",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        -340
      ],
      "parameters": {
        "color": 4,
        "width": 360,
        "height": 520,
        "content": "# Triggers\nSet the trigger time\n\u2013 Run manually or on a schedule."
      },
      "typeVersion": 1
    },
    {
      "id": "f1cccde7-715e-420d-90a9-0e3a0941cc68",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -120,
        -340
      ],
      "parameters": {
        "color": 4,
        "width": 480,
        "height": 520,
        "content": "# Coin and Price Thresholds\nSelect a coin and define price limits\n\u2013 Fetch current price from CoinGecko\n\u2013 Set your custom low and high price thresholds.\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "c0bccb72-5d15-40b6-9fc3-743af1a767b9",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        440,
        -340
      ],
      "parameters": {
        "width": 480,
        "height": 520,
        "content": "# Logic\nCheck if price crosses defined thresholds\n\u2013 Compare the current price with your limits\n\u2013 Determine if the movement is above or below threshold.\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "ddf127e2-4432-4552-b685-03a44b61da76",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        960,
        -340
      ],
      "parameters": {
        "color": 6,
        "width": 580,
        "height": 580,
        "content": "# Send Alert on Discord\nNotify when price is too high or too low\n\u2013 Send a \u201cHigh\u201d alert if price is above threshold\n\u2013 Send a \u201cLow\u201d alert if price is below threshold.\n\nSet your connection and channel"
      },
      "typeVersion": 1
    },
    {
      "id": "76028425-c4df-4d52-945d-93140f700bbc",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1180,
        60
      ],
      "parameters": {
        "color": 3,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "727a423a-f836-4624-ac03-8c0eb94c9460",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1180,
        -180
      ],
      "parameters": {
        "color": 4,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "66a1ccf8-07d0-4244-8e81-ae6f912ea13a",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1600,
        -360
      ],
      "parameters": {
        "color": 7,
        "width": 580,
        "height": 620,
        "content": "# \ud83d\udcc8 Crypto Price Alert Workflow\n\nThis workflow monitors the price of a selected cryptocurrency using CoinGecko API and sends alerts to Discord when the price goes above or below your defined thresholds.\n\n## \u2705 How it works:\n1. **Trigger:** Runs on schedule or manually.\n2. **Fetch Price:** Uses CoinGecko to get the current price of your selected coin.\n3. **Set Limits:** You define the minimum and maximum price thresholds.\n4. **Logic Check:** Compares current price to thresholds.\n5. **Alert:** Sends a Discord message if the price is too high or too low.\n\n## \ud83d\udee0 Setup Instructions:\n- Edit the \"Set Low and High\" node to define your target coin and price limits.\n- Configure your Discord Webhook URLs in the \u201cMessage High\u201d and \u201cMessage Low\u201d nodes.\n- Optionally adjust the schedule trigger to run at your preferred interval.\n\nEnjoy automated crypto alerts \ud83d\ude80\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "8ffd26de-f76b-4eb9-8299-f7d5a3058f0a",
  "connections": {
    "CoinGecko": {
      "main": [
        [
          {
            "node": "Set Low and High",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check movement": {
      "main": [
        [
          {
            "node": "Check Direction",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Direction": {
      "main": [
        [
          {
            "node": "Message High",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Message Low",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "CoinGecko",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Low and High": {
      "main": [
        [
          {
            "node": "Check movement",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "CoinGecko",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}