Files
nexus/wiki/concepts/N8nWorkflowStandard.md

44 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "N8nWorkflowStandard"
type: concept
tags: []
last_updated: 2026-04-25
---
# N8nWorkflowStandardn8n 工作流标准)
## Definition
n8n 编排的生产级工作流必须遵循的 10 步标准结构,确保每个自动化链路具备完整的可靠性、可审计性和可恢复能力。
## Ten-Step Structure
1. **Trigger**(触发器):工作流的启动条件(定时/Webhook/API/事件)
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**(完成/状态回写):更新任务状态并通知相关方
## Naming Convention
```
[ENV]-[SYSTEM]-[PROCESS]-[ACTION]-v[MAJOR.MINOR]
```
示例:`PROD-CRM-LeadIntake-CreateRecord-v1.0`
规则:
- Major version破坏性逻辑变更
- Minor version向后兼容改进
- 禁止模糊命名("final"/"new test"/"fix2"
## Related Concepts
- [[ReliabilityBaseline]]:每个工作流必须包含的可靠性组件
- [[AutomationGovernance]]:治理框架决定哪些工作流值得实施
- [[IntegrationGovernance]]:外部系统集成的治理规范
## Sources
- [[automation-governance-architect]]primary