使用销售税计算器API和Google Sheets自动化销售税计算
中级
这是一个Invoice Processing, Multimodal AI领域的自动化工作流,包含 9 个节点。主要使用 Code, FormTrigger, HttpRequest, GoogleSheets 等节点。 使用销售税计算器API和Google Sheets自动化销售税计算
前置要求
- •可能需要目标 API 的认证凭证
- •Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"meta": {
"instanceId": "60c025075753afcab9f803964b4caaca9402f435deb4efafbb8e3b93b54d8752",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "cfc7a7c6-8ac4-4c18-a0f2-f30572e393f1",
"name": "表单提交时",
"type": "n8n-nodes-base.formTrigger",
"position": [
0,
0
],
"webhookId": "a85a8033-1f39-498d-901e-0392e2bff50b",
"parameters": {
"options": {},
"formTitle": "Sales Tax Calculator",
"formFields": {
"values": [
{
"fieldLabel": "street",
"placeholder": "321 Birch Road, Suite 400",
"requiredField": true
},
{
"fieldLabel": "city",
"placeholder": "Saint Paul",
"requiredField": true
},
{
"fieldLabel": "state",
"placeholder": "MN",
"requiredField": true
},
{
"fieldLabel": "zip",
"placeholder": "55102"
}
]
},
"formDescription": "Sales Tax Calculator"
},
"typeVersion": 2.2
},
{
"id": "a1416047-5dc9-4514-b83d-d0b76f4ce92e",
"name": "计算销售税",
"type": "n8n-nodes-base.httpRequest",
"position": [
280,
0
],
"parameters": {
"url": "https://sales-tax-calculator5.p.rapidapi.com/salestax.php",
"method": "POST",
"options": {},
"sendBody": true,
"contentType": "multipart-form-data",
"sendHeaders": true,
"bodyParameters": {
"parameters": [
{
"name": "street",
"value": "={{ $json.street }}"
},
{
"name": "city",
"value": "={{ $json.city }}"
},
{
"name": "state",
"value": "={{ $json.state }}"
},
{
"name": "zip",
"value": "={{ $json.zip }}"
}
]
},
"headerParameters": {
"parameters": [
{
"name": "x-rapidapi-host",
"value": "sales-tax-calculator5.p.rapidapi.com"
},
{
"name": "x-rapidapi-key",
"value": "your key"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "27ad345c-347e-4b57-a6be-b9d610163013",
"name": "重新格式化",
"type": "n8n-nodes-base.code",
"position": [
580,
0
],
"parameters": {
"jsCode": "let rows = [];\nlet totalTaxRate = 0;\n\n// Iterate over the rate_details in the input data\n$input.first().json.rate_details.forEach(tax => {\n // Push each row with the necessary columns (Tax Agency, Tax Rate, Overall Tax Rate)\n rows.push([\n tax.tax_agency, // Tax Agency\n tax.tax_rate, // Tax Rate\n tax.tax_rate // Overall Tax Rate (same for each agency in this case)\n ]);\n\n // Accumulate the overall tax rate for the total\n totalTaxRate += tax.tax_rate;\n});\n\n// Add the total row at the end\nrows.push([\n \"Total\", // Label for Total\n \"\", // Empty field for Tax Rate\n totalTaxRate // Sum of all Tax Rates\n]);\n\n// Return the rows so they can be used by the next node\nreturn [{ json: { rows } }];\n"
},
"typeVersion": 2
},
{
"id": "8c9c5b39-9e87-47e5-8883-ab0d389feef2",
"name": "在 Google Sheets 中追加",
"type": "n8n-nodes-base.googleSheets",
"position": [
860,
0
],
"parameters": {
"columns": {
"value": {
"rows": "={{ $json.rows }}"
},
"schema": [
{
"id": "rows",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "rows",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"rows"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "",
"cachedResultUrl": "",
"cachedResultName": "Sales tax"
},
"authentication": "serviceAccount"
},
"credentials": {
"googleApi": {
"id": "Rt0RWApx8PL9t0RF",
"name": "Google Docs account"
}
},
"typeVersion": 4.6
},
{
"id": "8c3b0d7d-724d-46a1-afad-8667e5e285dc",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-980,
-220
],
"parameters": {
"width": 840,
"height": 740,
"content": "# 销售税计算自动化工作流程,实现精准税务计算"
},
"typeVersion": 1
},
{
"id": "9559eeaf-51c1-4152-81e6-30ec41313f39",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-60,
-160
],
"parameters": {
"height": 320,
"content": "**表单提交时:捕获用户数据**"
},
"typeVersion": 1
},
{
"id": "3cfb2193-a954-46cd-9415-bfb7dec61cd2",
"name": "便签 2",
"type": "n8n-nodes-base.stickyNote",
"position": [
220,
-160
],
"parameters": {
"height": 320,
"content": "**计算销售税:从 API 获取税率**"
},
"typeVersion": 1
},
{
"id": "cdaf7d69-c546-4635-993d-e1ac04c78c31",
"name": "便签 3",
"type": "n8n-nodes-base.stickyNote",
"position": [
500,
-160
],
"parameters": {
"height": 320,
"content": "**重新格式化 API 响应:结构化税务数据**"
},
"typeVersion": 1
},
{
"id": "2a795c35-837b-4c30-85f3-38fd1681129f",
"name": "便签 4",
"type": "n8n-nodes-base.stickyNote",
"position": [
760,
-160
],
"parameters": {
"height": 320,
"content": "**追加到 Google Sheets:存储税务信息**"
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"Re Fromat": {
"main": [
[
{
"node": "Append In Google Sheets",
"type": "main",
"index": 0
}
]
]
},
"On form submission": {
"main": [
[
{
"node": "Calculate Sales tax",
"type": "main",
"index": 0
}
]
]
},
"Calculate Sales tax": {
"main": [
[
{
"node": "Re Fromat",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级 - 发票处理, 多模态 AI
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
使用顶级反向链接检查器API分析网站反向链接并记录到Google Sheets
使用顶级反向链接检查器API分析网站反向链接并记录到Google Sheets
Code
Form Trigger
Http Request
+2
13 节点Sk developer
市场调研
使用RapidAPI和Google Sheets自动化SEO关键词分析
使用RapidAPI和Google Sheets自动化SEO关键词分析
Code
Form Trigger
Http Request
+2
9 节点Sk developer
市场调研
批量检查域名权威指标并记录到Google表格
使用RapidAPI批量检查域名权威指标并记录到Google表格
Code
Form Trigger
Http Request
+2
9 节点Sk developer
市场调研
使用 Sora GPT、Google Drive 和 Sheets 生成并存储 AI 图像
使用 Sora GPT、Google Drive 和 Sheets 生成并存储 AI 图像
Code
Form Trigger
Google Drive
+3
11 节点Sk developer
内容创作
使用Semrush API和Google Sheets进行SEO竞争对手分析与数据记录
使用Semrush API和Google Sheets进行SEO竞争对手分析与数据记录
Code
Form Trigger
Http Request
+2
21 节点Sk developer
市场调研
使用 RapidAPI 从 Indeed、LinkedIn 等平台抓取职位并保存到 Google Sheets
使用 RapidAPI 从 Indeed、LinkedIn 等平台抓取职位并保存到 Google Sheets
Code
Form Trigger
Http Request
+2
9 节点Sk developer
市场调研