workflow-orchestrator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Workflow Orchestrator

工作流编排器

Purpose

用途

Provides expertise in designing and implementing durable workflow systems that coordinate complex business processes. Specializes in workflow engines like Temporal and Camunda, saga patterns, and building reliable long-running processes.
提供设计和实现耐用工作流系统的专业知识,这些系统用于协调复杂的业务流程。专注于Temporal和Camunda等工作流引擎、saga模式,以及构建可靠的长期运行流程。

When to Use

使用场景

  • Designing multi-step business workflows
  • Implementing saga patterns for distributed transactions
  • Building with Temporal, Camunda, or similar workflow engines
  • Handling long-running processes with durability requirements
  • Coordinating activities across multiple services
  • Implementing compensation and rollback logic
  • Building human-in-the-loop approval workflows
  • Managing state machines for complex processes
  • 设计多步骤业务工作流
  • 为分布式事务实现saga模式
  • 使用Temporal、Camunda或类似工作流引擎进行构建
  • 处理具有耐用性要求的长期运行流程
  • 协调跨多个服务的活动
  • 实现补偿和回滚逻辑
  • 构建包含人工参与的审批工作流
  • 管理复杂流程的状态机

Quick Start

快速开始

Invoke this skill when:
  • Designing multi-step business workflows
  • Implementing saga patterns for distributed transactions
  • Building with Temporal, Camunda, or similar workflow engines
  • Handling long-running processes with durability requirements
  • Coordinating activities across multiple services
Do NOT invoke when:
  • Simple async job processing → use appropriate queue solution
  • Task distribution for agents → use task-distributor
  • Event streaming → use event-driven-architect
  • CI/CD pipelines → use devops-engineer
调用此技能的场景:
  • 设计多步骤业务工作流
  • 为分布式事务实现saga模式
  • 使用Temporal、Camunda或类似工作流引擎进行构建
  • 处理具有耐用性要求的长期运行流程
  • 协调跨多个服务的活动
请勿调用的场景:
  • 简单异步任务处理 → 使用合适的队列解决方案
  • 代理任务分发 → 使用任务分发器
  • 事件流处理 → 使用事件驱动架构
  • CI/CD流水线 → 使用DevOps工程师

Decision Framework

决策框架

Workflow Need?
├── Durable Long-Running → Temporal or durable execution engine
├── Human Tasks → Camunda or process orchestration platform
├── Choreography → Event-driven with eventual consistency
├── Simple Steps → State machine or queue-based
├── Saga Pattern → Orchestrated or choreographed compensations
└── Scheduled Jobs → Cron-based with workflow wrapper
是否需要工作流?
├── 耐用的长期运行流程 → Temporal或耐用执行引擎
├── 人工任务 → Camunda或流程编排平台
├── 编排 choreography → 基于事件驱动的最终一致性
├── 简单步骤 → 状态机或基于队列的方案
├── Saga模式 → 编排式或 choreography 式补偿
└── 定时任务 → 基于Cron的工作流包装器

Core Workflows

核心工作流

1. Temporal Workflow Implementation

1. Temporal工作流实现

  1. Define workflow interface and activities
  2. Implement workflow logic with Temporal SDK
  3. Create activity implementations for external calls
  4. Configure retry policies and timeouts
  5. Implement signals and queries for external interaction
  6. Add versioning for workflow updates
  7. Deploy workers and monitor execution
  8. Implement testing with Temporal test framework
  1. 定义工作流接口和活动
  2. 使用Temporal SDK实现工作流逻辑
  3. 为外部调用创建活动实现
  4. 配置重试策略和超时时间
  5. 实现用于外部交互的信号和查询
  6. 添加工作流更新的版本控制
  7. 部署工作器并监控执行
  8. 使用Temporal测试框架实现测试

2. Saga Pattern Implementation

2. Saga模式实现

  1. Identify distributed transaction boundaries
  2. Define forward actions and compensating actions
  3. Choose orchestration (central) or choreography (events)
  4. Implement idempotent operations
  5. Handle partial failures with compensation
  6. Add timeout handling for stuck sagas
  7. Implement observability for saga state
  8. Test failure scenarios thoroughly
  1. 确定分布式事务边界
  2. 定义正向操作和补偿操作
  3. 选择编排式(集中式)或choreography式(事件驱动)
  4. 实现幂等操作
  5. 使用补偿处理部分失败
  6. 为停滞的saga添加超时处理
  7. 实现saga状态的可观测性
  8. 全面测试失败场景

3. Human-in-the-Loop Workflow

3. 包含人工参与的工作流

  1. Design process with human task points
  2. Model workflow with BPMN or similar notation
  3. Implement automated steps as activities
  4. Create task inbox UI for human actions
  5. Add escalation and timeout handling
  6. Implement delegation and reassignment
  7. Add audit trail for compliance
  8. Monitor SLAs for human tasks
  1. 设计包含人工任务节点的流程
  2. 使用BPMN或类似符号建模工作流
  3. 将自动化步骤实现为活动
  4. 为人工操作创建任务收件箱UI
  5. 添加升级和超时处理
  6. 实现委托和重新分配功能
  7. 添加合规性审计跟踪
  8. 监控人工任务的服务水平协议(SLA)

Best Practices

最佳实践

  • Make all activities idempotent for safe retries
  • Use workflow versioning for production updates
  • Implement comprehensive compensation for failures
  • Set appropriate timeouts at each step
  • Add observability with traces spanning workflow
  • Design for failure; assume any step can fail
  • 确保所有活动都是幂等的,以支持安全重试
  • 对生产环境的更新使用工作流版本控制
  • 为故障实现全面的补偿机制
  • 在每个步骤设置适当的超时时间
  • 添加跨工作流的可观测性跟踪
  • 针对故障进行设计;假设任何步骤都可能失败

Anti-Patterns

反模式

  • Non-idempotent activities → Design for safe retry
  • Missing compensations → Plan rollback from the start
  • Infinite retries → Set max attempts and handle failures
  • Blocking human tasks → Add timeouts and escalation
  • Tight coupling → Keep workflows decoupled from activity impl
  • 非幂等活动 → 设计为可安全重试
  • 缺少补偿机制 → 从一开始就规划回滚方案
  • 无限重试 → 设置最大尝试次数并处理故障
  • 阻塞式人工任务 → 添加超时和升级机制
  • 紧耦合 → 保持工作流与活动实现解耦