Dynamically create tables in Airtable for your Webflow form submissions

工作流概述

这是一个包含17个节点的复杂工作流,主要用于自动化处理各种任务。

工作流源代码

下载
{
  "id": "IvIzphIxPj1rZ3az",
  "meta": {
    "instanceId": "f0243439e79874c29f002782f736673d3388e5328a2ff2db7dd45820643256f5"
  },
  "name": "Dynamically create tables in Airtable for your Webflow form submissions",
  "tags": [
    {
      "id": "7cKuF8oYmXKMRDsD",
      "name": "webflow",
      "createdAt": "2024-01-09T02:22:11.773Z",
      "updatedAt": "2024-01-09T02:22:11.773Z"
    },
    {
      "id": "rQvbZ2PzC648UvCU",
      "name": "airtable",
      "createdAt": "2024-01-17T09:01:13.833Z",
      "updatedAt": "2024-01-17T09:01:13.833Z"
    }
  ],
  "nodes": [
    {
      "id": "5db273d4-8f40-4e2e-816e-5591dc312c95",
      "name": "Webflow Submission Trigger",
      "type": "n8n-nodes-base.webflowTrigger",
      "position": [
        -1080,
        580
      ],
      "webhookId": "969939dd-09c0-4311-82b8-31bceb6b9532",
      "parameters": {
        "site": "60e6f0f07c46af62aa2b1c98"
      },
      "credentials": {
        "webflowApi": {
          "id": "Nuq6n7zNYTp6iS2m",
          "name": "Webflow Tutum Access"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "fda9755d-7922-4a1f-8200-0195cbb39720",
      "name": "Prepare form submission for workflow",
      "type": "n8n-nodes-base.set",
      "position": [
        -820,
        580
      ],
      "parameters": {
        "mode": "raw",
        "include": "none",
        "options": {},
        "jsonOutput": "={
  \"wf_id\": \"{{ $json._id }}\",
  \"wf_formId\": \"{{ $json.formId }}\",
  \"wf_formName\": \"{{ $json.name }}\",
  \"wf_requestDateTime\": \"{{ $json.d }}\",
  \"wf_data\": {{ JSON.stringify(JSON.stringify($('Webflow Submission Trigger').item.json.data)) }}
}"
      },
      "typeVersion": 3.2
    },
    {
      "id": "2a9d4ac1-8fbf-402f-b9b6-0d0300a1b221",
      "name": "Get Form Index Reference Table ID",
      "type": "n8n-nodes-base.code",
      "position": [
        -300,
        580
      ],
      "parameters": {
        "jsCode": "const data = $input.all();
const floatingObject = $(\"Prepare form submission for workflow\").all()[0].json;

floatingObject.at_baseId = $(\"[AIRTABLE] Get Base Schema from list\").params.base.value;
floatingObject.at_formIndexTableId = null;
floatingObject.at_currentFormTableId = null;
  
if(!floatingObject.at_baseId)
  return null; // no bases configured

for (let index = 0; index < data.length; index++) {
  if(data[index].json.name.toLowerCase() === \"form index\")
  {
    floatingObject.at_formIndexTableId = data[index].json.id;
    break;
  }
}

return floatingObject;

"
      },
      "typeVersion": 2
    },
    {
      "id": "de5ee6bc-3d09-4bd6-9275-61a600a0d334",
      "name": "Does Index Reference Table Exist?",
      "type": "n8n-nodes-base.if",
      "position": [
        -40,
        580
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "4d0077b0-9cd8-4b8f-8548-0162c51e9d61",
              "operator": {
                "type": "string",
                "operation": "contains"
              },
              "leftValue": "={{ $json.at_formIndexTableId }}",
              "rightValue": "=tbl"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "56b20caa-f4e6-44fa-84c5-8a77ef0ce9a0",
      "name": "[AIRTABLE]  Create Index Reference Table",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        460,
        820
      ],
      "parameters": {
        "url": "=https://api.airtable.com/v0/meta/bases/{{ $('Does Index Reference Table Exist?').item.json.at_baseId }}/tables",
        "method": "POST",
        "options": {},
        "jsonBody": "={
    \"name\": \"Form Index\",
    \"fields\": [
        {
            \"name\": \"FormId\",
            \"type\": \"singleLineText\"
        },
        {
            \"name\": \"FormName\",
            \"type\": \"singleLineText\"
        },
        {
            \"name\": \"TableId\",
            \"type\": \"singleLineText\"
        },
        {
            \"name\": \"TableName\",
            \"type\": \"singleLineText\"
        }
    ]
}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "airtableTokenApi"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "vuNVHoaeyE29Fzra",
          "name": "Airtable Personal Access Token For Tutum"
        },
        "airtableOAuth2Api": {
          "id": "yFiIfESsFO8OpQVU",
          "name": "Airtable oAuth"
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "d9cd6051-76ca-46ae-b5d7-8a33001d36f2",
      "name": "[AIRTABLE] Get Base Schema from list",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -540,
        580
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appEKYlGR0xHQdLlj",
          "cachedResultUrl": "https://airtable.com/appEKYlGR0xHQdLlj",
          "cachedResultName": "Webflow Tutum Site"
        },
        "resource": "base",
        "operation": "getSchema"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "vuNVHoaeyE29Fzra",
          "name": "Airtable Personal Access Token For Tutum"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "771ebb7e-2833-47bd-92eb-623da0054246",
      "name": "[AIRTABLE] Create Webflow Form Table",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        700,
        820
      ],
      "parameters": {
        "url": "=https://api.airtable.com/v0/meta/bases/{{ $('Get Form Index Reference Table ID').item.json.at_baseId }}/tables",
        "method": "POST",
        "options": {},
        "jsonBody": "={
    \"name\": \"{{ $('Get Form Index Reference Table ID').item.json.wf_formName }}\",
    \"fields\": [
        {
            \"name\": \"Id\",
            \"type\": \"singleLineText\"
        },
        {
            \"name\": \"FormId\",
            \"type\": \"singleLineText\"
        },
        {
            \"name\": \"FormName\",
            \"type\": \"singleLineText\"
        },
        {
            \"name\": \"FormCreationDate\",
            \"type\": \"singleLineText\"
        },
        {
            \"name\": \"FormContent\",
            \"type\": \"richText\"
        }
    ]
}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "airtableTokenApi"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "vuNVHoaeyE29Fzra",
          "name": "Airtable Personal Access Token For Tutum"
        },
        "airtableOAuth2Api": {
          "id": "yFiIfESsFO8OpQVU",
          "name": "Airtable oAuth"
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "fd428219-e036-4b68-b9e0-b9328396521f",
      "name": "Set New Webflow Form Table ID",
      "type": "n8n-nodes-base.code",
      "position": [
        920,
        820
      ],
      "parameters": {
        "jsCode": "const floatingObject = $(\"Get Form Index Reference Table ID\").all()[0].json;
floatingObject.at_currentFormTableId = $(\"[AIRTABLE] Create Webflow Form Table\").all()[0].json.id;

if(!floatingObject.at_formIndexTableId){
  floatingObject.at_formIndexTableId = $(\"[AIRTABLE]  Create Index Reference Table\").all()[0].json.id;
}

return floatingObject;

"
      },
      "typeVersion": 2
    },
    {
      "id": "a50f3b26-138e-4ae3-99c4-008cfa96b9f1",
      "name": "[AIRTABLE] Insert Record In Form Index Reference Table",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1180,
        820
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Get Form Index Reference Table ID').item.json.at_baseId }}"
        },
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.at_formIndexTableId }}"
        },
        "columns": {
          "value": {
            "FormId": "={{ $('Get Form Index Reference Table ID').item.json.wf_formId }}",
            "TableId": "={{ $json.at_currentFormTableId }}",
            "FormName": "={{ $('Get Form Index Reference Table ID').item.json.wf_formName }}",
            "TableName": "={{ $('Get Form Index Reference Table ID').item.json.wf_formName }}"
          },
          "schema": [
            {
              "id": "FormId",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "FormId",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "FormName",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "FormName",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "TableId",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "TableId",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "TableName",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "TableName",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": []
        },
        "options": {},
        "operation": "create"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "vuNVHoaeyE29Fzra",
          "name": "Airtable Personal Access Token For Tutum"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "55928c98-65cf-42db-8819-c80a2fe961ba",
      "name": "[AIRTABLE] Insert Record In Webflow Form Table",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1540,
        540
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Get Form Index Reference Table ID').item.json.at_baseId }}"
        },
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Get Form Index Reference Table ID').item.json.at_currentFormTableId }}"
        },
        "columns": {
          "value": {
            "Id": "={{ $('Get Form Index Reference Table ID').item.json.wf_id }}",
            "FormId": "={{ $('Get Form Index Reference Table ID').item.json.wf_formId }}",
            "FormName": "={{ $('Get Form Index Reference Table ID').item.json.wf_formName }}",
            "FormContent": "={{ $('Get Form Index Reference Table ID').item.json.wf_data }}",
            "FormCreationDate": "={{ $('Get Form Index Reference Table ID').item.json.wf_requestDateTime }}"
          },
          "schema": [
            {
              "id": "Id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "FormId",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "FormId",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "FormName",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "FormName",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "FormCreationDate",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "FormCreationDate",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "FormContent",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "FormContent",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": []
        },
        "options": {},
        "operation": "create"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "vuNVHoaeyE29Fzra",
          "name": "Airtable Personal Access Token For Tutum"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "73e45cba-5860-46a6-bb4b-9e9589bf73f2",
      "name": "[AIRTABLE] Find Webflow Form Record In Form Index Reference Table",
      "type": "n8n-nodes-base.airtable",
      "onError": "continueRegularOutput",
      "position": [
        460,
        460
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Get Form Index Reference Table ID').item.json.at_baseId }}"
        },
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.at_formIndexTableId }}"
        },
        "options": {},
        "operation": "search",
        "filterByFormula": "={FormId}='{{ $json.wf_formId }}'"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "vuNVHoaeyE29Fzra",
          "name": "Airtable Personal Access Token For Tutum"
        }
      },
      "typeVersion": 2,
      "alwaysOutputData": true
    },
    {
      "id": "a46a4f35-760b-4b70-83ac-1b471a4a277e",
      "name": "Set Webflow Form Table ID",
      "type": "n8n-nodes-base.code",
      "position": [
        680,
        460
      ],
      "parameters": {
        "jsCode": "const floatingObject = $(\"Get Form Index Reference Table ID\").all()[0].json;
const formIndexData = $(\"[AIRTABLE] Find Webflow Form Record In Form Index Reference Table\").all()[0].json;

floatingObject.at_currentFormTableId = null;

if(Object.keys(formIndexData).length === 0){
  return floatingObject;
}

floatingObject.at_currentFormTableId = $(\"[AIRTABLE] Find Webflow Form Record In Form Index Reference Table\").all()[0].json.TableId;

return floatingObject;
"
      },
      "typeVersion": 2
    },
    {
      "id": "e2085c4d-c94e-4b89-b6ff-4f4f936f663f",
      "name": "Does This Webflow Form Table Exist?",
      "type": "n8n-nodes-base.if",
      "position": [
        900,
        460
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "2f8e4c59-79ef-4840-a17f-c82a6b541ac5",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.at_currentFormTableId }}",
              "rightValue": "=[null]"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "ddca3aac-af29-4e39-8a73-3707815a00fe",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1860,
        360
      ],
      "parameters": {
        "color": 6,
        "width": 624.279069767441,
        "height": 485.5185231617872,
        "content": "# Manage Webflow form submissions in Airtable
## Full guide with video
[Full guide with video here](https://blog.kreonovo.co.za/create-tables-in-airtable-with-webflow-form-submissions/)

his automation workflow will dynamically create tables in an Airtable base for each of your Webflow Site Forms. Then, every form submission will be added as a record in those tables.

## Getting started
1. Create Webflow credential using API V1 Token
2. Create a Personal Access Token for Airtable
3. Connect credentials (please look at the notes to ensure the correct nodes are connected)

That's it! You do not need to add any custom code to your Webflow forms or site.

The name of your forms in the form settings section of the Designer in Webflow will be used to create the Airtable tables. This workflow will automatically do this for you.
"
      },
      "typeVersion": 1
    },
    {
      "id": "f9b3a68e-34fa-454b-ad45-5e3315414b2e",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -600,
        380
      ],
      "parameters": {
        "width": 249.71390814112306,
        "height": 436.3067204586099,
        "content": "## Add Personal Access Token and select base

Make sure to select the correct base from the list."
      },
      "typeVersion": 1
    },
    {
      "id": "41d0e29a-583d-4c39-a4a3-254dfcee132b",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        680
      ],
      "parameters": {
        "width": 451.54733285112343,
        "height": 317.58117651155095,
        "content": "## HTTP requests to Airtable

Select the Airtable Personal Access Token credential. We need to make HTTP requests here to create tables in your Base since the Airtable node does not yet have that option. "
      },
      "typeVersion": 1
    },
    {
      "id": "e73f6861-6663-49c9-b284-41ec9b3eb761",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1840,
        900
      ],
      "parameters": {
        "color": 7,
        "content": "## General note
You do not need to modify any of the nodes accept for adding your credentials."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "5eed0c44-4697-4d4d-bbb9-42bf750de167",
  "connections": {
    "Set Webflow Form Table ID": {
      "main": [
        [
          {
            "node": "Does This Webflow Form Table Exist?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webflow Submission Trigger": {
      "main": [
        [
          {
            "node": "Prepare form submission for workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set New Webflow Form Table ID": {
      "main": [
        [
          {
            "node": "[AIRTABLE] Insert Record In Form Index Reference Table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Does Index Reference Table Exist?": {
      "main": [
        [
          {
            "node": "[AIRTABLE] Find Webflow Form Record In Form Index Reference Table",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "[AIRTABLE]  Create Index Reference Table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Form Index Reference Table ID": {
      "main": [
        [
          {
            "node": "Does Index Reference Table Exist?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Does This Webflow Form Table Exist?": {
      "main": [
        [
          {
            "node": "[AIRTABLE] Insert Record In Webflow Form Table",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "[AIRTABLE] Create Webflow Form Table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare form submission for workflow": {
      "main": [
        [
          {
            "node": "[AIRTABLE] Get Base Schema from list",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "[AIRTABLE] Create Webflow Form Table": {
      "main": [
        [
          {
            "node": "Set New Webflow Form Table ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "[AIRTABLE] Get Base Schema from list": {
      "main": [
        [
          {
            "node": "Get Form Index Reference Table ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "[AIRTABLE]  Create Index Reference Table": {
      "main": [
        [
          {
            "node": "[AIRTABLE] Create Webflow Form Table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "[AIRTABLE] Insert Record In Form Index Reference Table": {
      "main": [
        [
          {
            "node": "[AIRTABLE] Insert Record In Webflow Form Table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "[AIRTABLE] Find Webflow Form Record In Form Index Reference Table": {
      "main": [
        [
          {
            "node": "Set Webflow Form Table ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

功能特点

  • 自动检测新邮件
  • AI智能内容分析
  • 自定义分类规则
  • 批量处理能力
  • 详细的处理日志

技术分析

节点类型及作用

  • Webflowtrigger
  • Set
  • Code
  • If
  • Httprequest

复杂度评估

配置难度:
★★★★☆
维护难度:
★★☆☆☆
扩展性:
★★★★☆

实施指南

前置条件

  • 有效的Gmail账户
  • n8n平台访问权限
  • Google API凭证
  • AI分类服务订阅

配置步骤

  1. 在n8n中导入工作流JSON文件
  2. 配置Gmail节点的认证信息
  3. 设置AI分类器的API密钥
  4. 自定义分类规则和标签映射
  5. 测试工作流执行
  6. 配置定时触发器(可选)

关键参数

参数名称 默认值 说明
maxEmails 50 单次处理的最大邮件数量
confidenceThreshold 0.8 分类置信度阈值
autoLabel true 是否自动添加标签

最佳实践

优化建议

  • 定期更新AI分类模型以提高准确性
  • 根据邮件量调整处理批次大小
  • 设置合理的分类置信度阈值
  • 定期清理过期的分类规则

安全注意事项

  • 妥善保管API密钥和认证信息
  • 限制工作流的访问权限
  • 定期审查处理日志
  • 启用双因素认证保护Gmail账户

性能优化

  • 使用增量处理减少重复工作
  • 缓存频繁访问的数据
  • 并行处理多个邮件分类任务
  • 监控系统资源使用情况

故障排除

常见问题

邮件未被正确分类

检查AI分类器的置信度阈值设置,适当降低阈值或更新训练数据。

Gmail认证失败

确认Google API凭证有效且具有正确的权限范围,重新进行OAuth授权。

调试技巧

  • 启用详细日志记录查看每个步骤的执行情况
  • 使用测试邮件验证分类逻辑
  • 检查网络连接和API服务状态
  • 逐步执行工作流定位问题节点

错误处理

工作流包含以下错误处理机制:

  • 网络超时自动重试(最多3次)
  • API错误记录和告警
  • 处理失败邮件的隔离机制
  • 异常情况下的回滚操作