8
n8n 中文网amn8n.com

使用n8n和Baserow创建个性化日历视图

中级

这是一个Miscellaneous, Multimodal AI领域的自动化工作流,包含 13 个节点。主要使用 Set, Baserow, HttpRequest, ManualTrigger 等节点。 通过外部日历集成在Baserow中生成筛选日历视图

前置要求
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "5FARC6I3Fg8f95vl",
  "meta": {
    "instanceId": "b97c8825a3007a3e66302afb0a07361282ddc57e738a70b62cba50135240244f",
    "templateCredsSetupCompleted": true
  },
  "name": "使用 n8n 和 Baserow 创建个性化日历视图",
  "tags": [],
  "nodes": [
    {
      "id": "8fe5e096-0787-4492-ba12-0106deb69040",
      "name": "创建令牌",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        640,
        -320
      ],
      "parameters": {
        "url": "={{ $json[\"API host\"] }}/api/user/token-auth/ ",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"email\": \"{{ $json[\"Baserow user\"] }}\",\n  \"password\": \"{{ $json[\"Baserow password\"] }}\"\n}",
        "sendBody": true,
        "specifyBody": "json"
      },
      "typeVersion": 4.2
    },
    {
      "id": "8242ae21-eeb8-4770-b1a2-56cb8dcda8ae",
      "name": "共享视图",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1984,
        -320
      ],
      "parameters": {
        "url": "={{$('Set Baserow credentials').item.json[\"API host\"]}}/api/database/views/{{ $json.view }}/",
        "method": "PATCH",
        "options": {},
        "jsonBody": "={\n  \"ical_public\": true\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "={{ $('Set table and field ids').item.json['JWT Token'] }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "6e2389c4-887d-41d1-8fb1-05ec6e66d2b6",
      "name": "更新 URL",
      "type": "n8n-nodes-base.baserow",
      "position": [
        2208,
        -320
      ],
      "parameters": {
        "rowId": "={{ $('Get all records from filter table').item.json.id }}",
        "tableId": "={{ $('Set table and field ids').item.json[\"Filter table\"] }}",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "={{ $('Set table and field ids').item.json[\"Ics field\"] }}",
              "fieldValue": "={{ $json.ical_feed_url }}"
            },
            {
              "fieldId": "={{ $('Set table and field ids').item.json[\"View link field\"] }}",
              "fieldValue": "=https://baserow.cloudron.getbaserow.com/database/1478/table/{{ $('Set table and field ids').item.json['Date table'] }}/{{ $json.id }}"
            }
          ]
        },
        "operation": "update",
        "databaseId": "={{ $('Set table and field ids').item.json[\"Database ID\"] }}"
      },
      "credentials": {
        "baserowApi": {
          "id": "HgVHAoZFovwlleMD",
          "name": "Baserow SaaS account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "553bca65-18b6-4f7c-aed3-825d24dcbc9d",
      "name": "当点击“执行工作流”时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        192,
        -320
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d8eb647c-e37e-4e6b-b610-d885f736a1aa",
      "name": "设置 Baserow 凭据",
      "type": "n8n-nodes-base.set",
      "position": [
        416,
        -320
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "0f3be469-0daa-42cf-9eef-132796dd65b6",
              "name": "Baserow user",
              "type": "string",
              "value": "<your_username>"
            },
            {
              "id": "7cdacda6-64fa-4de0-9e11-8c353a16b1f3",
              "name": "Baserow password",
              "type": "string",
              "value": "<your_password>"
            },
            {
              "id": "4367d108-f9dc-4790-b081-98026fc960af",
              "name": "API host",
              "type": "string",
              "value": "https://api.baserow.io"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "33022440-77d5-49bd-92ae-697339d38ece",
      "name": "设置表格和字段 ID",
      "type": "n8n-nodes-base.set",
      "position": [
        864,
        -320
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "99f16ae5-a6ad-4c57-a443-b2e820c46995",
              "name": "JWT Token",
              "type": "string",
              "value": "=JWT {{ $json.access_token }}"
            },
            {
              "id": "62b8dd41-ee49-4152-8513-ec2d2ea51c86",
              "name": "Date table",
              "type": "number",
              "value": 671901
            },
            {
              "id": "0f0e697f-7695-44f6-a543-b0db05bfe863",
              "name": "Date field",
              "type": "number",
              "value": 5533823
            },
            {
              "id": "40dcf948-7c16-4354-8e5e-6f2d2c1801ff",
              "name": "Filter field",
              "type": "number",
              "value": 5533824
            },
            {
              "id": "8a999462-a0e1-4c30-bb8e-56f8f76b47c7",
              "name": "Status field",
              "type": "number",
              "value": 5533825
            },
            {
              "id": "cd9461c4-a741-4b6a-bd5a-78e16d8d12d3",
              "name": "Filter table",
              "type": "number",
              "value": "=671897"
            },
            {
              "id": "ebb373eb-b467-40e4-88c0-6bec9ee1e358",
              "name": "Database ID",
              "type": "number",
              "value": 288404
            },
            {
              "id": "e955f70b-7907-41a1-813f-7f5c8a728783",
              "name": "Ics field",
              "type": "string",
              "value": "5533800"
            },
            {
              "id": "a500c9dc-e4c7-4134-8d22-33eb72d6699f",
              "name": "View link field",
              "type": "string",
              "value": "5533805"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "6a904462-086b-4399-bae2-b6bbd44a90da",
      "name": "从筛选表格获取所有记录",
      "type": "n8n-nodes-base.baserow",
      "position": [
        1088,
        -320
      ],
      "parameters": {
        "tableId": "={{ $json[\"Filter table\"] }}",
        "databaseId": "={{$json[\"Database ID\"] }}",
        "additionalOptions": {}
      },
      "credentials": {
        "baserowApi": {
          "id": "HgVHAoZFovwlleMD",
          "name": "Baserow SaaS account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ff4e198b-f2c7-45de-b592-9d52592e695e",
      "name": "创建新日历视图",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1312,
        -320
      ],
      "parameters": {
        "url": "={{$('Set Baserow credentials').item.json[\"API host\"]}}/api/database/views/table/{{ $('Set table and field ids').item.json['Date table'] }}/",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n\"name\": \"Calendar for {{ $json.Name }}\",\n\"type\": \"calendar\",\n\"ownership_type\": \"collaborative\",\n\"filter_type\": \"OR\",\n\"date_field\": {{ $('Set table and field ids').item.json['Date field'] }}\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "={{ $('Set table and field ids').item.json['JWT Token'] }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "4a575169-7bc2-40af-99e0-49526c7485ed",
      "name": "创建筛选器",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1536,
        -320
      ],
      "parameters": {
        "url": "={{$('Set Baserow credentials').item.json[\"API host\"]}}/api/database/views/{{ $('Create new calendar view').item.json.id }}/filters/",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"field\": {{ $('Set table and field ids').item.json['Filter field'] }},\n  \"type\": \"link_row_has\",\n  \"value\": {{ $('Get all records from filter table').item.json.id }}\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "={{ $('Set table and field ids').item.json['JWT Token'] }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "aeb2c293-f21d-4b51-959e-830b476a568f",
      "name": "设置背景颜色",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1760,
        -320
      ],
      "parameters": {
        "url": "={{$('Set Baserow credentials').item.json[\"API host\"]}}/api/database/views/{{ $json.view }}/decorations/",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n\"type\": \"background_color\",\n\"value_provider_type\": \"single_select_color\",\n\"value_provider_conf\": {\n\"field_id\": {{ $('Set table and field ids').item.json['Status field']}}\n},\n\"order\": 1\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "={{ $('Set table and field ids').item.json['JWT Token'] }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "aa0258a7-9f64-454b-bb49-60d145cb92be",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -592,
        -976
      ],
      "parameters": {
        "width": 624,
        "height": 2048,
        "content": "## 使用 n8n 和 Baserow 创建个性化日历视图"
      },
      "typeVersion": 1
    },
    {
      "id": "73f1b096-a887-4fa3-93a8-02b6c7867719",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        320,
        -512
      ],
      "parameters": {
        "color": 7,
        "width": 336,
        "content": "# 认证"
      },
      "typeVersion": 1
    },
    {
      "id": "aebc9dfd-f631-4e85-9536-1919da7cc4dc",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        688,
        -624
      ],
      "parameters": {
        "color": 7,
        "width": 592,
        "height": 272,
        "content": "# 必需表格和字段"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "d30fb5d0-424d-45a5-8bf5-ae78726c833e",
  "connections": {
    "Create filter": {
      "main": [
        [
          {
            "node": "Set background color",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a token": {
      "main": [
        [
          {
            "node": "Set table and field ids",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Share the view": {
      "main": [
        [
          {
            "node": "Update the url's",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set background color": {
      "main": [
        [
          {
            "node": "Share the view",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Baserow credentials": {
      "main": [
        [
          {
            "node": "Create a token",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set table and field ids": {
      "main": [
        [
          {
            "node": "Get all records from filter table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create new calendar view": {
      "main": [
        [
          {
            "node": "Create filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get all records from filter table": {
      "main": [
        [
          {
            "node": "Create new calendar view",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Set Baserow credentials",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 杂项, 多模态 AI

需要付费吗?

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

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

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

作者
Frederik Duchi

Frederik Duchi

@frederikdc

I have a background in software engineering and work as a product specialist at Baserow and already did a lot of implementations for customers where I combine Baserow with n8n.

外部链接
在 n8n.io 查看

分享此工作流