8
n8n 中文网amn8n.com

使用 GPT-4 和 Airtable 自动记录和备份工作流

高级

这是一个AI Summarization, Multimodal AI领域的自动化工作流,包含 38 个节点。主要使用 If, N8n, Set, Code, Wait 等节点。 使用 GPT-4 和 Airtable 自动记录和备份工作流

前置要求
  • Airtable API Key
  • 可能需要目标 API 的认证凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "nodes": [
    {
      "id": "8261a2c4-7000-4eea-950d-8cbcec82a3c9",
      "name": "移动二进制数据",
      "type": "n8n-nodes-base.moveBinaryData",
      "position": [
        -3248,
        16
      ],
      "parameters": {
        "mode": "jsonToBinary",
        "options": {
          "fileName": "=file",
          "useRawData": true
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9ccbe56e-941f-4ad2-9272-54dc8461c4ad",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -7024,
        16
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "8020a4d9-3600-42ef-b2bb-6f2f3e3490e3",
      "name": "从文件提取",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -3024,
        16
      ],
      "parameters": {
        "options": {},
        "operation": "binaryToPropery"
      },
      "typeVersion": 1
    },
    {
      "id": "338a4507-94e0-4308-b969-87cf8266bdcb",
      "name": "搜索所有快照",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -6480,
        16
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appPFFj6CUUhZyDPT",
          "cachedResultUrl": "https://airtable.com/appPFFj6CUUhZyDPT",
          "cachedResultName": "n8n workflows backup (template)"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblavE6Zl51smbyGV",
          "cachedResultUrl": "https://airtable.com/appSYKqZwWcxbEdKq/tblavE6Zl51smbyGV",
          "cachedResultName": "Snapshots"
        },
        "options": {},
        "operation": "search",
        "filterByFormula": "={Workflow ID} = '{{ $('Loop Over Items').item.json.id }}'"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "xSf8osMIdIhLSt91",
          "name": "Duv Airtable"
        }
      },
      "typeVersion": 2.1,
      "alwaysOutputData": true
    },
    {
      "id": "165438d4-3e23-4cf9-9372-d51080fb1969",
      "name": "重新总结工作流",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -4272,
        -304
      ],
      "parameters": {
        "text": "={{ JSON.stringify($('Loop Over Items').first().json, null, 2) }}",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "=Your role is to return a 1 sentence description of what the n8n workflow provided by the user does. You have a deep understanding of how n8n works.\n\nExample shapes of 1-sentence summaries:\nSummarises incoming product feedback from the form or as a subworkflow and sends it to Slack in #general before storing the summary in Airtable and Drive.\nTriggers on a new Gmail message, downloads the PDF attachment, converts it to base64, and uploads it to a Google Drive folder while saving metadata in Airtable.\nDetects new successful Stripe payments, retrieves customer details, creates a HubSpot contact, and sends a templated welcome email via SendGrid."
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "0f83a04c-0979-467d-a4b3-60b8a165e657",
      "name": "存储新工作流摘要",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -3920,
        -304
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appPFFj6CUUhZyDPT",
          "cachedResultUrl": "https://airtable.com/appPFFj6CUUhZyDPT",
          "cachedResultName": "n8n workflows backup (template)"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblfjTaQd9nnVt9WP",
          "cachedResultUrl": "https://airtable.com/appSYKqZwWcxbEdKq/tblfjTaQd9nnVt9WP",
          "cachedResultName": "Workflows"
        },
        "columns": {
          "value": {
            "AI summary": "={{ $json.text }}",
            "Airtable record ID": "={{ $('Create or update workflow').first().json.id }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "Workflow name",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Workflow name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Workflow ID",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Workflow ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Open in n8n",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Open in n8n",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "AI summary",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "AI summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Snapshots",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Snapshots",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Snapshots count",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Snapshots count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last snapshot version ID",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Last snapshot version ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last update time",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Last update time",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last version file",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Last version file",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Comment",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Comment",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Creation time",
              "type": "dateTime",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Creation time",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Airtable record ID",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "Airtable record ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Airtable record ID"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "xSf8osMIdIhLSt91",
          "name": "Duv Airtable"
        }
      },
      "typeVersion": 2.1,
      "alwaysOutputData": true
    },
    {
      "id": "32ad534c-3b4d-4388-894e-630954153bfa",
      "name": "获取完整工作流JSON",
      "type": "n8n-nodes-base.n8n",
      "position": [
        -3472,
        16
      ],
      "parameters": {
        "operation": "get",
        "workflowId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Loop Over Items').first().json.id }}"
        },
        "requestOptions": {}
      },
      "credentials": {
        "n8nApi": {
          "id": "HqriyqRC78mQ4sRj",
          "name": "n8n account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "72df750a-b797-4e6b-b0de-4ecf5d6e894e",
      "name": "仅保留新快照",
      "type": "n8n-nodes-base.filter",
      "position": [
        -7248,
        16
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "34d44462-f09f-4f8c-910a-be361eb56c10",
              "operator": {
                "type": "string",
                "operation": "empty",
                "singleValue": true
              },
              "leftValue": "={{ $json['n8n version ID'] }}",
              "rightValue": ""
            },
            {
              "id": "2b0c4d48-b77c-4dd5-a2bd-6257dcae2f20",
              "operator": {
                "type": "string",
                "operation": "notExists",
                "singleValue": true
              },
              "leftValue": "={{ $json['n8n version ID'] }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "5e310efb-1892-4baa-a7c0-ff3c00523f19",
      "name": "等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        -2496,
        384
      ],
      "webhookId": "393a9b19-f641-4876-84a1-379a207a1bc7",
      "parameters": {
        "amount": 3
      },
      "typeVersion": 1.1
    },
    {
      "id": "ebde51ba-5dd3-45c7-87bb-18e5d8770a8a",
      "name": "获取所有n8n工作流",
      "type": "n8n-nodes-base.n8n",
      "position": [
        -7696,
        -80
      ],
      "parameters": {
        "filters": {
          "excludePinnedData": true
        },
        "requestOptions": {}
      },
      "credentials": {
        "n8nApi": {
          "id": "HqriyqRC78mQ4sRj",
          "name": "n8n account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5e6d74f2-67c5-4f89-9532-82245f02530f",
      "name": "匹配快照ID",
      "type": "n8n-nodes-base.merge",
      "position": [
        -7472,
        16
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "advanced": true,
        "joinMode": "keepNonMatches",
        "mergeByFields": {
          "values": [
            {
              "field1": "versionId",
              "field2": "n8n version ID"
            }
          ]
        },
        "outputDataFrom": "input1"
      },
      "typeVersion": 3.2
    },
    {
      "id": "e10fab34-aea2-4c08-a1a0-307f1199932c",
      "name": "定时触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -8048,
        16
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 8
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "2b9546ed-ba58-48b1-b43d-21572d0fbec8",
      "name": "搜索所有现有快照",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -7696,
        112
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appPFFj6CUUhZyDPT",
          "cachedResultUrl": "https://airtable.com/appPFFj6CUUhZyDPT",
          "cachedResultName": "n8n workflows backup (template)"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblavE6Zl51smbyGV",
          "cachedResultUrl": "https://airtable.com/appPFFj6CUUhZyDPT/tblavE6Zl51smbyGV",
          "cachedResultName": "Snapshots"
        },
        "options": {
          "fields": [
            "n8n version ID"
          ]
        },
        "operation": "search"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "xSf8osMIdIhLSt91",
          "name": "Duv Airtable"
        }
      },
      "typeVersion": 2.1,
      "alwaysOutputData": true
    },
    {
      "id": "5d3175e6-0f5c-4bd3-92a6-93f97ee0aea9",
      "name": "下载先前快照",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -5776,
        -320
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appPFFj6CUUhZyDPT",
          "cachedResultUrl": "https://airtable.com/appPFFj6CUUhZyDPT",
          "cachedResultName": "n8n workflows backup (template)"
        },
        "limit": 1,
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblavE6Zl51smbyGV",
          "cachedResultUrl": "https://airtable.com/appSYKqZwWcxbEdKq/tblavE6Zl51smbyGV",
          "cachedResultName": "Snapshots"
        },
        "options": {
          "downloadFields": [
            "Workflow_file"
          ]
        },
        "operation": "search",
        "returnAll": false,
        "filterByFormula": "={n8n version ID} = '{{ $('Create or update workflow').first().json.fields['Last snapshot version ID'][0] }}'"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "xSf8osMIdIhLSt91",
          "name": "Duv Airtable"
        }
      },
      "typeVersion": 2.1,
      "alwaysOutputData": false
    },
    {
      "id": "071d5954-a253-4900-98cb-3ef035855d2a",
      "name": "从文件提取1",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -5552,
        -320
      ],
      "parameters": {
        "options": {},
        "operation": "fromJson",
        "destinationKey": "Previous JSON",
        "binaryPropertyName": "Workflow_file_0"
      },
      "typeVersion": 1
    },
    {
      "id": "ed9bb794-da8c-42df-b9fd-fa169d178db7",
      "name": "创建或更新工作流",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -6720,
        16
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appPFFj6CUUhZyDPT",
          "cachedResultUrl": "https://airtable.com/appPFFj6CUUhZyDPT",
          "cachedResultName": "n8n workflows backup (template)"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblfjTaQd9nnVt9WP",
          "cachedResultUrl": "https://airtable.com/appSYKqZwWcxbEdKq/tblfjTaQd9nnVt9WP",
          "cachedResultName": "Workflows"
        },
        "columns": {
          "value": {
            "Workflow ID": "={{ $('Loop Over Items').item.json.id }}",
            "Creation time": "={{ $('Loop Over Items').item.json.createdAt }}",
            "Workflow name": "={{ $('Loop Over Items').item.json.name }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "Workflow name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Workflow name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Workflow ID",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Workflow ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Open in n8n",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Open in n8n",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "AI summary",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "AI summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Snapshots",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Snapshots",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Snapshots count",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Snapshots count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last snapshot version ID",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Last snapshot version ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last update time",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Last update time",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last version file",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Last version file",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Comment",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Comment",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Creation time",
              "type": "dateTime",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Creation time",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Airtable record ID",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Airtable record ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Workflow ID"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "upsert"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "xSf8osMIdIhLSt91",
          "name": "Duv Airtable"
        }
      },
      "typeVersion": 2.1,
      "alwaysOutputData": true
    },
    {
      "id": "9afc3bb4-3923-43de-9695-ea517afb630b",
      "name": "检查工作流状态",
      "type": "n8n-nodes-base.code",
      "position": [
        -6256,
        16
      ],
      "parameters": {
        "jsCode": "// Count the number of items from the previous node\nlet numItems = $items().length;\n\n// Check for the specific case where the previous node is empty but returns\n// a single item without the expected 'id' key in its JSON.\nif (numItems === 1 && $items()[0].json && $items()[0].json.id === undefined) {\n  numItems = 0;\n}\n\n// Determine the boolean value.\n// The new rule is to regenerate when the number is 0, 1, 2, or a multiple of 5.\nconst regenerate = (numItems === 0 || numItems === 1 || numItems === 2 || numItems % 5 === 0);\n\n// Return a single item with the renamed keys\nreturn [\n  {\n    json: {\n      \"Number of snapshots\": numItems,\n      \"Re-generate AI summary?\": regenerate\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "74884b3d-dd8f-4e13-919e-709aa3b32fad",
      "name": "现有工作流?",
      "type": "n8n-nodes-base.if",
      "position": [
        -6032,
        16
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "273d684c-b737-4dab-9e89-3af3a08f4570",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $json['Number of snapshots'] }}",
              "rightValue": 0
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "8923c1a8-5189-43e1-a599-c51d9652ea24",
      "name": "准备自上次快照以来的编辑内容",
      "type": "n8n-nodes-base.set",
      "position": [
        -4976,
        -320
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "0f6c8c19-e75e-4cdc-a0fa-49320ba89006",
              "name": "Edits since last snapshot",
              "type": "string",
              "value": "={{ $json.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "08e5c6e2-0afe-47bc-82a3-878c809a2b28",
      "name": "声明此为第一个版本",
      "type": "n8n-nodes-base.set",
      "position": [
        -5008,
        144
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "0f6c8c19-e75e-4cdc-a0fa-49320ba89006",
              "name": "Edits since last snapshot",
              "type": "string",
              "value": "=N/A - First identified version of the workflow"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "2d8d28df-6cab-419a-93d7-b0d3e78253b8",
      "name": "整合自上次快照以来的编辑内容",
      "type": "n8n-nodes-base.set",
      "position": [
        -4720,
        16
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "0f6c8c19-e75e-4cdc-a0fa-49320ba89006",
              "name": "Edits since last snapshot",
              "type": "string",
              "value": "={{ $json['Edits since last snapshot'] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "1e3c97c4-6685-4e38-8a6b-ef90894dc77c",
      "name": "需要新工作流摘要?",
      "type": "n8n-nodes-base.if",
      "position": [
        -4496,
        16
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "c065fb3f-54ce-4f45-8c91-d7f7972adc3b",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $('Check workflow status').item.json['Re-generate AI summary?'] }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "fb6cd7e8-8ed4-4b8b-a070-151eb4646bc8",
      "name": "记录工作流差异",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -5328,
        -320
      ],
      "parameters": {
        "text": "={{ JSON.stringify($json['Previous JSON'], null, 2) }}",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "=Your role is to return a 1 sentence explanation of the difference between 2 n8n workflow versions.\n\nYou are detail-oriented when it comes to analysing and comparing workflows, but your output is rather concise as it is strictly one sentence.\n\nThe user message contains the JSON of the new version, and here is the previous version of the workflow to compare it to:\n\n{{ JSON.stringify($('Loop Over Items').first().json, null, 2) }}"
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "8022caab-0a00-47fd-b25f-659b237ee0dc",
      "name": "存储新快照",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -3696,
        16
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appPFFj6CUUhZyDPT",
          "cachedResultUrl": "https://airtable.com/appPFFj6CUUhZyDPT",
          "cachedResultName": "n8n workflows backup (template)"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblavE6Zl51smbyGV",
          "cachedResultUrl": "https://airtable.com/appSYKqZwWcxbEdKq/tblavE6Zl51smbyGV",
          "cachedResultName": "Snapshots"
        },
        "columns": {
          "value": {
            "Workflow": "={{[ $('Create or update workflow').first().json.id ]}}",
            "n8n version ID": "={{ $('Loop Over Items').first().json.versionId }}",
            "Last update time": "={{ $('Loop Over Items').first().json.updatedAt }}",
            "Edits since last snapshot": "={{ $('Consolidate edits since last snapshot').first().json['Edits since last snapshot'] }}"
          },
          "schema": [
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "n8n version ID",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "n8n version ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last update time",
              "type": "dateTime",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Last update time",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Time added",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Time added",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Workflow",
              "type": "array",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Workflow",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Workflow ID",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Workflow ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Workflow_file",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Workflow_file",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Edits since last snapshot",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Edits since last snapshot",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Comment",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Comment",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Airtable record ID",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Airtable record ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {
          "typecast": true
        },
        "operation": "create"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "xSf8osMIdIhLSt91",
          "name": "Duv Airtable"
        }
      },
      "typeVersion": 2.1,
      "alwaysOutputData": true
    },
    {
      "id": "19a0d146-27a3-4cbd-8249-bf883cb54862",
      "name": "将工作流文件存储到Airtable",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2768,
        16
      ],
      "parameters": {
        "url": "=https://content.airtable.com/v0/<AIRTABLE-BASE-ID>/{{ $('Store new snapshot').first().json.id }}/Workflow_file/uploadAttachment",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "contentType",
              "value": "text/plain"
            },
            {
              "name": "file",
              "value": "={{ $json.data }}"
            },
            {
              "name": "filename",
              "value": "={{ $('Loop Over Items').first().json.versionId }}.json"
            }
          ]
        },
        "nodeCredentialType": "airtableTokenApi"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "xSf8osMIdIhLSt91",
          "name": "Duv Airtable"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "f0c35245-4949-41bf-ab9f-1a2b2dccc131",
      "name": "OpenAI聊天模型1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -4848,
        672
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-nano",
          "cachedResultName": "gpt-4.1-nano"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "dMiSy27YCK6c6rra",
          "name": "Duv's OpenAI"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "8e5f5a92-9111-4891-beb3-cd3d9fe7e923",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2880,
        -368
      ],
      "parameters": {
        "color": 3,
        "width": 352,
        "height": 576,
        "content": "## 将您的Airtable基地ID插入URL"
      },
      "typeVersion": 1
    },
    {
      "id": "75fc1067-486e-4718-9893-7baba3402591",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3504,
        -112
      ],
      "parameters": {
        "color": 7,
        "width": 608,
        "height": 320,
        "content": "## 准备将此工作流版本作为文件导入Airtable"
      },
      "typeVersion": 1
    },
    {
      "id": "8daa99f7-f960-4675-9a9e-111aba5eebc1",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4352,
        -608
      ],
      "parameters": {
        "color": 5,
        "width": 608,
        "height": 528,
        "content": "## 使用AI(重新)总结工作流"
      },
      "typeVersion": 1
    },
    {
      "id": "ae3cb5a1-56be-4a68-8039-0fa5b943df00",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -5824,
        -480
      ],
      "parameters": {
        "color": 5,
        "width": 992,
        "height": 432,
        "content": "## 使用AI记录与先前快照的编辑差异"
      },
      "typeVersion": 1
    },
    {
      "id": "37ddafe2-30ea-40f1-8db1-346a2e09b750",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -6800,
        -32
      ],
      "parameters": {
        "width": 256,
        "height": 416,
        "content": "如果工作流在Airtable的\"工作流\"标签页中尚无记录,此时将创建记录。"
      },
      "typeVersion": 1
    },
    {
      "id": "4d94c74f-be8d-41a4-870e-149533e303bc",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -6336,
        -32
      ],
      "parameters": {
        "color": 6,
        "width": 256,
        "height": 416,
        "content": "此代码会查看所有历史快照的搜索结果,返回快照数量以及\"是\"或\"否\"(指示是否该重新生成工作流摘要)。"
      },
      "typeVersion": 1
    },
    {
      "id": "4bcc671d-a4d9-4d4f-b616-d7eeed703110",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -7792,
        -224
      ],
      "parameters": {
        "color": 4,
        "width": 656,
        "height": 544,
        "content": "## 检索所有具有新快照的工作流"
      },
      "typeVersion": 1
    },
    {
      "id": "f9d24d5b-e86e-423b-8d2c-8cb9b096f54f",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4992,
        624
      ],
      "parameters": {
        "color": 5,
        "width": 384,
        "height": 400,
        "content": "## 连接您喜爱的AI供应商和模型"
      },
      "typeVersion": 1
    },
    {
      "id": "58f05bec-ef7d-4e8b-a8bf-a267ff842cd8",
      "name": "备份完成!",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -6736,
        -272
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0de48f62-8638-418d-b7ba-f86746fba33b",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -8160,
        -224
      ],
      "parameters": {
        "width": 320,
        "height": 544,
        "content": "## 定义您的备份频率"
      },
      "typeVersion": 1
    },
    {
      "id": "c9fd49c3-5976-419c-aa04-42ee0cff5840",
      "name": "便签9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2528,
        256
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 288,
        "content": "## 让Airtable的API稍作休息!"
      },
      "typeVersion": 1
    },
    {
      "id": "7a3ea014-330c-47f5-a547-4c5b18b6f1be",
      "name": "便签10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -8720,
        -336
      ],
      "parameters": {
        "color": 2,
        "width": 512,
        "height": 656,
        "content": "# 自动化工作流备份与AI文档记录器"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "The backup is done!",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create or update workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Move Binary Data": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get all n8n workflows",
            "type": "main",
            "index": 0
          },
          {
            "node": "Search all existing snapshots",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Store workflow file into Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Existing workflow?": {
      "main": [
        [
          {
            "node": "Download previous snapshot",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "State that this is the first version",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File1": {
      "main": [
        [
          {
            "node": "Document workflow differences",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Match snapshot IDs": {
      "main": [
        [
          {
            "node": "Only keep new snapshots",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Document workflow differences",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Re-summarise workflow",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Store new snapshot": {
      "main": [
        [
          {
            "node": "Get full workflow JSON",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search all snapshots": {
      "main": [
        [
          {
            "node": "Check workflow status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check workflow status": {
      "main": [
        [
          {
            "node": "Existing workflow?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get all n8n workflows": {
      "main": [
        [
          {
            "node": "Match snapshot IDs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Re-summarise workflow": {
      "main": [
        [
          {
            "node": "Store new workflow summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get full workflow JSON": {
      "main": [
        [
          {
            "node": "Move Binary Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Only keep new snapshots": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create or update workflow": {
      "main": [
        [
          {
            "node": "Search all snapshots",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download previous snapshot": {
      "main": [
        [
          {
            "node": "Extract from File1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store new workflow summary": {
      "main": [
        [
          {
            "node": "Store new snapshot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Needs new workflow summary?": {
      "main": [
        [
          {
            "node": "Re-summarise workflow",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Store new snapshot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Document workflow differences": {
      "main": [
        [
          {
            "node": "Prepare edits since last snapshot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search all existing snapshots": {
      "main": [
        [
          {
            "node": "Match snapshot IDs",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Prepare edits since last snapshot": {
      "main": [
        [
          {
            "node": "Consolidate edits since last snapshot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store workflow file into Airtable": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "State that this is the first version": {
      "main": [
        [
          {
            "node": "Consolidate edits since last snapshot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Consolidate edits since last snapshot": {
      "main": [
        [
          {
            "node": "Needs new workflow summary?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - AI 摘要总结, 多模态 AI

需要付费吗?

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

工作流信息
难度等级
高级
节点数量38
分类2
节点类型17
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Guillaume Duvernay

Guillaume Duvernay

@duv

AI and automation expert

外部链接
在 n8n.io 查看

分享此工作流