├── LICENSE └── n8n ├── README.MD ├── docker ├── build.basic.sh ├── build.sh ├── docker-compose.basic.yaml ├── docker-compose.yaml ├── env.template └── n8n_backup_restore.md ├── nginx └── n8n.conf └── series ├── MCP_Server_Demo.json ├── RSS新闻翻译->多维文档(飞书节点).json ├── RSS聚合流-多维表格.json ├── RSS聚合流.json ├── SubFlow_Web2RSS.json ├── SubFlow乘法.json ├── SubFlow加法.json ├── SubFlow翻译.json ├── WebAPI_Server_Demo.json ├── 日历查询.json ├── 社区MCP高德.json ├── 社区MCP高德手动.json └── 高德地图MCP.json /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 rv192 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /n8n/README.MD: -------------------------------------------------------------------------------- 1 | # N8N中文版部署指南 2 | 3 | 本文档详细说明如何使用Docker部署N8N中文版,并配置Nginx反向代理和PostgreSQL数据库。 4 | 5 | ## 环境要求 6 | 7 | - Docker 和 Docker Compose 8 | - Nginx 9 | - 域名,假设为n8n.yourdomain.com(已配置解析到服务器) 10 | 11 | ## 快速部署 12 | ### 1. 从Github下载代码 13 | ```bash 14 | git clone https://github.com/rv192/CommonRepo.git 15 | cd CommonRepo 16 | ``` 17 | 克隆完成后,你会看到以下目录结构: 18 | ``` 19 | n8n/ 20 | ├── docker/ # Docker相关配置文件 21 | │ ├── build.basic.sh 22 | │ ├── build.sh 23 | │ ├── docker-compose.yaml 24 | │ ├── docker-compose.basic.yaml 25 | │ └── env.template 26 | └── nginx/ # Nginx配置文件 27 | └── n8n.conf 28 | ``` 29 | 如果选择最简化安装,只需执行以下三行 30 | ```bash 31 | cd n8n/docker 32 | chmod +x build.basic.sh 33 | ./build.basic.sh 34 | ``` 35 | 完整安装Postgre以及HTTPS支持,需要多些几个步骤 36 | 37 | ### 2. 配置环境变量 38 | 2.1 复制环境变量模板: 39 | ```bash 40 | cd n8n/docker 41 | cp env.template .env 42 | nano .env 43 | ``` 44 | 45 | 2.2 修改环境变量(注意:必须先配置域名相关设置): 46 | ```env 47 | # 首先修改以下两项,确保使用HTTPS 48 | N8N_HOST=n8n.yourdomain.com # 替换为你的域名 49 | WEBHOOK_URL=https://n8n.yourdomain.com # 替换为你的域名,必须使用HTTPS 50 | 51 | # 其他配置项(一般不需要修改) 52 | POSTGRES_USER=root # PostgreSQL用户名 53 | POSTGRES_PASSWORD=n8n!yyds # PostgreSQL密码 54 | POSTGRES_DB=n8n # PostgreSQL数据库名 55 | N8N_DEFAULT_LOCALE=zh-CN # 中文界面的关键配置项 56 | 57 | N8N_ENCRYPTION_KEY= # 首次运行build.sh时自动生成 58 | N8N_USER_MANAGEMENT_JWT_SECRET= # 首次运行build.sh时自动生成 59 | ``` 60 | 61 | ### 3. 构建和启动服务 62 | 3.1 设置build.sh脚本权限并执行: 63 | ```bash 64 | chmod +x build.sh 65 | ./build.sh 66 | ``` 67 | 68 | 3.2 检查服务状态,此时应该能看到n8n暴露了5678端口: 69 | ```bash 70 | docker ps 71 | ``` 72 | 73 | ### 4. 配置Nginx 74 | 4.1 修改Nginx配置文件: 75 | 首先修改 nginx/n8n.conf 中的域名,找到Server_name,将 n8n.yourdomain.com 替换为你的实际域名。 76 | ```bash 77 | nano nginx/n8n.conf 78 | ``` 79 | 80 | 4.2 部署Nginx配置: 81 | ```bash 82 | # 复制配置文件到Nginx目录 83 | sudo cp nginx/n8n.conf /etc/nginx/sites-available/n8n.conf 84 | 85 | # 创建软链接启用配置 86 | sudo ln -s /etc/nginx/sites-available/n8n.conf /etc/nginx/sites-enabled/ 87 | 88 | # 验证Nginx配置 89 | sudo nginx -t 90 | 91 | # 如果配置正确,重启Nginx 92 | sudo systemctl restart nginx 93 | ``` 94 | 95 | ### 5. 配置HTTPS 96 | 5.1 安装certbot(如果未安装): 97 | ```bash 98 | sudo apt-get update 99 | sudo apt-get install certbot python3-certbot-nginx 100 | ``` 101 | 102 | 5.2 获取SSL证书: 103 | ```bash 104 | sudo certbot --nginx -d n8n.yourdomain.com 105 | ``` 106 | 107 | 5.3 确认Nginx配置: 108 | Certbot会自动修改Nginx配置,添加SSL相关配置。完成后的配置文件应该包含以下内容: 109 | ```nginx 110 | server { 111 | listen 443 ssl; 112 | server_name n8n.yourdomain.com; 113 | 114 | ssl_certificate /etc/letsencrypt/live/n8n.yourdomain.com/fullchain.pem; 115 | ssl_certificate_key /etc/letsencrypt/live/n8n.yourdomain.com/privkey.pem; 116 | 117 | location / { 118 | proxy_pass http://localhost:5678; 119 | proxy_http_version 1.1; 120 | proxy_set_header Upgrade $http_upgrade; 121 | proxy_set_header Connection "upgrade"; 122 | proxy_set_header Host $host; 123 | proxy_set_header X-Real-IP $remote_addr; 124 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 125 | proxy_set_header X-Forwarded-Proto $scheme; 126 | } 127 | } 128 | 129 | server { 130 | listen 80; 131 | server_name n8n.yourdomain.com; 132 | return 301 https://$server_name$request_uri; 133 | } 134 | ``` 135 | 136 | 5.4 验证配置并重启Nginx: 137 | ```bash 138 | sudo nginx -t && sudo systemctl restart nginx 139 | ``` 140 | 141 | ## 特性说明 142 | 143 | 1. **中文界面**:已默认配置中文界面,无需额外设置 144 | 2. **数据持久化**: 145 | - PostgreSQL数据存储在Docker卷中 146 | - 工作流和凭证会自动备份到backup目录 147 | 3. **自动导入**:系统会自动导入backup目录下的凭证和工作流 148 | 149 | ## 常见问题 150 | 151 | 1. **无法访问界面** 152 | - 检查Docker容器状态 153 | - 确认Nginx配置是否正确 154 | - 验证域名解析是否生效 155 | 156 | 2. **数据库连接失败** 157 | - 检查环境变量中的数据库配置 158 | - 确认PostgreSQL容器是否正常运行 159 | 160 | 3. **Webhook无法使用** 161 | - 确保WEBHOOK_URL配置正确 162 | - 检查域名SSL证书是否有效 163 | 164 | ## 安全建议 165 | 166 | 1. 建议配置SSL证书,启用HTTPS 167 | 2. 定期备份数据库和工作流 168 | 3. 使用强密码,定期更换加密密钥 169 | 170 | ## 备份凭证和工作流 171 | 172 | ```bash 173 | sudo docker compose exec n8n n8n export:workflow --all --output=/home/node/backup/workflows 174 | sudo docker compose exec n8n n8n export:credentials --all --output=/home/node/backup/credentials 175 | ``` 176 | -------------------------------------------------------------------------------- /n8n/docker/build.basic.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # ----- 自动下载并解压 editor-ui.tar.gz ----- 3 | 4 | # 设置 dist 目录 5 | DIST_DIR="./dist" 6 | 7 | # 确保 dist 目录存在 8 | mkdir -p "$DIST_DIR" 9 | 10 | # 如果 data 目录不存在则创建 11 | mkdir -p data 12 | # 确保Docker容器中具有正确的权限 13 | chown -R 1000:1000 ./data 14 | chmod -R 775 ./data 15 | 16 | # 获取下载 URL 17 | DOWNLOAD_URL=$(curl -s https://api.github.com/repos/other-blowsnow/n8n-i18n-chinese/releases/latest | jq -r '.assets[] | select(.name == "editor-ui.tar.gz") | .browser_download_url') 18 | 19 | # 检查是否成功获取 URL 20 | if [ -z "$DOWNLOAD_URL" ]; then 21 | echo "错误:无法获取 editor-ui.tar.gz 的下载 URL。请检查网络连接和 GitHub API 是否可用。" 22 | exit 1 23 | fi 24 | 25 | echo "下载 URL: $DOWNLOAD_URL" 26 | 27 | # 下载文件 28 | echo "正在下载 editor-ui.tar.gz..." 29 | 30 | # 使用代理下载 31 | wget -O editor-ui.tar.gz https://gh-proxy.com/"$DOWNLOAD_URL" 32 | 33 | # 检查下载是否成功 34 | if [ ! -f "editor-ui.tar.gz" ]; then 35 | echo "错误:下载 editor-ui.tar.gz 失败。请检查 URL 和网络连接。" 36 | exit 1 37 | fi 38 | 39 | echo "editor-ui.tar.gz 下载完成。" 40 | 41 | # 解压文件到 dist 目录 42 | echo "正在解压 editor-ui.tar.gz 到 $DIST_DIR..." 43 | tar -xzf editor-ui.tar.gz -C "$DIST_DIR" --strip-components 1 44 | 45 | # 检查解压是否成功 (简单检查,可以根据需要完善) 46 | # 检查 dist 目录下是否存在关键文件 (例如 index.html) 47 | if [ ! -f "$DIST_DIR/index.html" ]; then 48 | echo "错误:解压 editor-ui.tar.gz 失败。请检查文件是否损坏或解压路径是否正确。" 49 | exit 1 50 | fi 51 | 52 | echo "editor-ui.tar.gz 解压完成。" 53 | 54 | # 清理下载的压缩包 55 | rm -f editor-ui.tar.gz 56 | 57 | echo "已清理下载的压缩包 editor-ui.tar.gz" 58 | 59 | # ----- 自动下载并解压完成 ----- 60 | 61 | # 启动 Docker Compose 62 | docker compose -f docker-compose.basic.yaml up -d 63 | # 等待几秒让容器有时间启动 64 | sleep 5 65 | 66 | # 检查n8n容器是否成功运行 67 | if docker ps | grep -q "n8n.*Up.*5678"; then 68 | echo "n8n容器已成功启动" 69 | echo "使用 http://localhost:5678 访问" 70 | echo "使用docker compose -f docker-compose.basic.yaml down 停止" 71 | else 72 | echo "错误: n8n容器未能正常启动,请检查日志:" 73 | docker logs n8n 74 | exit 1 75 | fi 76 | 77 | -------------------------------------------------------------------------------- /n8n/docker/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 加载 .env 文件 4 | set -a 5 | source .env 6 | set +a 7 | 8 | # 检查 .env 文件是否存在 9 | if [ ! -f ".env" ]; then 10 | echo "错误:.env 文件不存在。请创建并配置 .env 文件。" 11 | exit 1 12 | fi 13 | 14 | # 检查 ENCRYPTION_KEY 和 N8N_USER_MANAGEMENT_JWT_SECRET 是否已设置 15 | if [ -z "$N8N_ENCRYPTION_KEY" ]; then 16 | echo "ENCRYPTION_KEY 未设置,正在生成随机值..." 17 | ENCRYPTION_KEY=$(openssl rand -hex 16) 18 | echo "ENCRYPTION_KEY=$ENCRYPTION_KEY" 19 | # 使用 sed 命令更新 .env 文件 20 | sed -i "s/^N8N_ENCRYPTION_KEY=.*/N8N_ENCRYPTION_KEY=$ENCRYPTION_KEY/" .env 21 | echo "ENCRYPTION_KEY 已自动添加到 .env 文件。" 22 | fi 23 | 24 | if [ -z "$N8N_USER_MANAGEMENT_JWT_SECRET" ]; then 25 | echo "N8N_USER_MANAGEMENT_JWT_SECRET 未设置,正在生成随机值..." 26 | JWT_SECRET=$(openssl rand -hex 16) 27 | echo "N8N_USER_MANAGEMENT_JWT_SECRET=$JWT_SECRET" 28 | # 使用 sed 命令更新 .env 文件 29 | sed -i "s/^N8N_USER_MANAGEMENT_JWT_SECRET=.*/N8N_USER_MANAGEMENT_JWT_SECRET=$JWT_SECRET/" .env 30 | echo "N8N_USER_MANAGEMENT_JWT_SECRET 已自动添加到 .env 文件。" 31 | fi 32 | 33 | # ----- 自动下载并解压 editor-ui.tar.gz ----- 34 | 35 | # 设置 dist 目录 36 | DIST_DIR="./dist" 37 | 38 | # 确保 dist 目录存在 39 | mkdir -p "$DIST_DIR" 40 | 41 | # 如果 backup 目录不存在则创建 42 | mkdir -p backup 43 | # 确保Docker容器中具有正确的权限 44 | chown -R 1000:1000 ./backup 45 | chmod -R 775 ./backup 46 | 47 | # 获取下载 URL 48 | DOWNLOAD_URL=$(curl -s https://api.github.com/repos/other-blowsnow/n8n-i18n-chinese/releases/latest | jq -r '.assets[] | select(.name == "editor-ui.tar.gz") | .browser_download_url') 49 | 50 | # 检查是否成功获取 URL 51 | if [ -z "$DOWNLOAD_URL" ]; then 52 | echo "错误:无法获取 editor-ui.tar.gz 的下载 URL。请检查网络连接和 GitHub API 是否可用。" 53 | exit 1 54 | fi 55 | 56 | echo "下载 URL: $DOWNLOAD_URL" 57 | 58 | # 下载文件 59 | echo "正在下载 editor-ui.tar.gz..." 60 | 61 | # 使用代理下载 62 | wget -O editor-ui.tar.gz https://gh-proxy.com/"$DOWNLOAD_URL" 63 | 64 | # 检查下载是否成功 65 | if [ ! -f "editor-ui.tar.gz" ]; then 66 | echo "错误:下载 editor-ui.tar.gz 失败。请检查 URL 和网络连接。" 67 | exit 1 68 | fi 69 | 70 | echo "editor-ui.tar.gz 下载完成。" 71 | 72 | # 解压文件到 dist 目录 73 | echo "正在解压 editor-ui.tar.gz 到 $DIST_DIR..." 74 | tar -xzf editor-ui.tar.gz -C "$DIST_DIR" --strip-components 1 75 | 76 | # 检查解压是否成功 (简单检查,可以根据需要完善) 77 | # 检查 dist 目录下是否存在关键文件 (例如 index.html) 78 | if [ ! -f "$DIST_DIR/index.html" ]; then 79 | echo "错误:解压 editor-ui.tar.gz 失败。请检查文件是否损坏或解压路径是否正确。" 80 | exit 1 81 | fi 82 | 83 | echo "editor-ui.tar.gz 解压完成。" 84 | 85 | # 清理下载的压缩包 86 | rm -f editor-ui.tar.gz 87 | 88 | echo "已清理下载的压缩包 editor-ui.tar.gz" 89 | 90 | # ----- 自动下载并解压完成 ----- 91 | 92 | # 启动 Docker Compose 93 | docker compose up -d -------------------------------------------------------------------------------- /n8n/docker/docker-compose.basic.yaml: -------------------------------------------------------------------------------- 1 | version: "3.9" 2 | 3 | services: 4 | n8n: 5 | container_name: n8n 6 | image: docker.m.daocloud.io/n8nio/n8n:latest 7 | restart: unless-stopped 8 | environment: 9 | # 设置中文区域和界面 10 | - GENERIC_TIMEZONE=Asia/Shanghai 11 | - TZ=Asia/Shanghai 12 | # 使用非HTTPS访问必须禁用cookie 13 | - N8N_SECURE_COOKIE=false 14 | # 设置默认语言为中文 15 | - N8N_DEFAULT_LOCALE=zh-CN 16 | ports: 17 | - 5678:5678 18 | volumes: 19 | # 挂载data目录指向n8n的工作目录,暴露SQLite文件 20 | - ./data:/home/node/.n8n 21 | # 汉化界面的关键挂载 22 | - ./dist:/usr/local/lib/node_modules/n8n/node_modules/n8n-editor-ui/dist # 挂载汉化 -------------------------------------------------------------------------------- /n8n/docker/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: "3.9" 2 | 3 | networks: 4 | selfn8n: 5 | 6 | x-n8n: &service-n8n 7 | image: docker.m.daocloud.io/n8nio/n8n:latest 8 | networks: ['selfn8n'] 9 | environment: 10 | # Postgre数据库相关配置,主要从.env读取 11 | - DB_TYPE=postgresdb 12 | - DB_POSTGRESDB_HOST=postgres 13 | - DB_POSTGRESDB_USER=${POSTGRES_USER} 14 | - DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD} 15 | 16 | # 非HTTPS访问必须禁用cookie 17 | - N8N_SECURE_COOKIE=false 18 | 19 | # 是否启用诊断和个性化推荐 20 | - N8N_DIAGNOSTICS_ENABLED=false 21 | - N8N_PERSONALIZATION_ENABLED=false 22 | 23 | # 是否在启动时重新安装缺失的包 24 | - N8N_REINSTALL_MISSING_PACKAGES=true 25 | 26 | # 是否允许Code节点使用内置模块 27 | #- NODE_FUNCTION_ALLOW_BUILTIN=* 28 | # 是否允许Code节点使用外部模块 29 | #- NODE_FUNCTION_ALLOW_EXTERNAL=* 30 | 31 | # (可选)安全性加密密钥 32 | - N8N_ENCRYPTION_KEY=${N8N_ENCRYPTION_KEY} 33 | - N8N_USER_MANAGEMENT_JWT_SECRET=${N8N_USER_MANAGEMENT_JWT_SECRET} 34 | 35 | # (重要)设置域名和回调地址 36 | - N8N_HOST=${N8N_HOST} 37 | - WEBHOOK_URL=${WEBHOOK_URL} 38 | 39 | # 设置中文区域和界面 40 | - GENERIC_TIMEZONE=Asia/Shanghai 41 | - TZ=Asia/Shanghai 42 | - N8N_DEFAULT_LOCALE=zh-CN 43 | 44 | services: 45 | # Postgre数据库 46 | postgres: 47 | image: docker.m.daocloud.io/postgres:16-alpine 48 | networks: ['selfn8n'] 49 | restart: unless-stopped 50 | environment: 51 | - POSTGRES_USER=${POSTGRES_USER} 52 | - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} 53 | - POSTGRES_DB=${POSTGRES_DB} 54 | volumes: 55 | # 挂载当前目录下的postgres-data指向数据库目录 56 | - ./postgres-data:/var/lib/postgresql/data 57 | healthcheck: 58 | test: ['CMD-SHELL', 'pg_isready -h localhost -U ${POSTGRES_USER} -d ${POSTGRES_DB}'] 59 | interval: 5s 60 | timeout: 5s 61 | retries: 10 62 | 63 | n8n-import: 64 | <<: *service-n8n 65 | container_name: n8n-import 66 | entrypoint: /bin/sh 67 | command: 68 | - "-c" 69 | # 如果备份文件存在,自动导入backup目录下的凭证和工作流 70 | # 区分是否是文件夹还是文件模式,优先导入文件夹,如果文件夹不存在,则导入文件;如果存在则只导入文件夹中的备份 71 | - | 72 | RESTORED=false # 初始化一个标志变量 73 | if [ -d /home/node/backup/credentials_folder ]; then 74 | n8n import:credentials --separate --input=/home/node/backup/credentials_folder 75 | RESTORED=true 76 | fi 77 | if [ -d /home/node/backup/workflows_folder ]; then 78 | n8n import:workflow --separate --input=/home/node/backup/workflows_folder 79 | RESTORED=true 80 | fi 81 | if [ "$RESTORED" = "false" ]; then 82 | if [ -f /home/node/backup/credentials ]; then 83 | n8n import:credentials --input=/home/node/backup/credentials 84 | fi 85 | if [ -f /home/node/backup/workflows ]; then 86 | n8n import:workflow --input=/home/node/backup/workflows 87 | fi 88 | fi 89 | 90 | volumes: 91 | # 挂载当前路径下的bakcup 92 | - ./backup:/home/node/backup/ 93 | depends_on: 94 | postgres: 95 | condition: service_healthy 96 | 97 | n8n: 98 | <<: *service-n8n 99 | container_name: n8n 100 | restart: unless-stopped 101 | ports: 102 | - 5678:5678 103 | volumes: 104 | - ./backup:/home/node/backup 105 | # 汉化界面的关键挂载 106 | - ./dist:/usr/local/lib/node_modules/n8n/node_modules/n8n-editor-ui/dist # 挂载汉化 107 | 108 | depends_on: 109 | postgres: 110 | condition: service_healthy 111 | n8n-import: 112 | condition: service_completed_successfully -------------------------------------------------------------------------------- /n8n/docker/env.template: -------------------------------------------------------------------------------- 1 | # 首先修改以下两项,确保使用HTTPS 2 | N8N_HOST=n8n.yourdomain.com # 替换为你的域名 3 | WEBHOOK_URL=https://n8n.yourdomain.com # 替换为你的域名,必须使用HTTPS 4 | 5 | # 其他配置项 6 | POSTGRES_USER=root # PostgreSQL用户名 7 | POSTGRES_PASSWORD=n8n!yyds # PostgreSQL密码 8 | POSTGRES_DB=n8n # PostgreSQL数据库名 9 | N8N_DEFAULT_LOCALE=zh-CN # 中文界面的关键配置项 10 | 11 | # 以下两项会由build.sh自动生成,无需手动设置(非生产环境可以屏蔽) 12 | N8N_ENCRYPTION_KEY= # 首次运行build.sh时自动生成,请记下来 13 | N8N_USER_MANAGEMENT_JWT_SECRET= # 首次运行build.sh时自动生成,请记下来 -------------------------------------------------------------------------------- /n8n/docker/n8n_backup_restore.md: -------------------------------------------------------------------------------- 1 | ##N8N工作流和凭证导入/导出 2 | 踩了个坑,所有工作流和凭证都丢了,于是认真研究了下文档并测试了下,需要注意的是,其实官方的文档也是有出入的:--decrypted参数已经无效了,不需要声明备份文件是否明文。 3 | 首先文档如下:https://docs.n8n.io/hosting/cli-commands/#export-workflows-and-credentials 4 | 5 | 最重要一点:**N8N_ENCRYPTION_KEY必须一致**,才能保证导出后能被正常导入(除非使用--backup以明文形式导出) 6 | 7 | 导出工作流/凭证,可以输出到单个文件,或者目录(目录内分多个文件) 8 | 因此导入,也需要区分是导入文件还是目录。而这里区分的核心参数是--separate 9 | 10 | ### 导出所有工作流和凭证到文件workflows和credentials 11 | ``` 12 | sudo docker compose exec n8n n8n export:workflow --all --output=/home/node/backup/workflows 13 | sudo docker compose exec n8n n8n export:credentials --all --output=/home/node/backup/credentials 14 | ``` 15 | 这种导入方式,恢复时会只能覆盖的方式进行 16 | ``` 17 | n8n import:credentials --input=/home/node/backup/credentials && n8n import:workflow --input=/home/node/backup/workflows 18 | ``` 19 | 20 | ### 导出所有工作流和凭证到文件夹workflows_folder和credentials_folder 21 | ``` 22 | sudo docker compose exec n8n n8n export:workflow --all --separate --output=/home/node/backup/workflows_folder 23 | sudo docker compose exec n8n n8n export:credentials --all --separate --output=/home/node/backup/credentials_folder 24 | ``` 25 | 这种方式恢复的时候,会以增量方式导入 26 | ``` 27 | n8n import:credentials --separate --input=/home/node/backup/credentials_folder && n8n import:workflow --separate --input=/home/node/backup/workflows_folder 28 | ``` 29 | 30 | ### 明文方式导出工作流和凭证到文件夹workflows_folder和credentials_folder 31 | ``` 32 | sudo docker compose exec n8n n8n export:workflow --backup --output=/home/node/backup/workflows_folder 33 | sudo docker compose exec n8n n8n export:credentials --backup --output=/home/node/backup/credentials_folder 34 | ``` 35 | 这种方式恢复时,会以增量方式导入,可以用于secret key不一样的实例之间迁移(--decrypted参数似乎已经不再支持) 36 | ``` 37 | n8n import:credentials --separate --input=/home/node/backup/credentials_folder && n8n import:workflow --separate --input=/home/node/backup/workflows_folder 38 | ``` -------------------------------------------------------------------------------- /n8n/nginx/n8n.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | server_name n8n.yourdomain.com; 4 | 5 | location / { 6 | proxy_pass http://localhost:5678; 7 | proxy_http_version 1.1; 8 | 9 | proxy_set_header Upgrade $http_upgrade; 10 | proxy_set_header Connection "upgrade"; 11 | proxy_set_header Host $host; 12 | proxy_set_header X-Real-IP $remote_addr; 13 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 14 | proxy_set_header X-Forwarded-Proto $scheme; 15 | 16 | # WebSocket specific settings 17 | proxy_read_timeout 86400; 18 | proxy_send_timeout 86400; 19 | 20 | chunked_transfer_encoding off; 21 | proxy_buffering off; 22 | proxy_cache off; 23 | } 24 | } -------------------------------------------------------------------------------- /n8n/series/MCP_Server_Demo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "MCP Server Demo", 3 | "nodes": [ 4 | { 5 | "parameters": { 6 | "path": "Labs" 7 | }, 8 | "type": "@n8n/n8n-nodes-langchain.mcpTrigger", 9 | "typeVersion": 1, 10 | "position": [ 11 | -1360, 12 | -280 13 | ], 14 | "id": "568bc0ad-7021-4cad-9b3e-a72c072b3b5a", 15 | "name": "MCP Server Trigger", 16 | "webhookId": "7770335d-0491-4c83-9d02-fe9c9abfd4c2" 17 | }, 18 | { 19 | "parameters": { 20 | "name": "Plus", 21 | "workflowId": { 22 | "__rl": true, 23 | "value": "7rc5OeZVf1NgP8Fd", 24 | "mode": "list", 25 | "cachedResultName": "SubFlow: 加法" 26 | }, 27 | "workflowInputs": { 28 | "mappingMode": "defineBelow", 29 | "value": { 30 | "num2": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('num2', ``, 'number') }}", 31 | "num1": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('num1', ``, 'number') }}" 32 | }, 33 | "matchingColumns": [], 34 | "schema": [ 35 | { 36 | "id": "num1", 37 | "displayName": "num1", 38 | "required": false, 39 | "defaultMatch": false, 40 | "display": true, 41 | "canBeUsedToMatch": true, 42 | "type": "number", 43 | "removed": false 44 | }, 45 | { 46 | "id": "num2", 47 | "displayName": "num2", 48 | "required": false, 49 | "defaultMatch": false, 50 | "display": true, 51 | "canBeUsedToMatch": true, 52 | "type": "number", 53 | "removed": false 54 | } 55 | ], 56 | "attemptToConvertTypes": false, 57 | "convertFieldsToString": false 58 | } 59 | }, 60 | "type": "@n8n/n8n-nodes-langchain.toolWorkflow", 61 | "typeVersion": 2.1, 62 | "position": [ 63 | -1340, 64 | -60 65 | ], 66 | "id": "85311bc4-9063-40f7-87c3-fe581726150b", 67 | "name": "SubFlow:加法" 68 | }, 69 | { 70 | "parameters": { 71 | "name": "Translate", 72 | "workflowId": { 73 | "__rl": true, 74 | "value": "E88FuwvJfSfnj5Pa", 75 | "mode": "list", 76 | "cachedResultName": "SubFlow: 翻译" 77 | }, 78 | "workflowInputs": { 79 | "mappingMode": "defineBelow", 80 | "value": { 81 | "content": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('content', ``, 'string') }}", 82 | "language": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('language', ``, 'string') }}" 83 | }, 84 | "matchingColumns": [], 85 | "schema": [ 86 | { 87 | "id": "content", 88 | "displayName": "content", 89 | "required": false, 90 | "defaultMatch": false, 91 | "display": true, 92 | "canBeUsedToMatch": true, 93 | "type": "string" 94 | }, 95 | { 96 | "id": "language", 97 | "displayName": "language", 98 | "required": false, 99 | "defaultMatch": false, 100 | "display": true, 101 | "canBeUsedToMatch": true, 102 | "type": "string" 103 | } 104 | ], 105 | "attemptToConvertTypes": false, 106 | "convertFieldsToString": false 107 | } 108 | }, 109 | "type": "@n8n/n8n-nodes-langchain.toolWorkflow", 110 | "typeVersion": 2.1, 111 | "position": [ 112 | -1180, 113 | -60 114 | ], 115 | "id": "516f13ad-1adf-40f2-88ce-b52dbe88b9dc", 116 | "name": "SubFlow:翻译" 117 | }, 118 | { 119 | "parameters": { 120 | "name": "Multiply", 121 | "workflowId": { 122 | "__rl": true, 123 | "value": "svnAhhdWf0VQFKEj", 124 | "mode": "list", 125 | "cachedResultName": "SubFlow: 乘法" 126 | }, 127 | "workflowInputs": { 128 | "mappingMode": "defineBelow", 129 | "value": { 130 | "num2": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('num2', ``, 'number') }}", 131 | "num1": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('num1', ``, 'number') }}" 132 | }, 133 | "matchingColumns": [], 134 | "schema": [ 135 | { 136 | "id": "num1", 137 | "displayName": "num1", 138 | "required": false, 139 | "defaultMatch": false, 140 | "display": true, 141 | "canBeUsedToMatch": true, 142 | "type": "number", 143 | "removed": false 144 | }, 145 | { 146 | "id": "num2", 147 | "displayName": "num2", 148 | "required": false, 149 | "defaultMatch": false, 150 | "display": true, 151 | "canBeUsedToMatch": true, 152 | "type": "number", 153 | "removed": false 154 | } 155 | ], 156 | "attemptToConvertTypes": false, 157 | "convertFieldsToString": false 158 | } 159 | }, 160 | "type": "@n8n/n8n-nodes-langchain.toolWorkflow", 161 | "typeVersion": 2.1, 162 | "position": [ 163 | -1020, 164 | -60 165 | ], 166 | "id": "9255168f-9dde-42a6-a9b3-8b5736afc497", 167 | "name": "SubFlow:乘法" 168 | } 169 | ], 170 | "pinData": {}, 171 | "connections": { 172 | "SubFlow:加法": { 173 | "ai_tool": [ 174 | [ 175 | { 176 | "node": "MCP Server Trigger", 177 | "type": "ai_tool", 178 | "index": 0 179 | } 180 | ] 181 | ] 182 | }, 183 | "SubFlow:翻译": { 184 | "ai_tool": [ 185 | [ 186 | { 187 | "node": "MCP Server Trigger", 188 | "type": "ai_tool", 189 | "index": 0 190 | } 191 | ] 192 | ] 193 | }, 194 | "SubFlow:乘法": { 195 | "ai_tool": [ 196 | [ 197 | { 198 | "node": "MCP Server Trigger", 199 | "type": "ai_tool", 200 | "index": 0 201 | } 202 | ] 203 | ] 204 | } 205 | }, 206 | "active": true, 207 | "settings": { 208 | "executionOrder": "v1" 209 | }, 210 | "versionId": "73361b1e-7906-40fa-8e80-9ab7f629ac58", 211 | "meta": { 212 | "instanceId": "6d3339a455de9042f2e878a695f7deb5f4532f35c5c36b32185be750c732f184" 213 | }, 214 | "id": "PvMhtqLdtFbmrqWH", 215 | "tags": [] 216 | } -------------------------------------------------------------------------------- /n8n/series/RSS新闻翻译->多维文档(飞书节点).json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "RSS新闻翻译->多维文档(飞书节点)", 3 | "nodes": [ 4 | { 5 | "parameters": { 6 | "model": "grok-2-1212", 7 | "options": {} 8 | }, 9 | "type": "@n8n/n8n-nodes-langchain.lmChatXAiGrok", 10 | "typeVersion": 1, 11 | "position": [ 12 | 660, 13 | -580 14 | ], 15 | "id": "73d15fcc-71f3-4eaa-b7d1-5f6723d1d005", 16 | "name": "xAI Grok Chat Model", 17 | "credentials": { 18 | "xAiApi": { 19 | "id": "cH0ILaofgvd2SGW1", 20 | "name": "xAi account" 21 | } 22 | } 23 | }, 24 | { 25 | "parameters": { 26 | "rule": { 27 | "interval": [ 28 | { 29 | "triggerAtHour": 8, 30 | "triggerAtMinute": 15 31 | } 32 | ] 33 | } 34 | }, 35 | "type": "n8n-nodes-base.scheduleTrigger", 36 | "typeVersion": 1.2, 37 | "position": [ 38 | 400, 39 | -1060 40 | ], 41 | "id": "26e07087-64d4-431d-92b7-c1a2851d6415", 42 | "name": "定时触发器" 43 | }, 44 | { 45 | "parameters": { 46 | "promptType": "define", 47 | "text": "={{ $json.title + $json.content }}", 48 | "messages": { 49 | "messageValues": [ 50 | { 51 | "message": "把英文翻译成中文,注意专业性和俚语翻译不要直译而是意译。只输出翻译结果,不要输出其他内容。输入的英文内容是标题+摘要,如果有必要可以整合下内容,使它更通顺不重复。" 52 | } 53 | ] 54 | } 55 | }, 56 | "type": "@n8n/n8n-nodes-langchain.chainLlm", 57 | "typeVersion": 1.6, 58 | "position": [ 59 | 660, 60 | -800 61 | ], 62 | "id": "14e91697-f4e2-4e8b-9e05-fb4f36e1db4b", 63 | "name": "大模型:翻译" 64 | }, 65 | { 66 | "parameters": { 67 | "maxItems": 10 68 | }, 69 | "type": "n8n-nodes-base.limit", 70 | "typeVersion": 1, 71 | "position": [ 72 | 440, 73 | -800 74 | ], 75 | "id": "9d5f7742-de4f-4d49-9853-b01545868c09", 76 | "name": "限制:最新10条" 77 | }, 78 | { 79 | "parameters": { 80 | "sortFieldsUi": { 81 | "sortField": [ 82 | { 83 | "fieldName": "isoDate", 84 | "order": "descending" 85 | } 86 | ] 87 | }, 88 | "options": {} 89 | }, 90 | "type": "n8n-nodes-base.sort", 91 | "typeVersion": 1, 92 | "position": [ 93 | 220, 94 | -800 95 | ], 96 | "id": "cb04dc07-4172-454b-9f5b-2b271269b541", 97 | "name": "排序:时间最新" 98 | }, 99 | { 100 | "parameters": {}, 101 | "type": "n8n-nodes-base.merge", 102 | "typeVersion": 3.1, 103 | "position": [ 104 | 840, 105 | -1060 106 | ], 107 | "id": "edeff1da-29a9-4ef8-8b02-03aba62ea882", 108 | "name": "合并" 109 | }, 110 | { 111 | "parameters": { 112 | "url": "https://rss.nytimes.com/services/xml/rss/nyt/World.xml", 113 | "options": {} 114 | }, 115 | "type": "n8n-nodes-base.rssFeedRead", 116 | "typeVersion": 1.1, 117 | "position": [ 118 | 620, 119 | -1220 120 | ], 121 | "id": "44add27b-972e-4adf-af7d-8acd683debff", 122 | "name": "拉取:纽约时报RSS" 123 | }, 124 | { 125 | "parameters": { 126 | "url": "https://feeds.bbci.co.uk/news/world/rss.xml", 127 | "options": {} 128 | }, 129 | "type": "n8n-nodes-base.rssFeedRead", 130 | "typeVersion": 1.1, 131 | "position": [ 132 | 620, 133 | -1020 134 | ], 135 | "id": "e1fceb1d-47c7-4d55-83c0-cf1060f0f1bf", 136 | "name": "拉取:BBC RSS" 137 | }, 138 | { 139 | "parameters": { 140 | "assignments": { 141 | "assignments": [ 142 | { 143 | "id": "ac26856a-0ead-4dba-94bc-4e2b5846266d", 144 | "name": "url", 145 | "value": "={{ $('限制:最新10条').item.json.link }}", 146 | "type": "string" 147 | }, 148 | { 149 | "id": "42ad93c3-3f45-4620-b5c3-b50b750ae86b", 150 | "name": "pubDate", 151 | "value": "={{ new Date($('限制:最新10条').item.json.pubDate).toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' }) }}", 152 | "type": "string" 153 | }, 154 | { 155 | "id": "f102d05a-34a8-4971-bc74-938656102068", 156 | "name": "content", 157 | "value": "={{ $json.text }}", 158 | "type": "string" 159 | } 160 | ] 161 | }, 162 | "options": {} 163 | }, 164 | "type": "n8n-nodes-base.set", 165 | "typeVersion": 3.4, 166 | "position": [ 167 | 1040, 168 | -800 169 | ], 170 | "id": "7197ee57-7bcb-42e3-b9c6-c0d101f8c22b", 171 | "name": "整理:表格数据" 172 | }, 173 | { 174 | "parameters": { 175 | "resource": "bitable", 176 | "operation": "bitable:table:record:add", 177 | "app_toke": "ZLQ1bK2YBa3HglspcuecxAHgnVg", 178 | "table_id": "tblaTsrOno6BwFEy", 179 | "body": "={\"fields\": {\"pubDate\": \"{{ $json.pubDate }}\", \"url\":\"{{ $json.url }}\", \"content\": \"{{ $json.content }}\"}}" 180 | }, 181 | "type": "n8n-nodes-feishu-lite.feishuNode", 182 | "typeVersion": 1, 183 | "position": [ 184 | 1480, 185 | -800 186 | ], 187 | "id": "8e231a80-c67f-401d-bf27-895fa06fd036", 188 | "name": "Feishu Node", 189 | "credentials": { 190 | "feishuCredentialsApi": { 191 | "id": "xXMbJlolIl6fcHfz", 192 | "name": "Feishu测试号" 193 | } 194 | } 195 | }, 196 | { 197 | "parameters": { 198 | "language": "python", 199 | "pythonCode": "import json\n\ndef escape_newlines(text):\n \"\"\"转义字符串中的换行符\"\"\"\n return text.replace('\\n', '\\\\n').replace('\\r', '\\\\r')\n\n# Loop over input items and add a new field called 'myNewField' to the JSON of each one\nfor item in _input.all():\n # 遍历JSON对象的所有键值对\n for key, value in item.json.items():\n # 如果值是字符串,则转义换行符\n if isinstance(value, str):\n item.json[key] = escape_newlines(value)\nreturn _input.all()\n" 200 | }, 201 | "type": "n8n-nodes-base.code", 202 | "typeVersion": 2, 203 | "position": [ 204 | 1260, 205 | -800 206 | ], 207 | "id": "370b2391-7bf3-4993-a94f-b80fa1daa3fd", 208 | "name": "Code" 209 | } 210 | ], 211 | "pinData": {}, 212 | "connections": { 213 | "xAI Grok Chat Model": { 214 | "ai_languageModel": [ 215 | [ 216 | { 217 | "node": "大模型:翻译", 218 | "type": "ai_languageModel", 219 | "index": 0 220 | } 221 | ] 222 | ] 223 | }, 224 | "定时触发器": { 225 | "main": [ 226 | [ 227 | { 228 | "node": "拉取:纽约时报RSS", 229 | "type": "main", 230 | "index": 0 231 | }, 232 | { 233 | "node": "拉取:BBC RSS", 234 | "type": "main", 235 | "index": 0 236 | } 237 | ] 238 | ] 239 | }, 240 | "大模型:翻译": { 241 | "main": [ 242 | [ 243 | { 244 | "node": "整理:表格数据", 245 | "type": "main", 246 | "index": 0 247 | } 248 | ] 249 | ] 250 | }, 251 | "限制:最新10条": { 252 | "main": [ 253 | [ 254 | { 255 | "node": "大模型:翻译", 256 | "type": "main", 257 | "index": 0 258 | } 259 | ] 260 | ] 261 | }, 262 | "排序:时间最新": { 263 | "main": [ 264 | [ 265 | { 266 | "node": "限制:最新10条", 267 | "type": "main", 268 | "index": 0 269 | } 270 | ] 271 | ] 272 | }, 273 | "合并": { 274 | "main": [ 275 | [ 276 | { 277 | "node": "排序:时间最新", 278 | "type": "main", 279 | "index": 0 280 | } 281 | ] 282 | ] 283 | }, 284 | "拉取:纽约时报RSS": { 285 | "main": [ 286 | [ 287 | { 288 | "node": "合并", 289 | "type": "main", 290 | "index": 0 291 | } 292 | ] 293 | ] 294 | }, 295 | "拉取:BBC RSS": { 296 | "main": [ 297 | [ 298 | { 299 | "node": "合并", 300 | "type": "main", 301 | "index": 1 302 | } 303 | ] 304 | ] 305 | }, 306 | "整理:表格数据": { 307 | "main": [ 308 | [ 309 | { 310 | "node": "Code", 311 | "type": "main", 312 | "index": 0 313 | } 314 | ] 315 | ] 316 | }, 317 | "Code": { 318 | "main": [ 319 | [ 320 | { 321 | "node": "Feishu Node", 322 | "type": "main", 323 | "index": 0 324 | } 325 | ] 326 | ] 327 | } 328 | }, 329 | "active": false, 330 | "settings": { 331 | "executionOrder": "v1" 332 | }, 333 | "versionId": "426a0b11-8d6b-4175-906f-3809bebcce13", 334 | "meta": { 335 | "templateCredsSetupCompleted": true, 336 | "instanceId": "6d3339a455de9042f2e878a695f7deb5f4532f35c5c36b32185be750c732f184" 337 | }, 338 | "id": "i9bjN1OHJ1f6qF43", 339 | "tags": [] 340 | } -------------------------------------------------------------------------------- /n8n/series/RSS聚合流-多维表格.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "RSS新闻翻译->多维文档", 3 | "nodes": [ 4 | { 5 | "parameters": { 6 | "model": "grok-2-1212", 7 | "options": {} 8 | }, 9 | "type": "@n8n/n8n-nodes-langchain.lmChatXAiGrok", 10 | "typeVersion": 1, 11 | "position": [ 12 | 660, 13 | -580 14 | ], 15 | "id": "bee4288d-8610-40e4-a2e6-37bf4d8299c4", 16 | "name": "xAI Grok Chat Model", 17 | "credentials": { 18 | "xAiApi": { 19 | "id": "cH0ILaofgvd2SGW1", 20 | "name": "xAi account" 21 | } 22 | } 23 | }, 24 | { 25 | "parameters": { 26 | "rule": { 27 | "interval": [ 28 | { 29 | "triggerAtHour": 8, 30 | "triggerAtMinute": 15 31 | } 32 | ] 33 | } 34 | }, 35 | "type": "n8n-nodes-base.scheduleTrigger", 36 | "typeVersion": 1.2, 37 | "position": [ 38 | -440, 39 | -800 40 | ], 41 | "id": "d3dc311c-6c48-48af-9ab8-24832603e2c6", 42 | "name": "定时触发器" 43 | }, 44 | { 45 | "parameters": { 46 | "promptType": "define", 47 | "text": "={{ $json.title + $json.content }}", 48 | "messages": { 49 | "messageValues": [ 50 | { 51 | "message": "把英文翻译成中文,注意专业性和俚语翻译不要直译而是意译。只输出翻译结果,不要输出其他内容。输入的英文内容是标题+摘要,如果有必要可以整合下内容,使它更通顺不重复。" 52 | } 53 | ] 54 | } 55 | }, 56 | "type": "@n8n/n8n-nodes-langchain.chainLlm", 57 | "typeVersion": 1.6, 58 | "position": [ 59 | 660, 60 | -800 61 | ], 62 | "id": "0aa3803d-fb21-43c4-8a54-fb3fba36265d", 63 | "name": "大模型:翻译" 64 | }, 65 | { 66 | "parameters": { 67 | "language": "python", 68 | "pythonCode": "import json\n\ndef escape_newlines(text):\n \"\"\"转义字符串中的换行符\"\"\"\n return text.replace('\\n', '\\\\n').replace('\\r', '\\\\r')\n\n# Loop over input items and add a new field called 'myNewField' to the JSON of each one\nfor item in _input.all():\n # 遍历JSON对象的所有键值对\n for key, value in item.json.items():\n # 如果值是字符串,则转义换行符\n if isinstance(value, str):\n item.json[key] = escape_newlines(value)\nreturn _input.all()\n" 69 | }, 70 | "type": "n8n-nodes-base.code", 71 | "typeVersion": 2, 72 | "position": [ 73 | 1260, 74 | -800 75 | ], 76 | "id": "949dd5c5-da05-429d-bfc4-69063695996b", 77 | "name": "Code:筛除特殊字符" 78 | }, 79 | { 80 | "parameters": { 81 | "maxItems": 10 82 | }, 83 | "type": "n8n-nodes-base.limit", 84 | "typeVersion": 1, 85 | "position": [ 86 | 440, 87 | -800 88 | ], 89 | "id": "1fb67829-b2a0-4144-9956-4ecde2c42b21", 90 | "name": "限制:最新10条" 91 | }, 92 | { 93 | "parameters": { 94 | "sortFieldsUi": { 95 | "sortField": [ 96 | { 97 | "fieldName": "isoDate", 98 | "order": "descending" 99 | } 100 | ] 101 | }, 102 | "options": {} 103 | }, 104 | "type": "n8n-nodes-base.sort", 105 | "typeVersion": 1, 106 | "position": [ 107 | 220, 108 | -800 109 | ], 110 | "id": "fc4dfa7c-0926-4647-ae15-3631faf8edc1", 111 | "name": "排序:时间最新" 112 | }, 113 | { 114 | "parameters": {}, 115 | "type": "n8n-nodes-base.merge", 116 | "typeVersion": 3.1, 117 | "position": [ 118 | 0, 119 | -800 120 | ], 121 | "id": "0c551876-f0ba-4e58-a427-ff12c0131b35", 122 | "name": "合并" 123 | }, 124 | { 125 | "parameters": { 126 | "url": "https://rss.nytimes.com/services/xml/rss/nyt/World.xml", 127 | "options": {} 128 | }, 129 | "type": "n8n-nodes-base.rssFeedRead", 130 | "typeVersion": 1.1, 131 | "position": [ 132 | -220, 133 | -900 134 | ], 135 | "id": "d68143ed-5fd5-40cb-9613-5262e1648cbb", 136 | "name": "拉取:纽约时报RSS" 137 | }, 138 | { 139 | "parameters": { 140 | "url": "https://feeds.bbci.co.uk/news/world/rss.xml", 141 | "options": {} 142 | }, 143 | "type": "n8n-nodes-base.rssFeedRead", 144 | "typeVersion": 1.1, 145 | "position": [ 146 | -220, 147 | -700 148 | ], 149 | "id": "48229d1a-ec9a-4a12-8c60-0361124c558a", 150 | "name": "拉取:BBC RSS" 151 | }, 152 | { 153 | "parameters": { 154 | "method": "POST", 155 | "url": "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal", 156 | "sendHeaders": true, 157 | "headerParameters": { 158 | "parameters": [ 159 | { 160 | "name": "Content-Type", 161 | "value": "application/json; charset=utf-8" 162 | } 163 | ] 164 | }, 165 | "sendBody": true, 166 | "contentType": "form-urlencoded", 167 | "bodyParameters": { 168 | "parameters": [ 169 | { 170 | "name": "app_id", 171 | "value": "cli_a777a0f834bb900d" 172 | }, 173 | { 174 | "name": "app_secret", 175 | "value": "b2RubDLs9Qhg6qRAD9oWggWS0EeOvHw1" 176 | } 177 | ] 178 | }, 179 | "options": {} 180 | }, 181 | "type": "n8n-nodes-base.httpRequest", 182 | "typeVersion": 4.2, 183 | "position": [ 184 | 1460, 185 | -800 186 | ], 187 | "id": "aacb2804-bf25-4eb1-a964-f3569aee3461", 188 | "name": "获取Token:多维表格" 189 | }, 190 | { 191 | "parameters": { 192 | "assignments": { 193 | "assignments": [ 194 | { 195 | "id": "ac26856a-0ead-4dba-94bc-4e2b5846266d", 196 | "name": "url", 197 | "value": "={{ $('限制:最新10条').item.json.link }}", 198 | "type": "string" 199 | }, 200 | { 201 | "id": "42ad93c3-3f45-4620-b5c3-b50b750ae86b", 202 | "name": "pubDate", 203 | "value": "={{ new Date($('限制:最新10条').item.json.pubDate).toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' }) }}", 204 | "type": "string" 205 | }, 206 | { 207 | "id": "f102d05a-34a8-4971-bc74-938656102068", 208 | "name": "content", 209 | "value": "={{ $json.text }}", 210 | "type": "string" 211 | } 212 | ] 213 | }, 214 | "options": {} 215 | }, 216 | "type": "n8n-nodes-base.set", 217 | "typeVersion": 3.4, 218 | "position": [ 219 | 1040, 220 | -800 221 | ], 222 | "id": "95dba8b3-cd1a-4e91-bb30-ff32107717d3", 223 | "name": "整理:表格数据" 224 | }, 225 | { 226 | "parameters": { 227 | "method": "POST", 228 | "url": "https://open.feishu.cn/open-apis/bitable/v1/apps/LFPbbzXtgazS4DsEFOgcUahNn4g/tables/tblihFSAQRhq5VrX/records", 229 | "sendHeaders": true, 230 | "headerParameters": { 231 | "parameters": [ 232 | { 233 | "name": "Authorization", 234 | "value": "=Bearer t-g1044ghmZAPXKGWNUZCXIWC3VCRJLDGQ75NSFK5I" 235 | }, 236 | { 237 | "name": "Content-Type", 238 | "value": "application/json; charset=utf-8" 239 | } 240 | ] 241 | }, 242 | "sendBody": true, 243 | "specifyBody": "=json", 244 | "bodyParameters": { 245 | "parameters": [ 246 | {} 247 | ] 248 | }, 249 | "jsonBody": "={\n \"fields\": {\n \"pubDate\": \"{{ $('Code:筛除特殊字符').item.json.pubDate }}\",\n \"url\": \"{{ $('Code:筛除特殊字符').item.json.url }}\",\n \"content\": \"{{ $('Code:筛除特殊字符').item.json.content }}\"\n }\n}", 250 | "options": {} 251 | }, 252 | "type": "n8n-nodes-base.httpRequest", 253 | "typeVersion": 4.2, 254 | "position": [ 255 | 1640, 256 | -800 257 | ], 258 | "id": "449953f9-4240-466d-9cf3-112b59a72cac", 259 | "name": "新增记录:多维表格" 260 | } 261 | ], 262 | "pinData": {}, 263 | "connections": { 264 | "xAI Grok Chat Model": { 265 | "ai_languageModel": [ 266 | [ 267 | { 268 | "node": "大模型:翻译", 269 | "type": "ai_languageModel", 270 | "index": 0 271 | } 272 | ] 273 | ] 274 | }, 275 | "定时触发器": { 276 | "main": [ 277 | [ 278 | { 279 | "node": "拉取:纽约时报RSS", 280 | "type": "main", 281 | "index": 0 282 | }, 283 | { 284 | "node": "拉取:BBC RSS", 285 | "type": "main", 286 | "index": 0 287 | } 288 | ] 289 | ] 290 | }, 291 | "大模型:翻译": { 292 | "main": [ 293 | [ 294 | { 295 | "node": "整理:表格数据", 296 | "type": "main", 297 | "index": 0 298 | } 299 | ] 300 | ] 301 | }, 302 | "Code:筛除特殊字符": { 303 | "main": [ 304 | [ 305 | { 306 | "node": "获取Token:多维表格", 307 | "type": "main", 308 | "index": 0 309 | } 310 | ] 311 | ] 312 | }, 313 | "限制:最新10条": { 314 | "main": [ 315 | [ 316 | { 317 | "node": "大模型:翻译", 318 | "type": "main", 319 | "index": 0 320 | } 321 | ] 322 | ] 323 | }, 324 | "排序:时间最新": { 325 | "main": [ 326 | [ 327 | { 328 | "node": "限制:最新10条", 329 | "type": "main", 330 | "index": 0 331 | } 332 | ] 333 | ] 334 | }, 335 | "合并": { 336 | "main": [ 337 | [ 338 | { 339 | "node": "排序:时间最新", 340 | "type": "main", 341 | "index": 0 342 | } 343 | ] 344 | ] 345 | }, 346 | "拉取:纽约时报RSS": { 347 | "main": [ 348 | [ 349 | { 350 | "node": "合并", 351 | "type": "main", 352 | "index": 0 353 | } 354 | ] 355 | ] 356 | }, 357 | "拉取:BBC RSS": { 358 | "main": [ 359 | [ 360 | { 361 | "node": "合并", 362 | "type": "main", 363 | "index": 1 364 | } 365 | ] 366 | ] 367 | }, 368 | "获取Token:多维表格": { 369 | "main": [ 370 | [ 371 | { 372 | "node": "新增记录:多维表格", 373 | "type": "main", 374 | "index": 0 375 | } 376 | ] 377 | ] 378 | }, 379 | "整理:表格数据": { 380 | "main": [ 381 | [ 382 | { 383 | "node": "Code:筛除特殊字符", 384 | "type": "main", 385 | "index": 0 386 | } 387 | ] 388 | ] 389 | } 390 | }, 391 | "active": false, 392 | "settings": { 393 | "executionOrder": "v1" 394 | }, 395 | "versionId": "6af630dd-d0c8-4c0d-bfea-a5c328a1f0e5", 396 | "meta": { 397 | "templateCredsSetupCompleted": true, 398 | "instanceId": "6d3339a455de9042f2e878a695f7deb5f4532f35c5c36b32185be750c732f184" 399 | }, 400 | "id": "ppjplNmLiAM9Ghfo", 401 | "tags": [] 402 | } -------------------------------------------------------------------------------- /n8n/series/RSS聚合流.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "RSS新闻翻译", 3 | "nodes": [ 4 | { 5 | "parameters": { 6 | "rule": { 7 | "interval": [ 8 | {} 9 | ] 10 | } 11 | }, 12 | "type": "n8n-nodes-base.scheduleTrigger", 13 | "typeVersion": 1.2, 14 | "position": [ 15 | -40, 16 | -800 17 | ], 18 | "id": "cc95a033-9662-43a4-89c6-e250d208a455", 19 | "name": "Schedule Trigger" 20 | }, 21 | { 22 | "parameters": { 23 | "url": "https://rss.nytimes.com/services/xml/rss/nyt/World.xml", 24 | "options": {} 25 | }, 26 | "type": "n8n-nodes-base.rssFeedRead", 27 | "typeVersion": 1.1, 28 | "position": [ 29 | 180, 30 | -900 31 | ], 32 | "id": "acbc75a1-836f-4c50-913c-fac41feed489", 33 | "name": "拉取:纽约时报RSS" 34 | }, 35 | { 36 | "parameters": { 37 | "maxItems": 10 38 | }, 39 | "type": "n8n-nodes-base.limit", 40 | "typeVersion": 1, 41 | "position": [ 42 | -220, 43 | -480 44 | ], 45 | "id": "756459ad-7ba0-40a4-a53b-dc4608814cbf", 46 | "name": "限制:最新10条" 47 | }, 48 | { 49 | "parameters": { 50 | "sortFieldsUi": { 51 | "sortField": [ 52 | { 53 | "fieldName": "isoDate", 54 | "order": "descending" 55 | } 56 | ] 57 | }, 58 | "options": {} 59 | }, 60 | "type": "n8n-nodes-base.sort", 61 | "typeVersion": 1, 62 | "position": [ 63 | -440, 64 | -480 65 | ], 66 | "id": "3d791958-16a9-41c6-bd3d-a726c93db074", 67 | "name": "排序:时间最新" 68 | }, 69 | { 70 | "parameters": { 71 | "assignments": { 72 | "assignments": [ 73 | { 74 | "id": "ac26856a-0ead-4dba-94bc-4e2b5846266d", 75 | "name": "link", 76 | "value": "={{ $('限制:最新10条').item.json.link }}", 77 | "type": "string" 78 | }, 79 | { 80 | "id": "42ad93c3-3f45-4620-b5c3-b50b750ae86b", 81 | "name": "pubDate", 82 | "value": "={{ new Date($('限制:最新10条').item.json.pubDate).toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' }) }}", 83 | "type": "string" 84 | }, 85 | { 86 | "id": "f102d05a-34a8-4971-bc74-938656102068", 87 | "name": "message", 88 | "value": "={{ $json.text }}", 89 | "type": "string" 90 | } 91 | ] 92 | }, 93 | "options": {} 94 | }, 95 | "type": "n8n-nodes-base.set", 96 | "typeVersion": 3.4, 97 | "position": [ 98 | 376, 99 | -480 100 | ], 101 | "id": "f8718836-0166-4a67-be5e-538b06d816a7", 102 | "name": "整理:表格数据" 103 | }, 104 | { 105 | "parameters": { 106 | "operation": "xlsx", 107 | "options": { 108 | "fileName": "新闻翻译稿" 109 | } 110 | }, 111 | "type": "n8n-nodes-base.convertToFile", 112 | "typeVersion": 1.1, 113 | "position": [ 114 | 596, 115 | -480 116 | ], 117 | "id": "ba836e35-fbb0-448f-b8be-1da76742e0f7", 118 | "name": "输出:Excel" 119 | }, 120 | { 121 | "parameters": { 122 | "model": "grok-2-1212", 123 | "options": {} 124 | }, 125 | "type": "@n8n/n8n-nodes-langchain.lmChatXAiGrok", 126 | "typeVersion": 1, 127 | "position": [ 128 | -20, 129 | -300 130 | ], 131 | "id": "cc974864-9c17-4304-8762-d8d265a6608b", 132 | "name": "xAI Grok Chat Model", 133 | "credentials": { 134 | "xAiApi": { 135 | "id": "cH0ILaofgvd2SGW1", 136 | "name": "xAi account" 137 | } 138 | } 139 | }, 140 | { 141 | "parameters": { 142 | "promptType": "define", 143 | "text": "={{ $json.title + $json.content }}", 144 | "messages": { 145 | "messageValues": [ 146 | { 147 | "message": "把英文翻译成中文,注意专业性和俚语翻译不要直译而是意译。只输出翻译结果,不要输出其他内容。输入的英文内容是标题+摘要,如果有必要可以整合下内容,使它更通顺不重复。" 148 | } 149 | ] 150 | } 151 | }, 152 | "type": "@n8n/n8n-nodes-langchain.chainLlm", 153 | "typeVersion": 1.6, 154 | "position": [ 155 | 0, 156 | -480 157 | ], 158 | "id": "7d7bd555-bc47-4a2d-b215-1d392d0ad399", 159 | "name": "大模型:翻译" 160 | }, 161 | { 162 | "parameters": { 163 | "sendTo": "qiuyu.chen@live.com", 164 | "subject": "纽约时报新闻汇总", 165 | "message": "请查看附件", 166 | "options": { 167 | "appendAttribution": true, 168 | "attachmentsUi": { 169 | "attachmentsBinary": [ 170 | {} 171 | ] 172 | } 173 | } 174 | }, 175 | "type": "n8n-nodes-base.gmail", 176 | "typeVersion": 2.1, 177 | "position": [ 178 | 816, 179 | -480 180 | ], 181 | "id": "5cbb17d7-4848-4ba9-af9f-6b4eacff883b", 182 | "name": "Gmail", 183 | "webhookId": "b76d5920-2243-40eb-ac2d-15d6911e2f10", 184 | "credentials": { 185 | "gmailOAuth2": { 186 | "id": "cNpjYrn3H9RGzW2l", 187 | "name": "Gmail account" 188 | } 189 | } 190 | }, 191 | { 192 | "parameters": {}, 193 | "type": "n8n-nodes-base.merge", 194 | "typeVersion": 3.1, 195 | "position": [ 196 | 400, 197 | -800 198 | ], 199 | "id": "41e0ba6c-3a0b-433f-a2d9-d3722dcba469", 200 | "name": "Merge" 201 | }, 202 | { 203 | "parameters": { 204 | "url": "https://feeds.bbci.co.uk/news/world/rss.xml", 205 | "options": {} 206 | }, 207 | "type": "n8n-nodes-base.rssFeedRead", 208 | "typeVersion": 1.1, 209 | "position": [ 210 | 180, 211 | -700 212 | ], 213 | "id": "1fc89f03-ed90-4a2c-91ce-51019c5ffb68", 214 | "name": "拉取:BBC RSS" 215 | } 216 | ], 217 | "pinData": {}, 218 | "connections": { 219 | "Schedule Trigger": { 220 | "main": [ 221 | [ 222 | { 223 | "node": "拉取:纽约时报RSS", 224 | "type": "main", 225 | "index": 0 226 | }, 227 | { 228 | "node": "拉取:BBC RSS", 229 | "type": "main", 230 | "index": 0 231 | } 232 | ] 233 | ] 234 | }, 235 | "拉取:纽约时报RSS": { 236 | "main": [ 237 | [ 238 | { 239 | "node": "Merge", 240 | "type": "main", 241 | "index": 0 242 | } 243 | ] 244 | ] 245 | }, 246 | "限制:最新10条": { 247 | "main": [ 248 | [ 249 | { 250 | "node": "大模型:翻译", 251 | "type": "main", 252 | "index": 0 253 | } 254 | ] 255 | ] 256 | }, 257 | "排序:时间最新": { 258 | "main": [ 259 | [ 260 | { 261 | "node": "限制:最新10条", 262 | "type": "main", 263 | "index": 0 264 | } 265 | ] 266 | ] 267 | }, 268 | "整理:表格数据": { 269 | "main": [ 270 | [ 271 | { 272 | "node": "输出:Excel", 273 | "type": "main", 274 | "index": 0 275 | } 276 | ] 277 | ] 278 | }, 279 | "xAI Grok Chat Model": { 280 | "ai_languageModel": [ 281 | [ 282 | { 283 | "node": "大模型:翻译", 284 | "type": "ai_languageModel", 285 | "index": 0 286 | } 287 | ] 288 | ] 289 | }, 290 | "大模型:翻译": { 291 | "main": [ 292 | [ 293 | { 294 | "node": "整理:表格数据", 295 | "type": "main", 296 | "index": 0 297 | } 298 | ] 299 | ] 300 | }, 301 | "输出:Excel": { 302 | "main": [ 303 | [ 304 | { 305 | "node": "Gmail", 306 | "type": "main", 307 | "index": 0 308 | } 309 | ] 310 | ] 311 | }, 312 | "Merge": { 313 | "main": [ 314 | [ 315 | { 316 | "node": "排序:时间最新", 317 | "type": "main", 318 | "index": 0 319 | } 320 | ] 321 | ] 322 | }, 323 | "拉取:BBC RSS": { 324 | "main": [ 325 | [ 326 | { 327 | "node": "Merge", 328 | "type": "main", 329 | "index": 1 330 | } 331 | ] 332 | ] 333 | } 334 | }, 335 | "active": true, 336 | "settings": { 337 | "executionOrder": "v1" 338 | }, 339 | "versionId": "6ca7ff62-bfd8-438c-85c5-820a3b6d6c2c", 340 | "meta": { 341 | "templateCredsSetupCompleted": true, 342 | "instanceId": "46045cca4b88b76b646dc0f1285c481b74d7f5d1d9f712ea4e4be83854616298" 343 | }, 344 | "id": "iHBUJts4ftH43rfi", 345 | "tags": [] 346 | } -------------------------------------------------------------------------------- /n8n/series/SubFlow_Web2RSS.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SubFlow-Web2RSS", 3 | "nodes": [ 4 | { 5 | "parameters": { 6 | "model": { 7 | "__rl": true, 8 | "value": "llama-3.3-70b", 9 | "mode": "list", 10 | "cachedResultName": "llama-3.3-70b" 11 | }, 12 | "options": {} 13 | }, 14 | "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", 15 | "typeVersion": 1.2, 16 | "position": [ 17 | -80, 18 | 740 19 | ], 20 | "id": "87836199-3fff-4ab3-9637-b5c2871c124a", 21 | "name": "OpenAI Chat Model", 22 | "credentials": { 23 | "openAiApi": { 24 | "id": "XThOsUMK75kBb1n7", 25 | "name": "OneHub" 26 | } 27 | } 28 | }, 29 | { 30 | "parameters": { 31 | "options": { 32 | "numberOfItems": -1 33 | } 34 | }, 35 | "type": "@n8n/n8n-nodes-langchain.outputParserItemList", 36 | "typeVersion": 1, 37 | "position": [ 38 | 140, 39 | 740 40 | ], 41 | "id": "c6ea9f63-a8af-4754-9207-66a0b2df77ba", 42 | "name": "Item List Output Parser" 43 | }, 44 | { 45 | "parameters": { 46 | "resource": "Default", 47 | "operation": "Scrape A Url And Get Its Content", 48 | "url": "={{ $json.text.parseJson().link }}", 49 | "formats": [ 50 | "markdown" 51 | ], 52 | "requestOptions": {} 53 | }, 54 | "type": "n8n-nodes-firecrawl.fireCrawl", 55 | "typeVersion": 1, 56 | "position": [ 57 | 940, 58 | 700 59 | ], 60 | "id": "10689837-a2a3-4dd8-942d-c709569ad437", 61 | "name": "FireCrawl", 62 | "retryOnFail": true, 63 | "credentials": { 64 | "fireCrawlApi": { 65 | "id": "0to9BtFFwoffmlMu", 66 | "name": "FireCrawl account" 67 | } 68 | } 69 | }, 70 | { 71 | "parameters": { 72 | "promptType": "define", 73 | "text": "={{ $json.data }}", 74 | "hasOutputParser": true, 75 | "messages": { 76 | "messageValues": [ 77 | { 78 | "message": "抽取文章正文内容, 正文1000字以内抽取200字左右,正文1000字以上上的抽取20%左右" 79 | } 80 | ] 81 | } 82 | }, 83 | "type": "@n8n/n8n-nodes-langchain.chainLlm", 84 | "typeVersion": 1.6, 85 | "position": [ 86 | 1120, 87 | 400 88 | ], 89 | "id": "143e6e9f-82af-415a-905a-29c8e0caaa8b", 90 | "name": "尝试从HTTP Get获取的HTML抽取正文" 91 | }, 92 | { 93 | "parameters": { 94 | "promptType": "define", 95 | "text": "={{ $json.data.markdown }}", 96 | "hasOutputParser": true, 97 | "messages": { 98 | "messageValues": [ 99 | { 100 | "message": "抽取文章正文内容, 正文1000字以内抽取200字左右,正文1000字以上上的抽取20%左右" 101 | } 102 | ] 103 | } 104 | }, 105 | "type": "@n8n/n8n-nodes-langchain.chainLlm", 106 | "typeVersion": 1.6, 107 | "position": [ 108 | 1120, 109 | 700 110 | ], 111 | "id": "f4cf5ee7-81c5-4b38-b83f-f9bdcd016067", 112 | "name": "从Firecrawl获取的Markdown提取正文", 113 | "retryOnFail": true, 114 | "maxTries": 5, 115 | "waitBetweenTries": 5000 116 | }, 117 | { 118 | "parameters": {}, 119 | "type": "n8n-nodes-base.merge", 120 | "typeVersion": 3.1, 121 | "position": [ 122 | 1520, 123 | 540 124 | ], 125 | "id": "dfc603d0-38d4-4806-9c96-842476e9c2d6", 126 | "name": "Merge" 127 | }, 128 | { 129 | "parameters": { 130 | "resource": "Default", 131 | "operation": "Scrape A Url And Get Its Content", 132 | "url": "={{ $json.url }}", 133 | "formats": [ 134 | "markdown" 135 | ], 136 | "requestOptions": {} 137 | }, 138 | "type": "n8n-nodes-firecrawl.fireCrawl", 139 | "typeVersion": 1, 140 | "position": [ 141 | -260, 142 | 520 143 | ], 144 | "id": "340ec3bd-9756-4691-a5c4-2bcb735e8f24", 145 | "name": "抓取目标页", 146 | "retryOnFail": true, 147 | "waitBetweenTries": 5000, 148 | "credentials": { 149 | "fireCrawlApi": { 150 | "id": "0to9BtFFwoffmlMu", 151 | "name": "FireCrawl account" 152 | } 153 | } 154 | }, 155 | { 156 | "parameters": { 157 | "url": "={{ $json.text.parseJson().link }}", 158 | "sendHeaders": true, 159 | "headerParameters": { 160 | "parameters": [ 161 | { 162 | "name": "User-Agent", 163 | "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36" 164 | } 165 | ] 166 | }, 167 | "options": {} 168 | }, 169 | "type": "n8n-nodes-base.httpRequest", 170 | "typeVersion": 4.2, 171 | "position": [ 172 | 940, 173 | 400 174 | ], 175 | "id": "de65938a-621c-4728-a0dc-dcf65aab96b7", 176 | "name": "简单Request获取", 177 | "retryOnFail": true, 178 | "waitBetweenTries": 5000 179 | }, 180 | { 181 | "parameters": { 182 | "conditions": { 183 | "options": { 184 | "caseSensitive": true, 185 | "leftValue": "", 186 | "typeValidation": "loose", 187 | "version": 2 188 | }, 189 | "conditions": [ 190 | { 191 | "id": "b614b737-06a4-483b-8ed8-bb4dfcdeaf52", 192 | "leftValue": "={{ new Date($json.text.parseJson().date).getTime() }}", 193 | "rightValue": "={{ $('调用入口').item.json.fromdate }}", 194 | "operator": { 195 | "type": "number", 196 | "operation": "gte" 197 | } 198 | } 199 | ], 200 | "combinator": "and" 201 | }, 202 | "looseTypeValidation": true, 203 | "options": {} 204 | }, 205 | "type": "n8n-nodes-base.filter", 206 | "typeVersion": 2.2, 207 | "position": [ 208 | 300, 209 | 520 210 | ], 211 | "id": "555e9482-5a06-445b-bfce-4532e90b110f", 212 | "name": "Filter", 213 | "retryOnFail": true, 214 | "disabled": true, 215 | "onError": "continueRegularOutput" 216 | }, 217 | { 218 | "parameters": { 219 | "inputSource": "jsonExample", 220 | "jsonExample": "{\n \"url\": \"a url string\",\n \"fromdate\": 1746773936595,\n \"mode\": \"request/crawl\"\n}" 221 | }, 222 | "type": "n8n-nodes-base.executeWorkflowTrigger", 223 | "typeVersion": 1.1, 224 | "position": [ 225 | -460, 226 | 520 227 | ], 228 | "id": "e990fb24-20be-4930-ba21-519927116695", 229 | "name": "调用入口" 230 | }, 231 | { 232 | "parameters": { 233 | "jsonSchemaExample": "{\n \"content\": \"正文内容...\"\n}" 234 | }, 235 | "type": "@n8n/n8n-nodes-langchain.outputParserStructured", 236 | "typeVersion": 1.2, 237 | "position": [ 238 | 1280, 239 | 580 240 | ], 241 | "id": "aa53989f-e032-4986-a858-95ba337b50bf", 242 | "name": "Structured Output Parser" 243 | }, 244 | { 245 | "parameters": { 246 | "conditions": { 247 | "options": { 248 | "caseSensitive": true, 249 | "leftValue": "", 250 | "typeValidation": "strict", 251 | "version": 2 252 | }, 253 | "conditions": [ 254 | { 255 | "id": "8bb643f6-1492-487b-85d1-7c0cf71c00fc", 256 | "leftValue": "={{ $('调用入口').item.json.mode }}", 257 | "rightValue": "request", 258 | "operator": { 259 | "type": "string", 260 | "operation": "equals" 261 | } 262 | } 263 | ], 264 | "combinator": "and" 265 | }, 266 | "options": {} 267 | }, 268 | "type": "n8n-nodes-base.if", 269 | "typeVersion": 2.2, 270 | "position": [ 271 | 760, 272 | 540 273 | ], 274 | "id": "d9fe3159-f591-47a7-a151-914301a72b47", 275 | "name": "If" 276 | }, 277 | { 278 | "parameters": {}, 279 | "type": "n8n-nodes-base.wait", 280 | "typeVersion": 1.1, 281 | "position": [ 282 | 760, 283 | 720 284 | ], 285 | "id": "a58a6649-ce07-478a-aea5-95251e8043ce", 286 | "name": "Wait", 287 | "webhookId": "ce346e52-9822-4fa3-90b4-e9acfad81bab", 288 | "disabled": true 289 | }, 290 | { 291 | "parameters": { 292 | "model": "grok-3-beta", 293 | "options": {} 294 | }, 295 | "type": "@n8n/n8n-nodes-langchain.lmChatXAiGrok", 296 | "typeVersion": 1, 297 | "position": [ 298 | 1120, 299 | 580 300 | ], 301 | "id": "dd014709-d341-4cef-a238-01bf59653d9d", 302 | "name": "xAI Grok Chat Model", 303 | "credentials": { 304 | "xAiApi": { 305 | "id": "cH0ILaofgvd2SGW1", 306 | "name": "xAi account" 307 | } 308 | } 309 | }, 310 | { 311 | "parameters": { 312 | "promptType": "define", 313 | "text": "={{ $json.data.markdown }}", 314 | "hasOutputParser": true, 315 | "messages": { 316 | "messageValues": [ 317 | { 318 | "message": "把输入的内容整理成标准Json输出,仅包含正文本身,不输入任何其他内容(包括```这样的标头)\n处理内容时需要注意特殊字符的处理,避免JSON格式被打乱\n一条记录应有title, link, 以及date字段(中文按UTC+8区,如果不确定时间,一律按中午12:00),参考以下格式,禁止使用/n等换行符转义字符\n{\"title\": \"青年早新闻|全国首例!抢票“外挂”软件被判构成不正当竞争\",\"link\":\"http://m.cyol.com/gb/baobao/articles/2025-04/28/content_AjMO99Hbyw.html\", \"date\": \"2025-05-07T17:57:30.885+08:00\"}" 319 | } 320 | ] 321 | } 322 | }, 323 | "type": "@n8n/n8n-nodes-langchain.chainLlm", 324 | "typeVersion": 1.6, 325 | "position": [ 326 | -60, 327 | 520 328 | ], 329 | "id": "9c4c0f08-b79d-4ea0-a665-a2ffc943472b", 330 | "name": "大模型:分析并抽取页面的新闻条", 331 | "retryOnFail": true, 332 | "waitBetweenTries": 5000, 333 | "maxTries": 5 334 | }, 335 | { 336 | "parameters": { 337 | "content": "## 1.获取并筛选新闻词条", 338 | "height": 600, 339 | "width": 960, 340 | "color": 6 341 | }, 342 | "type": "n8n-nodes-base.stickyNote", 343 | "typeVersion": 1, 344 | "position": [ 345 | -540, 346 | 320 347 | ], 348 | "id": "23869881-9a89-4d67-a45c-2bc04c5790dc", 349 | "name": "Sticky Note" 350 | }, 351 | { 352 | "parameters": { 353 | "content": "## 2. 获取每条新闻内容,并按RSS格式进行汇聚返回", 354 | "height": 600, 355 | "width": 1560, 356 | "color": 4 357 | }, 358 | "type": "n8n-nodes-base.stickyNote", 359 | "typeVersion": 1, 360 | "position": [ 361 | 440, 362 | 320 363 | ], 364 | "id": "4bdc1f18-488d-4f4f-9baa-902fea9ca801", 365 | "name": "Sticky Note1" 366 | }, 367 | { 368 | "parameters": { 369 | "assignments": { 370 | "assignments": [ 371 | { 372 | "id": "a9538297-b88f-40e9-a320-8b28effc3abb", 373 | "name": "title", 374 | "value": "={{ $('循环').item.json.text.parseJson().title }}", 375 | "type": "string" 376 | }, 377 | { 378 | "id": "7fe4351b-716a-4b45-bf90-2bdf031792a6", 379 | "name": "link", 380 | "value": "={{ $('循环').item.json.text.parseJson().link}}", 381 | "type": "string" 382 | }, 383 | { 384 | "id": "6ec655bb-ee90-4168-8996-9213572e870d", 385 | "name": "pubDate", 386 | "value": "={{ $('循环').item.json.text.parseJson().date }}", 387 | "type": "string" 388 | }, 389 | { 390 | "id": "c3a66aed-f49a-4feb-82d0-bc4bb34fcf0d", 391 | "name": "content", 392 | "value": "={{ $json.output.content }}", 393 | "type": "string" 394 | } 395 | ] 396 | }, 397 | "includeOtherFields": true, 398 | "include": "selected", 399 | "includeFields": "=", 400 | "options": { 401 | "dotNotation": false 402 | } 403 | }, 404 | "type": "n8n-nodes-base.set", 405 | "typeVersion": 3.4, 406 | "position": [ 407 | 1600, 408 | 720 409 | ], 410 | "id": "8a2420fa-7a1e-4f72-8134-8fce7809f10d", 411 | "name": "重新组织数据结构", 412 | "retryOnFail": false 413 | }, 414 | { 415 | "parameters": { 416 | "language": "python", 417 | "pythonCode": "# 检查输入数据是否存在且格式正确\n# 迭代处理列表中的每一个 Item\n# 确保 items 是一个非空的列表\nif items and isinstance(items, list):\n # 创建一个新的列表来存储处理后的 Item,或者直接修改原列表(当前选择直接修改原列表)\n # processed_items = [] # 如果需要创建一个新的列表\n\n # 遍历输入列表中的每一个 Item\n for i, item in enumerate(items): # 使用 enumerate 可以获取索引,方便调试或引用\n # 确保当前 item 是一个字典\n if isinstance(item, dict):\n # 1. 检查并提取 'content' 的值\n # 确保 'content' 键存在且其值是字符串\n if 'content' in item and isinstance(item['content'], str):\n original_content = item['content']\n\n # 清理常见空白符,转换为JSON安全的转义序列(这部分原代码已做,保留)\n # 注意:这些字符 (\\n, \\t, \\r) 在JSON字符串值中是需要转义的。\n # Python字符串字面量中的 \\\\n 会被序列化器正确地输出为 JSON 中的 \\n。\n # 您的替换逻辑是正确的,它将 Python 字符串中的实际换行符替换为 Python 字符串字面量中的 \"\\n\"\n # 这等同于将实际换行符转义为 JSON 中的 \\\\n\n cleaned_content = original_content.replace('\\n', '\\\\n')\n cleaned_content = cleaned_content.replace('\\t', '\\\\t')\n cleaned_content = cleaned_content.replace('\\r', '\\\\r')\n\n # >>> 关键修正: 添加对全角空格的清理 <<<\n # 全角空格 (U+3000) 在某些解析器中可能导致问题。\n # 替换为普通半角空格 ' ' 是一个常见的做法。\n cleaned_content = cleaned_content.replace(' ', ' ') # 将全角空格替换为半角空格\n\n # 你还可以考虑清理其他可能的非打印字符或特定问题字符,如果需要的话。\n # 例如,如果遇到零宽度字符 U+200B,也可以清理:\n # cleaned_content = cleaned_content.replace('\\u200b', '')\n\n # 更新当前 Item 中的 'content' 键的值(直接修改原列表中的字典)\n item['content'] = cleaned_content\n # processed_items.append(item) # 如果是创建新列表则添加到这里\n\n else:\n # 如果当前 item 没有 content 键或者 content 不是字符串,打印警告并跳过处理\n # 当前 item 将保持原样\n # 使用 get('title', 'Untitled Item') 提供更多上下文\n print(f\"Warning: Item at index {i} ('{item.get('title', 'Untitled Item')}') has no 'content' key or its value is not a string. Skipping content cleaning for this item.\")\n # processed_items.append(item) # 如果是创建新列表则添加到这里(保持原样)\n\n else:\n # 如果列表中的某个元素不是字典,打印警告并跳过\n print(f\"Warning: Item at index {i} is not a dictionary. Skipping this element: {item}\")\n # 如果是创建新列表,可能需要决定是否包含这个非字典元素\n # processed_items.append(item) # 或者直接忽略,取决于下游需求\n\n # 如果是创建新列表,则更新 items 变量\n # items = processed_items\n\nelse:\n # 如果输入不是预期的格式(例如 items 为空或不是列表),打印警告\n print(\"Warning: Input 'items' is empty or not a list. No processing performed.\")\n # 在这种情况下,items 变量保持原样。如果下游节点依赖于特定格式,这可能会导致错误。\n # 考虑在这里将 items 设置为 [] 以避免下游问题,但通常保留原样以便调试输入。\n # items = []\n\n# Python Code 节点要求显式地返回处理后的 Item 列表。\n# 即使我们已经在上面修改了 items 列表,也必须使用 return 将它传递出去。\nreturn items\n" 418 | }, 419 | "type": "n8n-nodes-base.code", 420 | "typeVersion": 2, 421 | "position": [ 422 | 1740, 423 | 540 424 | ], 425 | "id": "0a50737e-c110-4418-a0e1-8777d0e8e959", 426 | "name": "去掉特殊字符" 427 | }, 428 | { 429 | "parameters": { 430 | "options": {} 431 | }, 432 | "type": "n8n-nodes-base.splitInBatches", 433 | "typeVersion": 3, 434 | "position": [ 435 | 560, 436 | 520 437 | ], 438 | "id": "6433d2bb-dbbc-4cf4-96a1-15aec576049d", 439 | "name": "循环" 440 | } 441 | ], 442 | "pinData": {}, 443 | "connections": { 444 | "OpenAI Chat Model": { 445 | "ai_languageModel": [ 446 | [ 447 | { 448 | "node": "大模型:分析并抽取页面的新闻条", 449 | "type": "ai_languageModel", 450 | "index": 0 451 | } 452 | ] 453 | ] 454 | }, 455 | "Item List Output Parser": { 456 | "ai_outputParser": [ 457 | [ 458 | { 459 | "node": "大模型:分析并抽取页面的新闻条", 460 | "type": "ai_outputParser", 461 | "index": 0 462 | } 463 | ] 464 | ] 465 | }, 466 | "FireCrawl": { 467 | "main": [ 468 | [ 469 | { 470 | "node": "从Firecrawl获取的Markdown提取正文", 471 | "type": "main", 472 | "index": 0 473 | } 474 | ] 475 | ] 476 | }, 477 | "尝试从HTTP Get获取的HTML抽取正文": { 478 | "main": [ 479 | [ 480 | { 481 | "node": "Merge", 482 | "type": "main", 483 | "index": 0 484 | } 485 | ] 486 | ] 487 | }, 488 | "从Firecrawl获取的Markdown提取正文": { 489 | "main": [ 490 | [ 491 | { 492 | "node": "Merge", 493 | "type": "main", 494 | "index": 1 495 | } 496 | ] 497 | ] 498 | }, 499 | "Merge": { 500 | "main": [ 501 | [ 502 | { 503 | "node": "去掉特殊字符", 504 | "type": "main", 505 | "index": 0 506 | } 507 | ] 508 | ] 509 | }, 510 | "抓取目标页": { 511 | "main": [ 512 | [ 513 | { 514 | "node": "大模型:分析并抽取页面的新闻条", 515 | "type": "main", 516 | "index": 0 517 | } 518 | ] 519 | ] 520 | }, 521 | "简单Request获取": { 522 | "main": [ 523 | [ 524 | { 525 | "node": "尝试从HTTP Get获取的HTML抽取正文", 526 | "type": "main", 527 | "index": 0 528 | } 529 | ] 530 | ] 531 | }, 532 | "Filter": { 533 | "main": [ 534 | [ 535 | { 536 | "node": "循环", 537 | "type": "main", 538 | "index": 0 539 | } 540 | ] 541 | ] 542 | }, 543 | "调用入口": { 544 | "main": [ 545 | [ 546 | { 547 | "node": "抓取目标页", 548 | "type": "main", 549 | "index": 0 550 | } 551 | ] 552 | ] 553 | }, 554 | "Structured Output Parser": { 555 | "ai_outputParser": [ 556 | [ 557 | { 558 | "node": "尝试从HTTP Get获取的HTML抽取正文", 559 | "type": "ai_outputParser", 560 | "index": 0 561 | }, 562 | { 563 | "node": "从Firecrawl获取的Markdown提取正文", 564 | "type": "ai_outputParser", 565 | "index": 0 566 | } 567 | ] 568 | ] 569 | }, 570 | "If": { 571 | "main": [ 572 | [ 573 | { 574 | "node": "简单Request获取", 575 | "type": "main", 576 | "index": 0 577 | } 578 | ], 579 | [ 580 | { 581 | "node": "FireCrawl", 582 | "type": "main", 583 | "index": 0 584 | } 585 | ] 586 | ] 587 | }, 588 | "Wait": { 589 | "main": [ 590 | [ 591 | { 592 | "node": "循环", 593 | "type": "main", 594 | "index": 0 595 | } 596 | ] 597 | ] 598 | }, 599 | "xAI Grok Chat Model": { 600 | "ai_languageModel": [ 601 | [ 602 | { 603 | "node": "尝试从HTTP Get获取的HTML抽取正文", 604 | "type": "ai_languageModel", 605 | "index": 0 606 | }, 607 | { 608 | "node": "从Firecrawl获取的Markdown提取正文", 609 | "type": "ai_languageModel", 610 | "index": 0 611 | } 612 | ] 613 | ] 614 | }, 615 | "大模型:分析并抽取页面的新闻条": { 616 | "main": [ 617 | [ 618 | { 619 | "node": "Filter", 620 | "type": "main", 621 | "index": 0 622 | } 623 | ] 624 | ] 625 | }, 626 | "重新组织数据结构": { 627 | "main": [ 628 | [ 629 | { 630 | "node": "Wait", 631 | "type": "main", 632 | "index": 0 633 | } 634 | ] 635 | ] 636 | }, 637 | "去掉特殊字符": { 638 | "main": [ 639 | [ 640 | { 641 | "node": "重新组织数据结构", 642 | "type": "main", 643 | "index": 0 644 | } 645 | ] 646 | ] 647 | }, 648 | "循环": { 649 | "main": [ 650 | [], 651 | [ 652 | { 653 | "node": "If", 654 | "type": "main", 655 | "index": 0 656 | } 657 | ] 658 | ] 659 | } 660 | }, 661 | "active": false, 662 | "settings": { 663 | "executionOrder": "v1" 664 | }, 665 | "versionId": "9bcd24e5-8fb6-4547-9c06-4aa38a567c4f", 666 | "meta": { 667 | "templateCredsSetupCompleted": true, 668 | "instanceId": "6d3339a455de9042f2e878a695f7deb5f4532f35c5c36b32185be750c732f184" 669 | }, 670 | "id": "zoURqywBmlxWLSSN", 671 | "tags": [] 672 | } -------------------------------------------------------------------------------- /n8n/series/SubFlow乘法.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SubFlow: 乘法", 3 | "nodes": [ 4 | { 5 | "parameters": { 6 | "inputSource": "jsonExample", 7 | "jsonExample": "{\n \"num1\": 1234,\n \"num2\": 1234\n}" 8 | }, 9 | "type": "n8n-nodes-base.executeWorkflowTrigger", 10 | "typeVersion": 1.1, 11 | "position": [ 12 | 0, 13 | 0 14 | ], 15 | "id": "a825d01c-60cb-4ad4-947d-b380242414b4", 16 | "name": "When Executed by Another Workflow" 17 | }, 18 | { 19 | "parameters": { 20 | "mode": "runOnceForEachItem", 21 | "jsCode": "$input.item.json.sum = ($input.item.json?.num1 ?? 0) * ($input.item.json?.num2 ?? 0);\n\nreturn $input.item;" 22 | }, 23 | "type": "n8n-nodes-base.code", 24 | "typeVersion": 2, 25 | "position": [ 26 | 220, 27 | 0 28 | ], 29 | "id": "6bb78da6-e929-4687-bf01-fc5355b58507", 30 | "name": "Code:乘法" 31 | } 32 | ], 33 | "pinData": {}, 34 | "connections": { 35 | "When Executed by Another Workflow": { 36 | "main": [ 37 | [ 38 | { 39 | "node": "Code:乘法", 40 | "type": "main", 41 | "index": 0 42 | } 43 | ] 44 | ] 45 | }, 46 | "Code:乘法": { 47 | "main": [ 48 | [] 49 | ] 50 | } 51 | }, 52 | "active": false, 53 | "settings": { 54 | "executionOrder": "v1" 55 | }, 56 | "versionId": "3e56750d-44f3-4f91-8eab-315241a382c4", 57 | "meta": { 58 | "templateCredsSetupCompleted": true, 59 | "instanceId": "6d3339a455de9042f2e878a695f7deb5f4532f35c5c36b32185be750c732f184" 60 | }, 61 | "id": "svnAhhdWf0VQFKEj", 62 | "tags": [] 63 | } -------------------------------------------------------------------------------- /n8n/series/SubFlow加法.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SubFlow: 加法", 3 | "nodes": [ 4 | { 5 | "parameters": { 6 | "inputSource": "jsonExample", 7 | "jsonExample": "{\n \"num1\": 1234,\n \"num2\": 1234\n}" 8 | }, 9 | "type": "n8n-nodes-base.executeWorkflowTrigger", 10 | "typeVersion": 1.1, 11 | "position": [ 12 | 0, 13 | 0 14 | ], 15 | "id": "2b71699e-44ea-46de-ac9d-2b0b87ad254f", 16 | "name": "When Executed by Another Workflow" 17 | }, 18 | { 19 | "parameters": { 20 | "mode": "runOnceForEachItem", 21 | "jsCode": "$input.item.json.sum = ($input.item.json?.num1 ?? 0) + ($input.item.json?.num2 ?? 0);\n\nreturn $input.item;" 22 | }, 23 | "type": "n8n-nodes-base.code", 24 | "typeVersion": 2, 25 | "position": [ 26 | 220, 27 | 0 28 | ], 29 | "id": "f6cb2632-c2ae-4062-a906-a38ecc9b9907", 30 | "name": "Code:加法" 31 | } 32 | ], 33 | "pinData": {}, 34 | "connections": { 35 | "When Executed by Another Workflow": { 36 | "main": [ 37 | [ 38 | { 39 | "node": "Code:加法", 40 | "type": "main", 41 | "index": 0 42 | } 43 | ] 44 | ] 45 | }, 46 | "Code:加法": { 47 | "main": [ 48 | [] 49 | ] 50 | } 51 | }, 52 | "active": false, 53 | "settings": { 54 | "executionOrder": "v1" 55 | }, 56 | "versionId": "db0a317e-121b-4c14-ab88-0c32ee67052a", 57 | "meta": { 58 | "templateCredsSetupCompleted": true, 59 | "instanceId": "6d3339a455de9042f2e878a695f7deb5f4532f35c5c36b32185be750c732f184" 60 | }, 61 | "id": "7rc5OeZVf1NgP8Fd", 62 | "tags": [] 63 | } -------------------------------------------------------------------------------- /n8n/series/SubFlow翻译.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SubFlow: 翻译", 3 | "nodes": [ 4 | { 5 | "parameters": { 6 | "inputSource": "jsonExample", 7 | "jsonExample": "{\n \"content\": \"Hello World. \",\n \"language\": \"法语\"\n}" 8 | }, 9 | "type": "n8n-nodes-base.executeWorkflowTrigger", 10 | "typeVersion": 1.1, 11 | "position": [ 12 | 0, 13 | 0 14 | ], 15 | "id": "031206b4-dc85-4f29-a1d7-e564693ffbf4", 16 | "name": "When Executed by Another Workflow" 17 | }, 18 | { 19 | "parameters": { 20 | "model": "grok-3-beta", 21 | "options": {} 22 | }, 23 | "type": "@n8n/n8n-nodes-langchain.lmChatXAiGrok", 24 | "typeVersion": 1, 25 | "position": [ 26 | 180, 27 | 180 28 | ], 29 | "id": "1c878966-ed5e-4f62-8620-b5cbefb862b4", 30 | "name": "xAI Grok Chat Model", 31 | "credentials": { 32 | "xAiApi": { 33 | "id": "cH0ILaofgvd2SGW1", 34 | "name": "xAi account" 35 | } 36 | } 37 | }, 38 | { 39 | "parameters": { 40 | "promptType": "define", 41 | "text": "=你是个翻译专家,会把 内容:{{ $json.content }},翻译成语言:{{ $json.language }}。 只输出翻译后内容,不输出其他信息" 42 | }, 43 | "type": "@n8n/n8n-nodes-langchain.chainLlm", 44 | "typeVersion": 1.6, 45 | "position": [ 46 | 220, 47 | 0 48 | ], 49 | "id": "acf53874-69f4-428d-902b-61ad8dfa94ee", 50 | "name": "多语言翻译" 51 | } 52 | ], 53 | "pinData": {}, 54 | "connections": { 55 | "When Executed by Another Workflow": { 56 | "main": [ 57 | [ 58 | { 59 | "node": "多语言翻译", 60 | "type": "main", 61 | "index": 0 62 | } 63 | ] 64 | ] 65 | }, 66 | "xAI Grok Chat Model": { 67 | "ai_languageModel": [ 68 | [ 69 | { 70 | "node": "多语言翻译", 71 | "type": "ai_languageModel", 72 | "index": 0 73 | } 74 | ] 75 | ] 76 | } 77 | }, 78 | "active": false, 79 | "settings": { 80 | "executionOrder": "v1" 81 | }, 82 | "versionId": "bb2c3de8-f28e-4b25-a620-036f1bd123db", 83 | "meta": { 84 | "templateCredsSetupCompleted": true, 85 | "instanceId": "6d3339a455de9042f2e878a695f7deb5f4532f35c5c36b32185be750c732f184" 86 | }, 87 | "id": "E88FuwvJfSfnj5Pa", 88 | "tags": [] 89 | } -------------------------------------------------------------------------------- /n8n/series/WebAPI_Server_Demo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "WebAPI Server Demo", 3 | "nodes": [ 4 | { 5 | "parameters": { 6 | "rules": { 7 | "values": [ 8 | { 9 | "conditions": { 10 | "options": { 11 | "caseSensitive": true, 12 | "leftValue": "", 13 | "typeValidation": "strict", 14 | "version": 2 15 | }, 16 | "conditions": [ 17 | { 18 | "leftValue": "={{ $json.body.method }}", 19 | "rightValue": "Multiply", 20 | "operator": { 21 | "type": "string", 22 | "operation": "equals" 23 | }, 24 | "id": "84f3562a-1e3c-4e20-8601-ec3d2a5f3dc5" 25 | } 26 | ], 27 | "combinator": "and" 28 | } 29 | }, 30 | { 31 | "conditions": { 32 | "options": { 33 | "caseSensitive": true, 34 | "leftValue": "", 35 | "typeValidation": "strict", 36 | "version": 2 37 | }, 38 | "conditions": [ 39 | { 40 | "id": "386544cc-7346-40e8-ab6f-906c2ad8f796", 41 | "leftValue": "={{ $json.body.method }}", 42 | "rightValue": "Plus", 43 | "operator": { 44 | "type": "string", 45 | "operation": "equals", 46 | "name": "filter.operator.equals" 47 | } 48 | } 49 | ], 50 | "combinator": "and" 51 | } 52 | } 53 | ] 54 | }, 55 | "options": {} 56 | }, 57 | "type": "n8n-nodes-base.switch", 58 | "typeVersion": 3.2, 59 | "position": [ 60 | -1640, 61 | -280 62 | ], 63 | "id": "2badeb10-f849-4eab-b649-243e8d5884fe", 64 | "name": "Switch" 65 | }, 66 | { 67 | "parameters": { 68 | "workflowId": { 69 | "__rl": true, 70 | "value": "7rc5OeZVf1NgP8Fd", 71 | "mode": "list", 72 | "cachedResultName": "SubFlow: 加法" 73 | }, 74 | "workflowInputs": { 75 | "mappingMode": "defineBelow", 76 | "value": { 77 | "num2": "={{ $json.body.num2 }}", 78 | "num1": "={{ $json.body.num1 }}" 79 | }, 80 | "matchingColumns": [], 81 | "schema": [ 82 | { 83 | "id": "num1", 84 | "displayName": "num1", 85 | "required": false, 86 | "defaultMatch": false, 87 | "display": true, 88 | "canBeUsedToMatch": true, 89 | "type": "number", 90 | "removed": false 91 | }, 92 | { 93 | "id": "num2", 94 | "displayName": "num2", 95 | "required": false, 96 | "defaultMatch": false, 97 | "display": true, 98 | "canBeUsedToMatch": true, 99 | "type": "number", 100 | "removed": false 101 | } 102 | ], 103 | "attemptToConvertTypes": false, 104 | "convertFieldsToString": true 105 | }, 106 | "options": {} 107 | }, 108 | "type": "n8n-nodes-base.executeWorkflow", 109 | "typeVersion": 1.2, 110 | "position": [ 111 | -1420, 112 | -200 113 | ], 114 | "id": "68d31307-fb95-4b70-bba6-17257f2d5077", 115 | "name": "调用子流程:加法" 116 | }, 117 | { 118 | "parameters": { 119 | "promptType": "define", 120 | "text": "={{ $json.query.question }}" 121 | }, 122 | "type": "@n8n/n8n-nodes-langchain.chainLlm", 123 | "typeVersion": 1.6, 124 | "position": [ 125 | -1680, 126 | 260 127 | ], 128 | "id": "bf013f78-2f82-48d1-a1ac-0b44571f0188", 129 | "name": "Basic LLM Chain" 130 | }, 131 | { 132 | "parameters": { 133 | "modelName": "models/gemini-2.0-flash", 134 | "options": {} 135 | }, 136 | "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini", 137 | "typeVersion": 1, 138 | "position": [ 139 | -1600, 140 | 380 141 | ], 142 | "id": "f3d8c349-7dd4-4abb-82f6-7522c6a3ff3f", 143 | "name": "Google Gemini Chat Model", 144 | "credentials": { 145 | "googlePalmApi": { 146 | "id": "gLrIWVxIlrS40xWx", 147 | "name": "Google Gemini(PaLM) Api account" 148 | } 149 | } 150 | }, 151 | { 152 | "parameters": { 153 | "respondWith": "text", 154 | "responseBody": "={{ new Date().toLocaleString('zh-CN') + \": \" + $json.text }}", 155 | "options": {} 156 | }, 157 | "type": "n8n-nodes-base.respondToWebhook", 158 | "typeVersion": 1.1, 159 | "position": [ 160 | -1360, 161 | 260 162 | ], 163 | "id": "a5bc65d1-1165-494d-b497-45febc7597ff", 164 | "name": "Respond to Webhook" 165 | }, 166 | { 167 | "parameters": { 168 | "path": "Labs", 169 | "responseMode": "lastNode", 170 | "options": {} 171 | }, 172 | "type": "n8n-nodes-base.webhook", 173 | "typeVersion": 2, 174 | "position": [ 175 | -1860, 176 | 20 177 | ], 178 | "id": "b449e60b-42be-49ce-8f63-e9a2ab6ad0d1", 179 | "name": "Webhook: Get: Labs", 180 | "webhookId": "a6db53d9-5d9e-48fe-ab4d-f0fb9f7b4386" 181 | }, 182 | { 183 | "parameters": { 184 | "httpMethod": "POST", 185 | "path": "Labs", 186 | "responseMode": "lastNode", 187 | "options": {} 188 | }, 189 | "type": "n8n-nodes-base.webhook", 190 | "typeVersion": 2, 191 | "position": [ 192 | -1860, 193 | -280 194 | ], 195 | "id": "96b83520-2612-4b6b-ac87-702864dd20be", 196 | "name": "Webhook:Post: Labs", 197 | "webhookId": "c0b160c2-07aa-424e-a003-37294e5b5a03" 198 | }, 199 | { 200 | "parameters": { 201 | "content": "POST方法,BODY为JSON数据,路径Labs,使用method字段做分支判定", 202 | "height": 360, 203 | "width": 760, 204 | "color": 3 205 | }, 206 | "type": "n8n-nodes-base.stickyNote", 207 | "typeVersion": 1, 208 | "position": [ 209 | -1960, 210 | -400 211 | ], 212 | "id": "58286176-f8c0-4ea8-8028-7023caee9e3d", 213 | "name": "Sticky Note", 214 | "disabled": true 215 | }, 216 | { 217 | "parameters": { 218 | "content": "GET方法,路径Labs,使用num1和num2两个参数", 219 | "height": 200, 220 | "width": 760 221 | }, 222 | "type": "n8n-nodes-base.stickyNote", 223 | "typeVersion": 1, 224 | "position": [ 225 | -1960, 226 | -20 227 | ], 228 | "id": "9d9f06f2-c71c-4cf7-86b2-ee91f49bcda5", 229 | "name": "Sticky Note1", 230 | "disabled": true 231 | }, 232 | { 233 | "parameters": { 234 | "content": "Get方法,路径Labs/Chat,参数Question", 235 | "height": 320, 236 | "width": 760 237 | }, 238 | "type": "n8n-nodes-base.stickyNote", 239 | "typeVersion": 1, 240 | "position": [ 241 | -1960, 242 | 200 243 | ], 244 | "id": "c4792472-7875-4642-a716-19b36f1ed143", 245 | "name": "Sticky Note2", 246 | "disabled": true 247 | }, 248 | { 249 | "parameters": { 250 | "path": "Labs/Chat", 251 | "responseMode": "responseNode", 252 | "options": {} 253 | }, 254 | "type": "n8n-nodes-base.webhook", 255 | "typeVersion": 2, 256 | "position": [ 257 | -1860, 258 | 260 259 | ], 260 | "id": "6559a1b3-a7fa-4eb6-b152-0ce7337ce709", 261 | "name": "Webhook: Get: AILabs", 262 | "webhookId": "a6db53d9-5d9e-48fe-ab4d-f0fb9f7b4386" 263 | }, 264 | { 265 | "parameters": { 266 | "workflowId": { 267 | "__rl": true, 268 | "value": "E88FuwvJfSfnj5Pa", 269 | "mode": "list", 270 | "cachedResultName": "SubFlow: 翻译" 271 | }, 272 | "workflowInputs": { 273 | "mappingMode": "defineBelow", 274 | "value": { 275 | "content": "={{ $json.query.content }}", 276 | "language": "={{ $json.query.language }}" 277 | }, 278 | "matchingColumns": [], 279 | "schema": [ 280 | { 281 | "id": "content", 282 | "displayName": "content", 283 | "required": false, 284 | "defaultMatch": false, 285 | "display": true, 286 | "canBeUsedToMatch": true, 287 | "type": "string", 288 | "removed": false 289 | }, 290 | { 291 | "id": "language", 292 | "displayName": "language", 293 | "required": false, 294 | "defaultMatch": false, 295 | "display": true, 296 | "canBeUsedToMatch": true, 297 | "type": "string", 298 | "removed": false 299 | } 300 | ], 301 | "attemptToConvertTypes": true, 302 | "convertFieldsToString": true 303 | }, 304 | "options": {} 305 | }, 306 | "type": "n8n-nodes-base.executeWorkflow", 307 | "typeVersion": 1.2, 308 | "position": [ 309 | -1420, 310 | 20 311 | ], 312 | "id": "7bb6bbc7-8bee-4734-95cf-8492297911b0", 313 | "name": "调用子流程:翻译" 314 | }, 315 | { 316 | "parameters": { 317 | "workflowId": { 318 | "__rl": true, 319 | "value": "svnAhhdWf0VQFKEj", 320 | "mode": "list", 321 | "cachedResultName": "SubFlow: 乘法" 322 | }, 323 | "workflowInputs": { 324 | "mappingMode": "defineBelow", 325 | "value": { 326 | "num2": "={{ $json.body.num2 }}", 327 | "num1": "={{ $json.body.num1 }}" 328 | }, 329 | "matchingColumns": [], 330 | "schema": [ 331 | { 332 | "id": "num1", 333 | "displayName": "num1", 334 | "required": false, 335 | "defaultMatch": false, 336 | "display": true, 337 | "canBeUsedToMatch": true, 338 | "type": "number", 339 | "removed": false 340 | }, 341 | { 342 | "id": "num2", 343 | "displayName": "num2", 344 | "required": false, 345 | "defaultMatch": false, 346 | "display": true, 347 | "canBeUsedToMatch": true, 348 | "type": "number", 349 | "removed": false 350 | } 351 | ], 352 | "attemptToConvertTypes": false, 353 | "convertFieldsToString": true 354 | }, 355 | "options": {} 356 | }, 357 | "type": "n8n-nodes-base.executeWorkflow", 358 | "typeVersion": 1.2, 359 | "position": [ 360 | -1420, 361 | -380 362 | ], 363 | "id": "b50b3e85-9f5f-48cb-8c9e-fda49dc94bd5", 364 | "name": "调用子流程:乘法" 365 | } 366 | ], 367 | "pinData": {}, 368 | "connections": { 369 | "Switch": { 370 | "main": [ 371 | [ 372 | { 373 | "node": "调用子流程:乘法", 374 | "type": "main", 375 | "index": 0 376 | } 377 | ], 378 | [ 379 | { 380 | "node": "调用子流程:加法", 381 | "type": "main", 382 | "index": 0 383 | } 384 | ] 385 | ] 386 | }, 387 | "Google Gemini Chat Model": { 388 | "ai_languageModel": [ 389 | [ 390 | { 391 | "node": "Basic LLM Chain", 392 | "type": "ai_languageModel", 393 | "index": 0 394 | } 395 | ] 396 | ] 397 | }, 398 | "Basic LLM Chain": { 399 | "main": [ 400 | [ 401 | { 402 | "node": "Respond to Webhook", 403 | "type": "main", 404 | "index": 0 405 | } 406 | ] 407 | ] 408 | }, 409 | "Webhook: Get: Labs": { 410 | "main": [ 411 | [ 412 | { 413 | "node": "调用子流程:翻译", 414 | "type": "main", 415 | "index": 0 416 | } 417 | ] 418 | ] 419 | }, 420 | "Webhook:Post: Labs": { 421 | "main": [ 422 | [ 423 | { 424 | "node": "Switch", 425 | "type": "main", 426 | "index": 0 427 | } 428 | ] 429 | ] 430 | }, 431 | "Webhook: Get: AILabs": { 432 | "main": [ 433 | [ 434 | { 435 | "node": "Basic LLM Chain", 436 | "type": "main", 437 | "index": 0 438 | } 439 | ] 440 | ] 441 | } 442 | }, 443 | "active": true, 444 | "settings": { 445 | "executionOrder": "v1" 446 | }, 447 | "versionId": "9850b5d3-a67a-4a5f-aad6-bb770e36a8ed", 448 | "meta": { 449 | "templateCredsSetupCompleted": true, 450 | "instanceId": "6d3339a455de9042f2e878a695f7deb5f4532f35c5c36b32185be750c732f184" 451 | }, 452 | "id": "FJShRs5l1T3ldwUx", 453 | "tags": [] 454 | } -------------------------------------------------------------------------------- /n8n/series/日历查询.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "日历查询", 3 | "nodes": [ 4 | { 5 | "parameters": { 6 | "public": true, 7 | "initialMessages": "你好,我是你的日程助力。你有什么需要帮忙的嘛?", 8 | "options": {} 9 | }, 10 | "type": "@n8n/n8n-nodes-langchain.chatTrigger", 11 | "typeVersion": 1.1, 12 | "position": [ 13 | 0, 14 | 0 15 | ], 16 | "id": "2a8dca82-4a54-4134-b65e-1d8ea5d00856", 17 | "name": "When chat message received", 18 | "webhookId": "dbd21511-163a-4305-a389-86e3807dc66c" 19 | }, 20 | { 21 | "parameters": { 22 | "options": { 23 | "systemMessage": "={{ \"当前时间\" + new Date().toLocaleString() + \", 你可以帮用户查看他的日历,也可以帮他在日历做新的安排。\"}}" 24 | } 25 | }, 26 | "type": "@n8n/n8n-nodes-langchain.agent", 27 | "typeVersion": 1.8, 28 | "position": [ 29 | 380, 30 | 0 31 | ], 32 | "id": "461d8a1f-672f-4016-9a6d-9d5dec648809", 33 | "name": "AI Agent" 34 | }, 35 | { 36 | "parameters": {}, 37 | "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow", 38 | "typeVersion": 1.3, 39 | "position": [ 40 | 340, 41 | 220 42 | ], 43 | "id": "aa72fd6a-3165-4f3c-b2b5-a44e6d973ff3", 44 | "name": "Simple Memory" 45 | }, 46 | { 47 | "parameters": { 48 | "calendar": { 49 | "__rl": true, 50 | "value": "william.q.chan@gmail.com", 51 | "mode": "list", 52 | "cachedResultName": "陈秋余个人" 53 | }, 54 | "start": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Start', ``, 'string') }}", 55 | "end": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('End', ``, 'string') }}", 56 | "additionalFields": { 57 | "description": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Description', ``, 'string') }}" 58 | } 59 | }, 60 | "type": "n8n-nodes-base.googleCalendarTool", 61 | "typeVersion": 1.3, 62 | "position": [ 63 | 520, 64 | 220 65 | ], 66 | "id": "b625da25-257b-4680-85f0-5e7989cdbef8", 67 | "name": "Google Calendar", 68 | "credentials": { 69 | "googleCalendarOAuth2Api": { 70 | "id": "GOeD4KHGaR4x23kQ", 71 | "name": "Google Calendar account" 72 | } 73 | } 74 | }, 75 | { 76 | "parameters": { 77 | "operation": "getAll", 78 | "calendar": { 79 | "__rl": true, 80 | "value": "william.q.chan@gmail.com", 81 | "mode": "list", 82 | "cachedResultName": "陈秋余个人" 83 | }, 84 | "returnAll": true, 85 | "timeMin": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('After', ``, 'string') }}", 86 | "timeMax": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Before', ``, 'string') }}", 87 | "options": {} 88 | }, 89 | "type": "n8n-nodes-base.googleCalendarTool", 90 | "typeVersion": 1.3, 91 | "position": [ 92 | 700, 93 | 220 94 | ], 95 | "id": "f935adf7-3ff0-47bb-91e0-af3361426f83", 96 | "name": "Google Calendar1", 97 | "credentials": { 98 | "googleCalendarOAuth2Api": { 99 | "id": "GOeD4KHGaR4x23kQ", 100 | "name": "Google Calendar account" 101 | } 102 | } 103 | }, 104 | { 105 | "parameters": { 106 | "model": "meta-llama/llama-4-scout-17b-16e-instruct", 107 | "options": {} 108 | }, 109 | "type": "@n8n/n8n-nodes-langchain.lmChatGroq", 110 | "typeVersion": 1, 111 | "position": [ 112 | 220, 113 | 220 114 | ], 115 | "id": "3e61cc4e-933e-4f9a-82d8-8290141b5f55", 116 | "name": "Groq Chat Model", 117 | "credentials": { 118 | "groqApi": { 119 | "id": "ZquPOw8nAtsh2aNj", 120 | "name": "Groq account" 121 | } 122 | } 123 | } 124 | ], 125 | "pinData": {}, 126 | "connections": { 127 | "When chat message received": { 128 | "main": [ 129 | [ 130 | { 131 | "node": "AI Agent", 132 | "type": "main", 133 | "index": 0 134 | } 135 | ] 136 | ] 137 | }, 138 | "Simple Memory": { 139 | "ai_memory": [ 140 | [ 141 | { 142 | "node": "AI Agent", 143 | "type": "ai_memory", 144 | "index": 0 145 | } 146 | ] 147 | ] 148 | }, 149 | "Google Calendar": { 150 | "ai_tool": [ 151 | [ 152 | { 153 | "node": "AI Agent", 154 | "type": "ai_tool", 155 | "index": 0 156 | } 157 | ] 158 | ] 159 | }, 160 | "Google Calendar1": { 161 | "ai_tool": [ 162 | [ 163 | { 164 | "node": "AI Agent", 165 | "type": "ai_tool", 166 | "index": 0 167 | } 168 | ] 169 | ] 170 | }, 171 | "Groq Chat Model": { 172 | "ai_languageModel": [ 173 | [ 174 | { 175 | "node": "AI Agent", 176 | "type": "ai_languageModel", 177 | "index": 0 178 | } 179 | ] 180 | ] 181 | } 182 | }, 183 | "active": false, 184 | "settings": { 185 | "executionOrder": "v1" 186 | }, 187 | "versionId": "0eb92a65-3eeb-47a4-8f07-958ef5d7c337", 188 | "meta": { 189 | "templateCredsSetupCompleted": true, 190 | "instanceId": "6d3339a455de9042f2e878a695f7deb5f4532f35c5c36b32185be750c732f184" 191 | }, 192 | "id": "Z6Wn0fUp1wZG9eVn", 193 | "tags": [] 194 | } -------------------------------------------------------------------------------- /n8n/series/社区MCP高德.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "社区MCP高德", 3 | "nodes": [ 4 | { 5 | "parameters": { 6 | "public": true, 7 | "options": {} 8 | }, 9 | "type": "@n8n/n8n-nodes-langchain.chatTrigger", 10 | "typeVersion": 1.1, 11 | "position": [ 12 | -160, 13 | 0 14 | ], 15 | "id": "acf9e7f9-c637-4634-b7e2-a2a78ad07579", 16 | "name": "When chat message received", 17 | "webhookId": "29d66e26-20f4-4645-a7df-ffe1ba83a2c0" 18 | }, 19 | { 20 | "parameters": { 21 | "options": { 22 | "systemMessage": "=目前北京时间:{{ new Date().toLocaleString('zh-CN') }}。\n在使用工具之前,你必须先尝试找出你可以使用的工具。\n对于复杂的任务,你必须制定一个逐步执行的计划,并在每次迭代中检查工具集,然后执行,直到你成功完成整个任务。\n- 使用高德地图(Amap-map)进行天气预报和地图服务。\t\n- 使用MiniMax的文本转语音功能来创建语音播报,或者通过提示词生成图像。", 23 | "maxIterations": 10 24 | } 25 | }, 26 | "type": "@n8n/n8n-nodes-langchain.agent", 27 | "typeVersion": 1.8, 28 | "position": [ 29 | 280, 30 | 0 31 | ], 32 | "id": "11429d66-c76f-4671-b205-05490a21cb93", 33 | "name": "AI Agent" 34 | }, 35 | { 36 | "parameters": { 37 | "connectionType": "sse", 38 | "operation": "executeTool", 39 | "toolName": "={{ $fromAI(\"tool\") }}", 40 | "toolParameters": "={{$fromAI(\"Tool_Parameters\",``, 'json')}}" 41 | }, 42 | "type": "n8n-nodes-mcp.mcpClientTool", 43 | "typeVersion": 1, 44 | "position": [ 45 | 280, 46 | 220 47 | ], 48 | "id": "5e2aa40a-9a39-496f-8c3c-078ba07d1ea2", 49 | "name": "Amap-maps Execute", 50 | "credentials": { 51 | "mcpClientSseApi": { 52 | "id": "WmS9Jo5RlzxFOuga", 53 | "name": "MCP:高德地图" 54 | } 55 | } 56 | }, 57 | { 58 | "parameters": { 59 | "descriptionType": "manual", 60 | "toolDescription": "获取Amap-map的可用工具集", 61 | "connectionType": "sse" 62 | }, 63 | "type": "n8n-nodes-mcp.mcpClientTool", 64 | "typeVersion": 1, 65 | "position": [ 66 | 460, 67 | 220 68 | ], 69 | "id": "32532321-ec28-47eb-a01e-2af4376947e5", 70 | "name": "Amap-maps Tool", 71 | "credentials": { 72 | "mcpClientSseApi": { 73 | "id": "WmS9Jo5RlzxFOuga", 74 | "name": "MCP:高德地图" 75 | } 76 | } 77 | }, 78 | { 79 | "parameters": { 80 | "connectionType": "sse" 81 | }, 82 | "type": "n8n-nodes-mcp.mcpClientTool", 83 | "typeVersion": 1, 84 | "position": [ 85 | 600, 86 | 220 87 | ], 88 | "id": "c367fc0b-60e3-4d1c-908d-4b24c1c01f0b", 89 | "name": "MiniMax Tool", 90 | "credentials": { 91 | "mcpClientSseApi": { 92 | "id": "epUW1kQde8kwa77b", 93 | "name": "MCP:MiniMax" 94 | } 95 | } 96 | }, 97 | { 98 | "parameters": { 99 | "connectionType": "sse", 100 | "operation": "executeTool", 101 | "toolName": "={{ $fromAI(\"tool\") }}", 102 | "toolParameters": "={{$fromAI(\"Tool_Parameters\",``, 'json')}}" 103 | }, 104 | "type": "n8n-nodes-mcp.mcpClientTool", 105 | "typeVersion": 1, 106 | "position": [ 107 | 740, 108 | 220 109 | ], 110 | "id": "cc4845cf-5490-43bf-b4bd-6616a7a8906d", 111 | "name": "MiniMax Execute", 112 | "credentials": { 113 | "mcpClientSseApi": { 114 | "id": "epUW1kQde8kwa77b", 115 | "name": "MCP:MiniMax" 116 | } 117 | } 118 | }, 119 | { 120 | "parameters": {}, 121 | "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow", 122 | "typeVersion": 1.3, 123 | "position": [ 124 | 80, 125 | 220 126 | ], 127 | "id": "6dd1efe1-fb4b-4e99-9e53-0c0cd6d69b88", 128 | "name": "Simple Memory" 129 | }, 130 | { 131 | "parameters": { 132 | "model": "openai/gpt-4.1-mini", 133 | "options": {} 134 | }, 135 | "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter", 136 | "typeVersion": 1, 137 | "position": [ 138 | -100, 139 | 220 140 | ], 141 | "id": "e24015ab-19df-436d-8805-a34baa2096be", 142 | "name": "OpenRouter Chat Model", 143 | "credentials": { 144 | "openRouterApi": { 145 | "id": "lo6umqKV2VIyOzLb", 146 | "name": "OpenRouter account" 147 | } 148 | } 149 | } 150 | ], 151 | "pinData": {}, 152 | "connections": { 153 | "When chat message received": { 154 | "main": [ 155 | [ 156 | { 157 | "node": "AI Agent", 158 | "type": "main", 159 | "index": 0 160 | } 161 | ] 162 | ] 163 | }, 164 | "AI Agent": { 165 | "main": [ 166 | [] 167 | ] 168 | }, 169 | "Amap-maps Execute": { 170 | "ai_tool": [ 171 | [ 172 | { 173 | "node": "AI Agent", 174 | "type": "ai_tool", 175 | "index": 0 176 | } 177 | ] 178 | ] 179 | }, 180 | "Amap-maps Tool": { 181 | "ai_tool": [ 182 | [ 183 | { 184 | "node": "AI Agent", 185 | "type": "ai_tool", 186 | "index": 0 187 | } 188 | ] 189 | ] 190 | }, 191 | "MiniMax Tool": { 192 | "ai_tool": [ 193 | [ 194 | { 195 | "node": "AI Agent", 196 | "type": "ai_tool", 197 | "index": 0 198 | } 199 | ] 200 | ] 201 | }, 202 | "MiniMax Execute": { 203 | "ai_tool": [ 204 | [ 205 | { 206 | "node": "AI Agent", 207 | "type": "ai_tool", 208 | "index": 0 209 | } 210 | ] 211 | ] 212 | }, 213 | "Simple Memory": { 214 | "ai_memory": [ 215 | [ 216 | { 217 | "node": "AI Agent", 218 | "type": "ai_memory", 219 | "index": 0 220 | } 221 | ] 222 | ] 223 | }, 224 | "OpenRouter Chat Model": { 225 | "ai_languageModel": [ 226 | [ 227 | { 228 | "node": "AI Agent", 229 | "type": "ai_languageModel", 230 | "index": 0 231 | } 232 | ] 233 | ] 234 | } 235 | }, 236 | "active": false, 237 | "settings": { 238 | "executionOrder": "v1" 239 | }, 240 | "versionId": "0ae95a14-9636-4d06-a3a6-c0c518f70f89", 241 | "meta": { 242 | "templateCredsSetupCompleted": true, 243 | "instanceId": "6d3339a455de9042f2e878a695f7deb5f4532f35c5c36b32185be750c732f184" 244 | }, 245 | "id": "MlAhDCGN7Mvm4Qiy", 246 | "tags": [] 247 | } -------------------------------------------------------------------------------- /n8n/series/社区MCP高德手动.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "社区节点: MCP Client", 3 | "nodes": [ 4 | { 5 | "parameters": { 6 | "public": true, 7 | "options": {} 8 | }, 9 | "type": "@n8n/n8n-nodes-langchain.chatTrigger", 10 | "typeVersion": 1.1, 11 | "position": [ 12 | -660, 13 | -140 14 | ], 15 | "id": "1e749271-43c5-4761-b720-bc8dd83f8b25", 16 | "name": "When chat message received", 17 | "webhookId": "cc6c43de-8b35-4203-919e-1dc792f18c48" 18 | }, 19 | { 20 | "parameters": { 21 | "connectionType": "sse", 22 | "operation": "executeTool", 23 | "toolName": "=maps_geo", 24 | "toolParameters": "={ \"address\": \"{{ $('抽取起点/终点').item.json.output.from }}\", \"city\":\"成都市\"}" 25 | }, 26 | "type": "n8n-nodes-mcp.mcpClient", 27 | "typeVersion": 1, 28 | "position": [ 29 | 40, 30 | -140 31 | ], 32 | "id": "f79e7ac8-9d30-428e-a2b6-b3ec18644a14", 33 | "name": "MCP:获取起点经纬度", 34 | "credentials": { 35 | "mcpClientSseApi": { 36 | "id": "WmS9Jo5RlzxFOuga", 37 | "name": "MCP:高德地图" 38 | } 39 | } 40 | }, 41 | { 42 | "parameters": { 43 | "connectionType": "sse", 44 | "operation": "executeTool", 45 | "toolName": "=maps_geo", 46 | "toolParameters": "={ \"address\": \"{{ $('抽取起点/终点').item.json.output.to }}\", \"city\":\"成都市\"}" 47 | }, 48 | "type": "n8n-nodes-mcp.mcpClient", 49 | "typeVersion": 1, 50 | "position": [ 51 | 220, 52 | -140 53 | ], 54 | "id": "a66a6390-d7b0-49c4-9999-41bcd0491a2d", 55 | "name": "MCP:获取终点经纬度", 56 | "credentials": { 57 | "mcpClientSseApi": { 58 | "id": "WmS9Jo5RlzxFOuga", 59 | "name": "MCP:高德地图" 60 | } 61 | } 62 | }, 63 | { 64 | "parameters": { 65 | "connectionType": "sse" 66 | }, 67 | "type": "n8n-nodes-mcp.mcpClient", 68 | "typeVersion": 1, 69 | "position": [ 70 | -160, 71 | -140 72 | ], 73 | "id": "f718da44-2fcf-4b66-8cc5-729d6af36715", 74 | "name": "MCP:Amap Tool", 75 | "credentials": { 76 | "mcpClientSseApi": { 77 | "id": "WmS9Jo5RlzxFOuga", 78 | "name": "MCP:高德地图" 79 | } 80 | }, 81 | "disabled": true 82 | }, 83 | { 84 | "parameters": { 85 | "text": "={{ $('MCP:获取起点经纬度').item.json.result.content[0].text }}|{{ $json.result.content[0].text }}", 86 | "schemaType": "fromJson", 87 | "jsonSchemaExample": "{\n \"from\" :{\n \"province\": \"四川省\",\n \"city\": \"成都市\",\n\t\"location\": \"104.065861,30.657401\"},\n \"to\" :{\n \"province\": \"四川省\",\n \"city\": \"成都市\",\n\t\"location\": \"104.065861,30.657401\"}\n}", 88 | "options": {} 89 | }, 90 | "type": "@n8n/n8n-nodes-langchain.informationExtractor", 91 | "typeVersion": 1, 92 | "position": [ 93 | 380, 94 | -140 95 | ], 96 | "id": "3df1c68f-3e91-45db-8d98-234642ef72f3", 97 | "name": "提取起点经纬度" 98 | }, 99 | { 100 | "parameters": { 101 | "connectionType": "sse", 102 | "operation": "executeTool", 103 | "toolName": "=maps_bicycling", 104 | "toolParameters": "={ \"origin\": \"{{ $json.output.from.location }}\", \"destination\":\"{{ $json.output.to.location }}\"}" 105 | }, 106 | "type": "n8n-nodes-mcp.mcpClient", 107 | "typeVersion": 1, 108 | "position": [ 109 | 700, 110 | -140 111 | ], 112 | "id": "d17cc23f-8316-4f87-b775-24e2dd2f6834", 113 | "name": "MCP:导航", 114 | "credentials": { 115 | "mcpClientSseApi": { 116 | "id": "WmS9Jo5RlzxFOuga", 117 | "name": "MCP:高德地图" 118 | } 119 | } 120 | }, 121 | { 122 | "parameters": { 123 | "chunkingMode": "advanced", 124 | "options": { 125 | "summarizationMethodAndPrompts": { 126 | "values": { 127 | "summarizationMethod": "stuff", 128 | "prompt": "用中文整理骑行路线,需要说明起点和终点\n\"{text}\"\n" 129 | } 130 | } 131 | } 132 | }, 133 | "type": "@n8n/n8n-nodes-langchain.chainSummarization", 134 | "typeVersion": 2, 135 | "position": [ 136 | 880, 137 | -140 138 | ], 139 | "id": "e6587cda-74c6-408c-9eb6-9e53795996f5", 140 | "name": "整理并输出" 141 | }, 142 | { 143 | "parameters": { 144 | "model": { 145 | "__rl": true, 146 | "value": "Pro/deepseek-ai/DeepSeek-V3", 147 | "mode": "list", 148 | "cachedResultName": "Pro/deepseek-ai/DeepSeek-V3" 149 | }, 150 | "options": {} 151 | }, 152 | "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", 153 | "typeVersion": 1.2, 154 | "position": [ 155 | 20, 156 | 100 157 | ], 158 | "id": "4e66f8f2-dfda-478a-bd29-28ebde13b80a", 159 | "name": "OpenAI Chat Model", 160 | "credentials": { 161 | "openAiApi": { 162 | "id": "XThOsUMK75kBb1n7", 163 | "name": "OneHub" 164 | } 165 | } 166 | }, 167 | { 168 | "parameters": { 169 | "text": "={{ $json.chatInput }}", 170 | "schemaType": "fromJson", 171 | "jsonSchemaExample": "{\n\t\"from\": \"California\",\n\t\"to\": \"Los Angeles\"\n}", 172 | "options": {} 173 | }, 174 | "type": "@n8n/n8n-nodes-langchain.informationExtractor", 175 | "typeVersion": 1, 176 | "position": [ 177 | -480, 178 | -140 179 | ], 180 | "id": "001c8cf7-d478-4820-abc9-587590e8e15e", 181 | "name": "抽取起点/终点" 182 | } 183 | ], 184 | "pinData": {}, 185 | "connections": { 186 | "When chat message received": { 187 | "main": [ 188 | [ 189 | { 190 | "node": "抽取起点/终点", 191 | "type": "main", 192 | "index": 0 193 | } 194 | ] 195 | ] 196 | }, 197 | "MCP:获取起点经纬度": { 198 | "main": [ 199 | [ 200 | { 201 | "node": "MCP:获取终点经纬度", 202 | "type": "main", 203 | "index": 0 204 | } 205 | ] 206 | ] 207 | }, 208 | "MCP:获取终点经纬度": { 209 | "main": [ 210 | [ 211 | { 212 | "node": "提取起点经纬度", 213 | "type": "main", 214 | "index": 0 215 | } 216 | ] 217 | ] 218 | }, 219 | "MCP:Amap Tool": { 220 | "main": [ 221 | [ 222 | { 223 | "node": "MCP:获取起点经纬度", 224 | "type": "main", 225 | "index": 0 226 | } 227 | ] 228 | ] 229 | }, 230 | "提取起点经纬度": { 231 | "main": [ 232 | [ 233 | { 234 | "node": "MCP:导航", 235 | "type": "main", 236 | "index": 0 237 | } 238 | ] 239 | ] 240 | }, 241 | "MCP:导航": { 242 | "main": [ 243 | [ 244 | { 245 | "node": "整理并输出", 246 | "type": "main", 247 | "index": 0 248 | } 249 | ] 250 | ] 251 | }, 252 | "OpenAI Chat Model": { 253 | "ai_languageModel": [ 254 | [ 255 | { 256 | "node": "抽取起点/终点", 257 | "type": "ai_languageModel", 258 | "index": 0 259 | }, 260 | { 261 | "node": "提取起点经纬度", 262 | "type": "ai_languageModel", 263 | "index": 0 264 | }, 265 | { 266 | "node": "整理并输出", 267 | "type": "ai_languageModel", 268 | "index": 0 269 | } 270 | ] 271 | ] 272 | }, 273 | "抽取起点/终点": { 274 | "main": [ 275 | [ 276 | { 277 | "node": "MCP:Amap Tool", 278 | "type": "main", 279 | "index": 0 280 | } 281 | ] 282 | ] 283 | } 284 | }, 285 | "active": false, 286 | "settings": { 287 | "executionOrder": "v1" 288 | }, 289 | "versionId": "01f43197-69df-4331-b171-d672a42e9398", 290 | "meta": { 291 | "templateCredsSetupCompleted": true, 292 | "instanceId": "6d3339a455de9042f2e878a695f7deb5f4532f35c5c36b32185be750c732f184" 293 | }, 294 | "id": "2xiRDJuO5rvKNdgg", 295 | "tags": [] 296 | } -------------------------------------------------------------------------------- /n8n/series/高德地图MCP.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "地图MCP", 3 | "nodes": [ 4 | { 5 | "parameters": { 6 | "public": true, 7 | "initialMessages": "你好,我是你的日程助力。你有什么需要帮忙的嘛?", 8 | "options": {} 9 | }, 10 | "type": "@n8n/n8n-nodes-langchain.chatTrigger", 11 | "typeVersion": 1.1, 12 | "position": [ 13 | 100, 14 | 0 15 | ], 16 | "id": "04a6e378-987b-46ff-8384-834fb2ad55e8", 17 | "name": "When chat message received", 18 | "webhookId": "579ba641-8960-423d-a3b7-83f7fe283725" 19 | }, 20 | { 21 | "parameters": { 22 | "options": { 23 | "systemMessage": "={{ \"当前时间\" + new Date().toLocaleString() }}\n你是AI助手,你会使用各种MCP Tool来帮助你完成任务。\n你可以多次操作最终完成用户的任务。", 24 | "maxIterations": 10, 25 | "returnIntermediateSteps": false 26 | } 27 | }, 28 | "type": "@n8n/n8n-nodes-langchain.agent", 29 | "typeVersion": 1.8, 30 | "position": [ 31 | 380, 32 | 0 33 | ], 34 | "id": "1ffc2ae8-c8b0-4aa0-b81c-ebbb4c60599e", 35 | "name": "AI Agent" 36 | }, 37 | { 38 | "parameters": { 39 | "contextWindowLength": 10 40 | }, 41 | "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow", 42 | "typeVersion": 1.3, 43 | "position": [ 44 | 480, 45 | 220 46 | ], 47 | "id": "f5bd728a-432b-4072-a5b7-cf35ca5eb9dc", 48 | "name": "Simple Memory" 49 | }, 50 | { 51 | "parameters": { 52 | "sseEndpoint": "https://mcp.amap.com/sse?key=0feedd194c206c90a4a756f5f5b203d6" 53 | }, 54 | "type": "@n8n/n8n-nodes-langchain.mcpClientTool", 55 | "typeVersion": 1, 56 | "position": [ 57 | 660, 58 | 220 59 | ], 60 | "id": "cbcc6445-7040-4189-ba8a-e187081fd198", 61 | "name": "MCP:Amap Tool" 62 | }, 63 | { 64 | "parameters": { 65 | "model": "grok-3-beta", 66 | "options": {} 67 | }, 68 | "type": "@n8n/n8n-nodes-langchain.lmChatXAiGrok", 69 | "typeVersion": 1, 70 | "position": [ 71 | 200, 72 | 220 73 | ], 74 | "id": "084eacc0-04c1-4119-a043-92a3bdcffb49", 75 | "name": "xAI Grok Chat Model", 76 | "credentials": { 77 | "xAiApi": { 78 | "id": "cH0ILaofgvd2SGW1", 79 | "name": "xAi account" 80 | } 81 | } 82 | } 83 | ], 84 | "pinData": {}, 85 | "connections": { 86 | "When chat message received": { 87 | "main": [ 88 | [ 89 | { 90 | "node": "AI Agent", 91 | "type": "main", 92 | "index": 0 93 | } 94 | ] 95 | ] 96 | }, 97 | "Simple Memory": { 98 | "ai_memory": [ 99 | [ 100 | { 101 | "node": "AI Agent", 102 | "type": "ai_memory", 103 | "index": 0 104 | } 105 | ] 106 | ] 107 | }, 108 | "MCP:Amap Tool": { 109 | "ai_tool": [ 110 | [ 111 | { 112 | "node": "AI Agent", 113 | "type": "ai_tool", 114 | "index": 0 115 | } 116 | ] 117 | ] 118 | }, 119 | "xAI Grok Chat Model": { 120 | "ai_languageModel": [ 121 | [ 122 | { 123 | "node": "AI Agent", 124 | "type": "ai_languageModel", 125 | "index": 0 126 | } 127 | ] 128 | ] 129 | } 130 | }, 131 | "active": false, 132 | "settings": { 133 | "executionOrder": "v1" 134 | }, 135 | "versionId": "eed5f79a-21fe-4baa-b63a-fe1a5039c0b5", 136 | "meta": { 137 | "templateCredsSetupCompleted": true, 138 | "instanceId": "6d3339a455de9042f2e878a695f7deb5f4532f35c5c36b32185be750c732f184" 139 | }, 140 | "id": "WYJ2HdWcz6LYjznR", 141 | "tags": [] 142 | } --------------------------------------------------------------------------------