8
n8n 中文网amn8n.com

使用RapidAPI和Google Sheets自动追踪免费Udemy课程

中级

这是一个Personal Productivity, Multimodal AI领域的自动化工作流,包含 13 个节点。主要使用 If, Code, EmailSend, HttpRequest, GoogleSheets 等节点。 使用RapidAPI和Google Sheets自动追踪免费Udemy课程

前置要求
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "60c025075753afcab9f803964b4caaca9402f435deb4efafbb8e3b93b54d8752",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "c0dd2da3-624a-4730-8711-dc495ed587d0",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5f323b68-04ad-4dd6-bdd9-58de3b01dbef",
      "name": "获取 Udemy 优惠券",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        208,
        0
      ],
      "parameters": {
        "url": "https://udemy-coupons-and-courses.p.rapidapi.com/featured.php",
        "method": "POST",
        "options": {
          "response": {
            "response": {
              "fullResponse": true
            }
          }
        },
        "sendBody": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "page",
              "value": "1"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "x-rapidapi-host",
              "value": "udemy-coupons-and-courses.p.rapidapi.com"
            },
            {
              "name": "x-rapidapi-key",
              "value": "your key"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "6c2dc08a-8ee6-4865-b29a-d43b25c5d303",
      "name": "检查 API 成功状态",
      "type": "n8n-nodes-base.if",
      "position": [
        448,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "f251122a-946f-4d41-a0fc-f5ecd3fa03f3",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.body.success }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "b6e4ffb5-a99a-452e-be88-371f97857a35",
      "name": "筛选免费课程",
      "type": "n8n-nodes-base.code",
      "position": [
        688,
        -16
      ],
      "parameters": {
        "jsCode": "const courses = $input.first().json.courses;\nconst freeCourses = courses.filter(course => course.sale_price === 0);\nreturn freeCourses;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "b9789ce1-8fe2-4e11-a22c-83d59b3e5c83",
      "name": "发送错误通知",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        688,
        336
      ],
      "webhookId": "ef72fbe3-7945-4511-982e-8b5da3fde9a3",
      "parameters": {
        "html": "=Hello,\n\nAn error occurred while trying to fetch Udemy coupons from the API.\n\nPlease check the API and the workflow to resolve the issue.\n",
        "options": {},
        "subject": "Udemy Coupons Fetch Error - Immediate Attention Required",
        "toEmail": "dev@test.com",
        "fromEmail": "itadmin@test.com"
      },
      "credentials": {
        "smtp": {
          "id": "nPwKPPgVavimTJX4",
          "name": "SMTP account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "b0cafa14-748d-4e5a-aa7c-5bbb6b32dbc3",
      "name": "同步课程到 Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        992,
        -16
      ],
      "parameters": {
        "columns": {
          "value": {
            "id": "={{ $json.id }}",
            "name": "={{ $json.name }}",
            "slug": "={{ $json.slug }}",
            "image": "={{ $json.image }}",
            "price": "={{ $json.price }}",
            "store": "={{ $json.store }}",
            "views": "={{ $json.views }}",
            "rating": "={{ $json.rating }}",
            "category": "={{ $json.category }}",
            "language": "={{ $json.language }}",
            "lectures": "={{ $json.lectures }}",
            "sale_price": "={{ $json.sale_price }}",
            "sale_start": "={{ $json.sale_start }}",
            "subcategory": "={{ $json.subcategory }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "id",
              "defaultMatch": true,
              "canBeUsedToMatch": true
            },
            {
              "id": "name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "image",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "image",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "price",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "price",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "sale_price",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "sale_price",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "lectures",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "lectures",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "views",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "views",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "rating",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "rating",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "language",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "language",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "category",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "category",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "subcategory",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "subcategory",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "slug",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "slug",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "store",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "store",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "sale_start",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "sale_start",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "",
          "cachedResultName": "Courses"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": ""
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "id": "Rt0RWApx8PL9t0RF",
          "name": "Google Docs account"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "4f577854-770c-46f2-b477-6f7c6a0cc522",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        -144
      ],
      "parameters": {
        "height": 304,
        "content": "### 定时触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "4813d9c9-db84-49a3-b037-d95f73d7869a",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        -144
      ],
      "parameters": {
        "height": 304,
        "content": "### 获取 Udemy 优惠券"
      },
      "typeVersion": 1
    },
    {
      "id": "139c1e96-3220-4e02-b736-f52dcb7614a3",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        416,
        -144
      ],
      "parameters": {
        "height": 304,
        "content": "### 检查 API 成功状态"
      },
      "typeVersion": 1
    },
    {
      "id": "ce832f7f-34c1-40fe-bdea-ef35e9904f0d",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        672,
        -144
      ],
      "parameters": {
        "height": 304,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "e9259da8-1aae-45b1-b5fb-40b369e99136",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        208
      ],
      "parameters": {
        "height": 272,
        "content": "### 发送错误通知"
      },
      "typeVersion": 1
    },
    {
      "id": "306c4dda-14aa-4bc8-8956-bcc2d950da37",
      "name": "便利贴5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        928,
        -144
      ],
      "parameters": {
        "height": 304,
        "content": "### 同步课程到 Google Sheets"
      },
      "typeVersion": 1
    },
    {
      "id": "4fd417e8-389d-43b3-98f8-cc1178c9c6a4",
      "name": "便签 6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -912,
        -288
      ],
      "parameters": {
        "width": 608,
        "height": 592,
        "content": "## 自动化 Udemy 优惠券获取与 Google Sheets 同步"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Fetch Udemy Coupons",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check API Success": {
      "main": [
        [
          {
            "node": "Filter Free Courses",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Error Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Udemy Coupons": {
      "main": [
        [
          {
            "node": "Check API Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Free Courses": {
      "main": [
        [
          {
            "node": "Sync Courses to Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 个人效率, 多模态 AI

需要付费吗?

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

工作流信息
难度等级
中级
节点数量13
分类2
节点类型7
难度说明

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

外部链接
在 n8n.io 查看

分享此工作流