8
n8n 中文网amn8n.com

自动化库存管理

中级

这是一个Document Extraction领域的自动化工作流,包含 15 个节点。主要使用 Code, Airtable, SendInBlue, ScheduleTrigger 等节点。 使用Airtable采购单创建和供应商邮件自动管理库存

前置要求
  • Airtable API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "b6731f6e46273cffeac6b5188a5b3bcb0840c00108e73b48ae2b799ac6e8e081",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "fe401179-5a8b-4232-b148-9bf4d96ceb9b",
      "name": "获取低库存产品",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -2340,
        -540
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "apprZl1I4LgjwhSVf",
          "cachedResultUrl": "https://airtable.com/apprZl1I4LgjwhSVf",
          "cachedResultName": "Products Tables"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblLQxA3XuieqUIja",
          "cachedResultUrl": "https://airtable.com/apprZl1I4LgjwhSVf/tblLQxA3XuieqUIja",
          "cachedResultName": "Products Table"
        },
        "options": {},
        "operation": "search",
        "filterByFormula": "{stock_level} <= {reorder_threshold}"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "j2v4SdOKrSSYQlXT",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "46bfdc76-b244-41a9-a686-09c8eb140968",
      "name": "获取这些低库存产品的供应商详情",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -2120,
        -540
      ],
      "parameters": {
        "id": "={{ $json.supplier_id }}",
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "apprZl1I4LgjwhSVf",
          "cachedResultUrl": "https://airtable.com/apprZl1I4LgjwhSVf",
          "cachedResultName": "Products Tables"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tbl7LUCS0MYq0Fjq6",
          "cachedResultUrl": "https://airtable.com/apprZl1I4LgjwhSVf/tbl7LUCS0MYq0Fjq6",
          "cachedResultName": "Supplier"
        },
        "options": {}
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "j2v4SdOKrSSYQlXT",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "836a5efb-0cad-4508-8703-911241f0b847",
      "name": "计算动态再订购数量",
      "type": "n8n-nodes-base.code",
      "position": [
        -1900,
        -540
      ],
      "parameters": {
        "jsCode": "const safetyMargin = 1.2;\n// Process all input items\nconst outputItems = [];\nfor (const item of $input.all()) {\n  const avgDaily = item.json.average_daily_sales || 1;\n  const leadTime = item.json.lead_time_days || 7;\n  \n  // Updated logic: 2x lead time for better production inventory management\n  // First lead time: stock to last until delivery arrives\n  // Second lead time: buffer stock for next reorder cycle\n  const reorderQty = Math.ceil(avgDaily * (leadTime * 1.5) * safetyMargin);\n  \n  outputItems.push({\n    json: {\n      ...item.json,\n      reorder_qty: reorderQty\n    }\n  });\n}\nreturn outputItems;"
      },
      "typeVersion": 2
    },
    {
      "id": "7d04d71d-3d40-4575-b567-6e6bb8712e3a",
      "name": "每天午夜运行",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -2520,
        -540
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 0 * * *"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "50c4223b-83d7-4204-a2ad-75b390b9298b",
      "name": "在表格中创建采购记录",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -2160,
        -280
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "apprZl1I4LgjwhSVf",
          "cachedResultUrl": "https://airtable.com/apprZl1I4LgjwhSVf",
          "cachedResultName": "Products Tables"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tbloIflYm8aNOy10m",
          "cachedResultUrl": "https://airtable.com/apprZl1I4LgjwhSVf/tbloIflYm8aNOy10m",
          "cachedResultName": "Purchase Orders"
        },
        "columns": {
          "value": {
            "status": "Pending",
            "quantity": "={{ $json.reorder_qty }}",
            "product_id": "={{ $json.product_id }}",
            "supplier_id": "={{ $json.supplier_id }}",
            "Product Name": "={{ $json.product_name }}",
            "Supplier Email": "={{ $json.supplier_email }}"
          },
          "schema": [
            {
              "id": "po_number",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "po_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "quantity",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "quantity",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "supplier_id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "supplier_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Supplier Email",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Supplier Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "Pending",
                  "value": "Pending"
                },
                {
                  "name": "Sent",
                  "value": "Sent"
                },
                {
                  "name": "Delivered",
                  "value": "Delivered"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "date",
              "type": "dateTime",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "product_id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "product_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Product Name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Product Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "create"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "j2v4SdOKrSSYQlXT",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "87965ea3-6e2a-495d-a040-fcf15ba8bb2a",
      "name": "搜索记录",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -2500,
        -280
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "apprZl1I4LgjwhSVf",
          "cachedResultUrl": "https://airtable.com/apprZl1I4LgjwhSVf",
          "cachedResultName": "Products Tables"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tbloIflYm8aNOy10m",
          "cachedResultUrl": "https://airtable.com/apprZl1I4LgjwhSVf/tbloIflYm8aNOy10m",
          "cachedResultName": "Purchase Orders"
        },
        "options": {},
        "operation": "search",
        "filterByFormula": "=AND({product_id} = '{{ $('Get Products with low stock').item.json.product_id }}', OR({status} = 'Pending', {status} = 'Sent'))"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "j2v4SdOKrSSYQlXT",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1,
      "alwaysOutputData": true
    },
    {
      "id": "18390f14-6622-4f6c-8c24-ec123c4a807e",
      "name": "移除重复的产品订单",
      "type": "n8n-nodes-base.code",
      "position": [
        -2340,
        -280
      ],
      "parameters": {
        "jsCode": "// Step 1: Get all low stock products with complete data\nconst lowStockProducts = $('Get Products with low stock').all();\nconst allProductIds = lowStockProducts.map(p => p.json.product_id);\n\n// Step 2: Get calculated reorder quantities from the first code node\nconst reorderData = $('Calculate Dynamic Re-order Quantity').all();\n\n// Step 3: Get supplier details (this should have the actual supplier info)\nconst supplierDetails = $('Get supplier Details for those low stock products').all();\n\n// Step 4: Get existing purchase orders from input\nconst existingPOs = $input.all();\nconst existingProductIds = existingPOs.map(po => po.json.product_id);\n\n// Step 5: Filter out products that already have active POs\nconst newProductIds = allProductIds.filter(pid => !existingProductIds.includes(pid));\n\n// Step 6: Build complete result with all required fields\nconst result = newProductIds.map(productId => {\n  // Find the original product data\n  const originalProduct = lowStockProducts.find(p => p.json.product_id === productId);\n  \n  // Find the calculated reorder quantity and supplier info from the first code node\n  let reorderQty = 0;\n  let supplierId = '';\n  const reorderInfo = reorderData.find(r => r.json.product_id === productId);\n  if (reorderInfo) {\n    reorderQty = reorderInfo.json.reorder_qty;\n    supplierId = reorderInfo.json.supplier_id;\n  } else {\n    // Fallback: try to match by index if product_id isn't available in reorder data\n    const productIndex = lowStockProducts.findIndex(p => p.json.product_id === productId);\n    if (productIndex >= 0 && reorderData[productIndex]) {\n      reorderQty = reorderData[productIndex].json.reorder_qty;\n      supplierId = reorderData[productIndex].json.supplier_id;\n    }\n  }\n  \n  // For supplier details, we need to match by supplier_id from the reorder data\n  // The supplier_id might be an array (linked record) or a string\n  const supplierRecordId = Array.isArray(supplierId) ? supplierId[0] : supplierId;\n  \n  // Find supplier details by matching the record ID or by product_id\n  // Try multiple ways to match supplier data\n  const supplierData = supplierDetails.find(s => \n    s.json.id === supplierRecordId || \n    s.json.supplier_id === supplierRecordId ||\n    s.json.product_id === productId\n  );\n  \n  return {\n    json: {\n      product_id: productId,\n      product_name: originalProduct?.json?.product_name || '',\n      reorder_qty: reorderQty,\n      supplier_id: supplierRecordId || '',\n      supplier_email: supplierData?.json?.email || \n                     supplierData?.json?.supplier_email || \n                     supplierData?.json?.contact_email ||\n                     supplierData?.json?.Email || ''\n    }\n  };\n});\n\nreturn result;"
      },
      "typeVersion": 2
    },
    {
      "id": "cc7b13bc-d8f8-4c26-b503-5d9a8fcfd010",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2600,
        -980
      ],
      "parameters": {
        "width": 940,
        "height": 920,
        "content": "### 📦 **自动化采购订单创建 – n8n 工作流程**"
      },
      "typeVersion": 1
    },
    {
      "id": "790b9e2e-63fb-4d15-b0e9-47d1ab6dfdd2",
      "name": "定时触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1360,
        -520
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 1 * * *"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "93b3ea8a-5b0a-41b6-863c-1c78bc6ec59d",
      "name": "获取待处理的采购订单",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -1120,
        -520
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "apprZl1I4LgjwhSVf",
          "cachedResultUrl": "https://airtable.com/apprZl1I4LgjwhSVf",
          "cachedResultName": "Products Tables"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tbloIflYm8aNOy10m",
          "cachedResultUrl": "https://airtable.com/apprZl1I4LgjwhSVf/tbloIflYm8aNOy10m",
          "cachedResultName": "Purchase Orders"
        },
        "options": {},
        "operation": "search",
        "filterByFormula": "={status} = 'Pending'"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "j2v4SdOKrSSYQlXT",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "4ba6d12d-cbe6-418e-a9bb-102f54451b03",
      "name": "按供应商分组产品",
      "type": "n8n-nodes-base.code",
      "position": [
        -900,
        -520
      ],
      "parameters": {
        "jsCode": "// Group purchase orders by supplier\nconst groupedOrders = {};\n\nfor (const item of $input.all()) {\n  const supplierId = item.json.supplier_id;\n  const supplierEmail = item.json[\"Supplier Email\"];\n  const airtableRecordId = item.json.id; // capture Airtable record ID\n\n  if (!groupedOrders[supplierId]) {\n    groupedOrders[supplierId] = {\n      supplier_id: supplierId,\n      supplier_email: supplierEmail,\n      orders: [],\n      total_items: 0,\n      po_summary: [],\n      record_ids: [] // store PO record IDs to update later\n    };\n  }\n\n  const productName = item.json.product_name || item.json[\"Product Name\"] || item.json.product_id || \"Unknown Product\";\n\n  groupedOrders[supplierId].orders.push({\n    product_name: productName,\n    quantity: item.json.quantity,\n    product_id: item.json.product_id,\n    airtable_record_id: airtableRecordId\n  });\n\n  groupedOrders[supplierId].record_ids.push(airtableRecordId);\n  groupedOrders[supplierId].total_items += item.json.quantity;\n  groupedOrders[supplierId].po_summary.push(`${productName} (Qty: ${item.json.quantity})`);\n}\n\n// Helper function to create single-line HTML email body\nconst createHTMLBody = (supplier) => {\n  const tableRows = supplier.orders.map(order =>\n    `<tr><td style=\"padding:8px;border-bottom:1px solid #ddd;\">${order.product_name}</td><td style=\"padding:8px;border-bottom:1px solid #ddd;text-align:center;\">${order.product_id}</td><td style=\"padding:8px;border-bottom:1px solid #ddd;text-align:center;\">${order.quantity}</td></tr>`\n  ).join('');\n\n  return `<html><body style=\"font-family:Arial,sans-serif;line-height:1.6;color:#333;\"><div style=\"max-width:600px;margin:0 auto;padding:20px;\"><h2 style=\"color:#2c3e50;border-bottom:2px solid #3498db;padding-bottom:10px;\">Purchase Order Request</h2><p>Dear Supplier,</p><p>We hope this email finds you well. Please prepare the following items for delivery:</p><table style=\"width:100%;border-collapse:collapse;margin:20px 0;box-shadow:0 2px 4px rgba(0,0,0,0.1);\"><thead><tr style=\"background-color:#3498db;color:white;\"><th style=\"padding:12px;text-align:left;\">Product Name</th><th style=\"padding:12px;text-align:center;\">Product ID</th><th style=\"padding:12px;text-align:center;\">Quantity</th></tr></thead><tbody>${tableRows}</tbody></table><div style=\"background-color:#f8f9fa;padding:15px;border-radius:5px;margin:20px 0;\"><p style=\"margin:5px 0;\"><strong>📦 Total Products:</strong> ${supplier.orders.length}</p><p style=\"margin:5px 0;\"><strong>📊 Total Quantity:</strong> ${supplier.total_items}</p><p style=\"margin:5px 0;\"><strong>🏷️ Supplier ID:</strong> ${supplier.supplier_id}</p></div><p>Please confirm receipt of this order and provide an estimated delivery date.</p><p style=\"margin-top:30px;\">Thank you for your prompt attention to this order.<br><strong>Inventory Management Team</strong></p><hr style=\"border:none;border-top:1px solid #ddd;margin:30px 0;\"><p style=\"font-size:12px;color:#666;text-align:center;\">This is an automated message. Please do not reply to this email.</p></div></body></html>`;\n};\n\nreturn Object.values(groupedOrders).map(supplier => ({\n  json: {\n    supplier_id: supplier.supplier_id,\n    supplier_email: supplier.supplier_email,\n    total_products: supplier.orders.length,\n    total_quantity: supplier.total_items,\n    order_details: supplier.orders,\n    po_summary: supplier.po_summary,\n    record_ids: supplier.record_ids, // include record IDs for updating status later\n    email_subject: `🛒 Purchase Order - ${supplier.orders.length} Product${supplier.orders.length > 1 ? 's' : ''} (${supplier.total_items} items) - ${supplier.supplier_id}`,\n    email_body_html: createHTMLBody(supplier),\n    email_body_text: `Dear Supplier,\\n\\nPlease prepare the following items:\\n\\n${supplier.po_summary.join('\\n')}\\n\\nTotal Products: ${supplier.orders.length}\\nTotal Items: ${supplier.total_items}\\nSupplier ID: ${supplier.supplier_id}\\n\\nThank you!\\n\\nInventory Management Team`\n  }\n}));\n"
      },
      "typeVersion": 2
    },
    {
      "id": "ce853473-aa77-4215-a7e2-4b584f6b5986",
      "name": "获取采购订单的记录 ID",
      "type": "n8n-nodes-base.code",
      "position": [
        -720,
        -400
      ],
      "parameters": {
        "jsCode": "const items = $input.all();\nconst updates = [];\n\nfor (const item of items) {\n  const recordIds = item.json.record_ids || [];\n  for (const id of recordIds) {\n    updates.push({\n      json: {\n        id,\n        status: 'Sent'\n      }\n    });\n  }\n}\n\nreturn updates;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "275e3674-127b-4acf-92cd-c554b61239f9",
      "name": "将采购订单状态更新为已发送",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -500,
        -540
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "apprZl1I4LgjwhSVf",
          "cachedResultUrl": "https://airtable.com/apprZl1I4LgjwhSVf",
          "cachedResultName": "Products Tables"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tbloIflYm8aNOy10m",
          "cachedResultUrl": "https://airtable.com/apprZl1I4LgjwhSVf/tbloIflYm8aNOy10m",
          "cachedResultName": "Purchase Orders"
        },
        "columns": {
          "value": {
            "id": "={{ $json.id }}",
            "status": "Sent"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "po_number",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "po_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "quantity",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "quantity",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "supplier_id",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "supplier_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Supplier Email",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Supplier Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "Pending",
                  "value": "Pending"
                },
                {
                  "name": "Sent",
                  "value": "Sent"
                },
                {
                  "name": "Delivered",
                  "value": "Delivered"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "date",
              "type": "dateTime",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "product_id",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "product_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Product Name",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Product Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "upsert"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "j2v4SdOKrSSYQlXT",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "fd03a9df-1892-465b-9dc5-6c13cb2c1f16",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1420,
        -980
      ],
      "parameters": {
        "width": 1140,
        "height": 920,
        "content": "## 📦 n8n 自动化:每日采购订单邮件与状态同步"
      },
      "typeVersion": 1
    },
    {
      "id": "e725f7f0-85a1-4cec-af79-fee429ff2667",
      "name": "通过邮件向供应商发送采购订单",
      "type": "n8n-nodes-base.sendInBlue",
      "position": [
        -700,
        -700
      ],
      "parameters": {
        "sender": "abhiram.bvb@gmail.com",
        "subject": "={{ $json.email_subject }}",
        "sendHTML": true,
        "htmlContent": "={{ $json.email_body_html }}",
        "receipients": "={{ $json.supplier_email }}",
        "requestOptions": {},
        "additionalFields": {}
      },
      "credentials": {
        "sendInBlueApi": {
          "id": "ysEmyjdU0adBBOqN",
          "name": "Brevo account"
        }
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Search records": {
      "main": [
        [
          {
            "node": "Remove Duplicate Product Orders",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get Purchase Orders which are pending",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Every Mid Night": {
      "main": [
        [
          {
            "node": "Get Products with low stock",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get the record id's of PO": {
      "main": [
        [
          {
            "node": "Update the PO status to sent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Products with low stock": {
      "main": [
        [
          {
            "node": "Get supplier Details for those low stock products",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Group products with suppliers": {
      "main": [
        [
          {
            "node": "Send PO to suppliers via Email",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get the record id's of PO",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send PO to suppliers via Email": {
      "main": [
        []
      ]
    },
    "Remove Duplicate Product Orders": {
      "main": [
        [
          {
            "node": "Create purchase records in table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create purchase records in table": {
      "main": [
        []
      ]
    },
    "Calculate Dynamic Re-order Quantity": {
      "main": [
        [
          {
            "node": "Search records",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Purchase Orders which are pending": {
      "main": [
        [
          {
            "node": "Group products with suppliers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get supplier Details for those low stock products": {
      "main": [
        [
          {
            "node": "Calculate Dynamic Re-order Quantity",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - 文档提取

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量15
分类1
节点类型5
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

外部链接
在 n8n.io 查看

分享此工作流