N
n8n Store
Workflow Market
Stock

Stock

by vinci-king-010 views

描述

分类

🤖 AI & Machine Learning

使用的节点

n8n-nodes-base.coden8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.googleSheetsn8n-nodes-base.scheduleTriggern8n-nodes-scrapegraphai.scrapegraphAi
价格免费
浏览量0
最后更新11/28/2025
workflow.json
{
  "id": "lWag7Am9yiDM5TBX",
  "meta": {
    "instanceId": "521567c5f495f323b77849c4cfd0c9f4f2396c986e324e0e66c8425b6f124744",
    "templateCredsSetupCompleted": true
  },
  "name": "Stock",
  "tags": [],
  "nodes": [
    {
      "id": "2c187503-6fb2-4b8b-92fe-f8e997fd5559",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        700,
        820
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ce790220-6486-4528-a831-73443107a7a3",
      "name": "Yahoo Finance Stock Scraper",
      "type": "n8n-nodes-scrapegraphai.scrapegraphAi",
      "position": [
        1380,
        820
      ],
      "parameters": {
        "userPrompt": "Extract stock information from this site. Use the following schema for response { \"symbol\": \"AAPL\", \"current_price\": \"225.50\", \"change\": \"+2.15\", \"change_percent\": \"+0.96%\", \"volume\": \"45,234,567\", \"market_cap\": \"3.45T\" }",
        "websiteUrl": "https://finance.yahoo.com/quote/AAPL/?guccounter=1&guce_referrer=aHR0cHM6Ly93d3cuZ29vZ2xlLmNvbS8&guce_referrer_sig=AQAAADlzEES8CFmJu3LRxJ6p_ijSmVjZEqDA4mfHDia0ZnrdOQqWXJUq9HOUOdpdYRtmkBJNKkXaTV-UDVrDBsX3dbuzVHZ8QjT3-SNtJoccm85QZnKr9glOhEnn2RhgyDej8HZIGoeIQlJa2kjZrLwsU8zPw80Mtfgor3i9_6BrlQqg"
      },
      "credentials": {
        "scrapegraphAIApi": {
          "id": "",
          "name": ""
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ae4d95c5-f352-415c-a65e-01dcd4290c61",
      "name": "Google Sheets Stock Logger",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2980,
        820
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "symbol",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "symbol",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "current_price",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "current_price",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "change",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "change",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "change_percent",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "change_percent",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "volume",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "volume",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "market_cap",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "market_cap",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": []
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": ""
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "",
          "name": ""
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "223ba5e6-4bff-4a36-ba66-491002cacdbc",
      "name": "Stock Data Formatter",
      "type": "n8n-nodes-base.code",
      "notes": "Hey this is where \nyou \nformat results ",
      "position": [
        2140,
        820
      ],
      "parameters": {
        "jsCode": "// Get the input data\nconst inputData = $input.all()[0].json;\n\n// Check if it's a single stock or multiple stocks\nif (inputData.result && inputData.result.stocks) {\n  // Multiple stocks format\n  const stocks = inputData.result.stocks;\n  return stocks.map(stock => ({\n    json: {\n      symbol: stock.symbol,\n      current_price: stock.current_price,\n      change: stock.change,\n      change_percent: stock.change_percent,\n      volume: stock.volume,\n      market_cap: stock.market_cap\n    }\n  }));\n} else if (inputData.result) {\n  // Single stock format - return as single item\n  return [{\n    json: {\n      symbol: inputData.result.symbol,\n      current_price: inputData.result.current_price,\n      change: inputData.result.change,\n      change_percent: inputData.result.change_percent,\n      volume: inputData.result.volume,\n      market_cap: inputData.result.market_cap\n    }\n  }];\n}"
      },
      "notesInFlow": true,
      "typeVersion": 2
    },
    {
      "id": "575fba6b-dcc4-47df-8a4c-ab75d7a6a6ee",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1180,
        460
      ],
      "parameters": {
        "color": 5,
        "width": 574.9363634768473,
        "height": 530.4701664623029,
        "content": "# Step 2: ScrapeGraphAI Node 🤖\n\nThis is the core node which will scrape the website that you want.\n\n## How to Use\n- Simply mention the website URL\n- Describe what you want to extract in natural language\n\n## Example\n- **Website**: `https://www.example.com`\n- **Instruction**: \"Extract all article titles and URLs from this news site\""
      },
      "typeVersion": 1
    },
    {
      "id": "d8a8b5f8-653f-4a84-8953-de8ff9e37aa1",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1920,
        460
      ],
      "parameters": {
        "color": 5,
        "width": 574.9363634768473,
        "height": 530.4701664623029,
        "content": "# Step 3: Format the response 🧱\n\nThis node will format the results for sheets.\n\n## What it does\n- Prepares data for Google Sheets compatibility\n- Each article becomes a separate row in sheets\n- Maintains all important metadata\n- Easy to filter and analyze data"
      },
      "typeVersion": 1
    },
    {
      "id": "2e906fc8-8057-4cf2-8537-0d1f563a145c",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        460,
        460
      ],
      "parameters": {
        "color": 5,
        "width": 574.9363634768473,
        "height": 530.4701664623029,
        "content": "# Step 1: Trigger ⏱️\n\nThis trigger will invoke the workflow on the mentioned time.\n\n## Configuration Options\n- You can mention your custom time for trigger\n- Or even choose a different trigger"
      },
      "typeVersion": 1
    },
    {
      "id": "6a84d8fc-74a5-43a0-ad28-ef1690236e0e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2680,
        460
      ],
      "parameters": {
        "color": 5,
        "width": 574.9363634768473,
        "height": 530.4701664623029,
        "content": "# Step 4: Google Sheets 📊\n\nThis node will save the formatted data to your Google Sheets.\n\n## What it does\n- Connects to your Google Sheets account\n- Appends new rows with scraped article data\n- Maintains data history and tracking\n\n## Configuration\n- Select your target spreadsheet\n- Map fields from the formatted data\n- Set operation to \"Append\" for new rows\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "6dee100e-de50-4d89-b5b1-6263ec38366f",
  "connections": {
    "Code": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ScrapegraphAI": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "ScrapegraphAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

相关工作流