tessl install github:wshobson/agents --skill workflow-orchestration-patternsDesign durable workflows with Temporal for distributed systems. Covers workflow vs activity separation, saga patterns, state management, and determinism constraints. Use when building long-running processes, distributed transactions, or microservice orchestration.
Review Score
81%
Validation Score
14/16
Implementation Score
63%
Activation Score
100%
Master workflow orchestration architecture with Temporal, covering fundamental design decisions, resilience patterns, and best practices for building reliable distributed systems.
The Fundamental Rule (Source: temporal.io/blog/workflow-engine-principles):
Characteristics:
Example workflow tasks:
Characteristics:
Example activity tasks:
Does it touch external systems? → Activity
Is it orchestration/decision logic? → WorkflowPurpose: Implement distributed transactions with rollback capability
Pattern (Source: temporal.io/blog/compensating-actions-part-of-a-complete-breakfast-with-sagas):
For each step:
1. Register compensation BEFORE executing
2. Execute the step (via activity)
3. On failure, run all compensations in reverse order (LIFO)Example: Payment Workflow
Critical Requirements:
Purpose: Long-lived workflow representing single entity instance
Pattern (Source: docs.temporal.io/evaluate/use-cases-design-patterns):
Example Use Cases:
Benefits:
Purpose: Execute multiple tasks in parallel, aggregate results
Pattern:
Scaling Rule (Source: temporal.io/blog/workflow-engine-principles):
Purpose: Wait for external event or human approval
Pattern:
Use Cases:
How Temporal Works (Source: docs.temporal.io/workflows):
Workflows Execute as State Machines:
Prohibited in Workflows (Source: docs.temporal.io/workflows):
random())datetime.now())Allowed in Workflows:
workflow.now() (deterministic time)workflow.random() (deterministic random)Challenge: Changing workflow code while old executions still running
Solutions:
workflow.get_version() for safe changesDefault Behavior: Temporal retries activities forever
Configure Retry:
Non-Retryable Errors:
Why Critical (Source: docs.temporal.io/activities):
Implementation Strategies:
Purpose: Detect stalled long-running activities
Pattern:
Workflow Violations:
datetime.now() instead of workflow.now()Activity Mistakes:
Monitoring:
Scalability:
Official Documentation:
Key Principles: