Update nexus wiki content
This commit is contained in:
62
wiki/concepts/n8n-Workflow-Standard.md
Normal file
62
wiki/concepts/n8n-Workflow-Standard.md
Normal file
@@ -0,0 +1,62 @@
|
||||
---
|
||||
title: "n8n Workflow Standard"
|
||||
type: concept
|
||||
tags: [n8n, workflow, automation, reliability, standard]
|
||||
sources: [automation-governance-architect]
|
||||
last_updated: 2026-05-01
|
||||
---
|
||||
|
||||
# n8n Workflow Standard
|
||||
|
||||
n8n 生产级工作流十步标准,所有节点必须遵循该结构,禁止节点失控扩散。
|
||||
|
||||
## 命名规范
|
||||
遵循 `[ENV]-[SYSTEM]-[PROCESS]-[ACTION]-v[MAJOR.MINOR]` 格式,如:
|
||||
- `PROD-CRM-LeadIntake-CreateRecord-v1.0`
|
||||
- `TEST-DMS-DocumentArchive-Upload-v0.4`
|
||||
|
||||
## 十步标准(强制)
|
||||
|
||||
1. **Trigger**:触发器定义(定时 / Webhook / 事件)
|
||||
2. **Input Validation**:输入校验
|
||||
3. **Data Normalization**:数据标准化
|
||||
4. **Business Logic**:业务逻辑
|
||||
5. **External Actions**:外部操作(API 调用等)
|
||||
6. **Result Validation**:结果校验
|
||||
7. **Logging / Audit Trail**:日志与审计追踪
|
||||
8. **Error Branch**:错误分支
|
||||
9. **Fallback / Manual Recovery**:备用路径 / 人工恢复
|
||||
10. **Completion / Status Writeback**:完成状态回写
|
||||
|
||||
## Reliability Baseline(可靠性基线)
|
||||
|
||||
每个重要工作流必须包含:
|
||||
- 显式错误分支(explicit error branches)
|
||||
- 幂等性或重复保护(idempotency or duplicate protection)
|
||||
- 安全重试(含停止条件)(safe retries with stop conditions)
|
||||
- 超时处理(timeout handling)
|
||||
- 告警 / 通知行为(alerting/notification)
|
||||
- 人工 fallback 路径(manual fallback path)
|
||||
|
||||
## Logging Baseline(日志基线)
|
||||
|
||||
最小日志记录:
|
||||
- 工作流名称和版本
|
||||
- 执行时间戳
|
||||
- 源系统
|
||||
- 受影响实体 ID
|
||||
- 成功 / 失败状态
|
||||
- 错误类型及简要原因
|
||||
|
||||
## Testing Baseline(测试基线)
|
||||
|
||||
生产推荐前必须完成:
|
||||
- 快乐路径测试(happy path test)
|
||||
- 无效输入测试(invalid input test)
|
||||
- 外部依赖失败测试(external dependency failure test)
|
||||
- 重复事件测试(duplicate event test)
|
||||
- Fallback / 恢复测试(fallback or recovery test)
|
||||
- 规模 / 重复合理性检查(scale/repetition sanity check)
|
||||
|
||||
## Sources
|
||||
- [[automation-governance-architect]]
|
||||
Reference in New Issue
Block a user