Design durable workflows with Temporal for distributed
Workflow orchestration patterns

Design durable workflows with Temporal for distributed systems. Covers workflow vs activity separation, saga patterns, state management, and determinism constraints.
--- name: workflow-orchestration-patterns description: Design 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. --- # Workflow Orchestration Patterns Master workflow orchestration architecture with Temporal, covering fundamental design decisions, resilience patterns, and best practices for building reliable distributed systems. ## When to Use Workflow Orchestration ### Ideal Use Cases (Source: docs.temporal.io) - **Multi-step processes** spanning machines/services/databases - **Distributed transactions** requiring all-or-nothing semantics - **Long-running workflows** (hours to years) with automatic state persistence - **Failure recovery** that must resume from last successful step - **Business processes**: bookings, orders, campaigns, approvals
Overview
Master workflow orchestration architecture with Temporal, covering fundamental design decisions, resilience patterns, and best practices for building reliable distributed systems.
Manual install (npx, ZIP)
npx skills add wshobson/agents --skill workflow-orchestration-patterns -g -a claude-codemkdir -p ~/.claude/skills && curl -sL https://codeload.github.com/wshobson/agents/tar.gz/4236bb91f839 \
| tar -xz -C ~/.claude/skills --strip-components=4 agents-4236bb91f839/plugins/backend-development/skills/workflow-orchestration-patternsNew-Item -ItemType Directory -Force "$HOME\.claude\skills" | Out-Null; Invoke-WebRequest "https://m.agentalley.io/zip/f0dd99ca05c778f8986b/workflow-orchestration-patterns.zip" -OutFile "$env:TEMP\workflow-orchestration-patterns.zip"; Expand-Archive "$env:TEMP\workflow-orchestration-patterns.zip" -DestinationPath "$HOME\.claude\skills" -ForceConnects with Agent Alley MCP · agentalley.io/mcp
Files included
SKILL.md3.4 KBreferences/1 file · 5.8 KB
Read the files here
Show the full text99 lines
Workflow Orchestration Patterns
Master workflow orchestration architecture with Temporal, covering fundamental design decisions, resilience patterns, and best practices for building reliable distributed systems.
When to Use Workflow Orchestration
Ideal Use Cases (Source: docs.temporal.io)
- Multi-step processes spanning machines/services/databases
- Distributed transactions requiring all-or-nothing semantics
- Long-running workflows (hours to years) with automatic state persistence
- Failure recovery that must resume from last successful step
- Business processes: bookings, orders, campaigns, approvals
- Entity lifecycle management: inventory tracking, account management, cart workflows
- Infrastructure automation: CI/CD pipelines, provisioning, deployments
- Human-in-the-loop systems requiring timeouts and escalations
When NOT to Use
- Simple CRUD operations (use direct API calls)
- Pure data processing pipelines (use Airflow, batch processing)
- Stateless request/response (use standard APIs)
- Real-time streaming (use Kafka, event processors)
Detailed patterns and worked examples
Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.
Best Practices
Workflow Design
- Keep workflows focused - Single responsibility per workflow
- Small workflows - Use child workflows for scalability
- Clear boundaries - Workflow orchestrates, activities execute
- Test locally - Use time-skipping test environment
Activity Design
- Idempotent operations - Safe to retry
- Short-lived - Seconds to minutes, not hours
- Timeout configuration - Always set timeouts
- Heartbeat for long tasks - Report progress
- Error handling - Distinguish retryable vs non-retryable
Common Pitfalls
Workflow Violations:
- Using
datetime.now()instead ofworkflow.now() - Threading or async operations in workflow code
- Calling external APIs directly from workflow
- Non-deterministic logic in workflows
Activity Mistakes:
- Non-idempotent operations (can't handle retries)
- Missing timeouts (activities run forever)
- No error classification (retry validation errors)
- Ignoring payload limits (2MB per argument)
Operational Considerations
Monitoring:
- Workflow execution duration
- Activity failure rates
- Retry attempts and backoff
- Pending workflow counts
Scalability:
- Horizontal scaling with workers
- Task queue partitioning
- Child workflow decomposition
- Activity batching when appropriate
Additional Resources
Official Documentation:
- Temporal Core Concepts: docs.temporal.io/workflows
- Workflow Patterns: docs.temporal.io/evaluate/use-cases-design-patterns
- Best Practices: docs.temporal.io/develop/best-practices
- Saga Pattern: temporal.io/blog/saga-pattern-made-easy
Key Principles:
- Workflows = orchestration, Activities = external calls
- Determinism is non-negotiable for workflows
- Idempotency is critical for activities
- State preservation is automatic
- Design for failure and recovery
| 1 | |
| 2 | name workflow-orchestration-patterns |
| 3 | description Design 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. |
| 4 | |
| 5 | |
| 6 | # Workflow Orchestration Patterns |
| 7 | |
| 8 | Master workflow orchestration architecture with Temporal, covering fundamental design decisions, resilience patterns, and best practices for building reliable distributed systems. |
| 9 | |
| 10 | ## When to Use Workflow Orchestration |
| 11 | |
| 12 | ### Ideal Use Cases (Source: docs.temporal.io) |
| 13 | |
| 14 | **Multi-step processes** spanning machines/services/databases |
| 15 | **Distributed transactions** requiring all-or-nothing semantics |
| 16 | **Long-running workflows** (hours to years) with automatic state persistence |
| 17 | **Failure recovery** that must resume from last successful step |
| 18 | **Business processes**: bookings, orders, campaigns, approvals |
| 19 | **Entity lifecycle management**: inventory tracking, account management, cart workflows |
| 20 | **Infrastructure automation**: CI/CD pipelines, provisioning, deployments |
| 21 | **Human-in-the-loop** systems requiring timeouts and escalations |
| 22 | |
| 23 | ### When NOT to Use |
| 24 | |
| 25 | Simple CRUD operations (use direct API calls) |
| 26 | Pure data processing pipelines (use Airflow, batch processing) |
| 27 | Stateless request/response (use standard APIs) |
| 28 | Real-time streaming (use Kafka, event processors) |
| 29 | |
| 30 | ## Detailed patterns and worked examples |
| 31 | |
| 32 | Detailed pattern documentation lives in `references/details.md`. Read that file when the navigation tier above is insufficient. |
| 33 | |
| 34 | ## Best Practices |
| 35 | |
| 36 | ### Workflow Design |
| 37 | |
| 38 | **Keep workflows focused** - Single responsibility per workflow |
| 39 | **Small workflows** - Use child workflows for scalability |
| 40 | **Clear boundaries** - Workflow orchestrates, activities execute |
| 41 | **Test locally** - Use time-skipping test environment |
| 42 | |
| 43 | ### Activity Design |
| 44 | |
| 45 | **Idempotent operations** - Safe to retry |
| 46 | **Short-lived** - Seconds to minutes, not hours |
| 47 | **Timeout configuration** - Always set timeouts |
| 48 | **Heartbeat for long tasks** - Report progress |
| 49 | **Error handling** - Distinguish retryable vs non-retryable |
| 50 | |
| 51 | ### Common Pitfalls |
| 52 | |
| 53 | **Workflow Violations**: |
| 54 | |
| 55 | Using `datetime.now()` instead of `workflow.now()` |
| 56 | Threading or async operations in workflow code |
| 57 | Calling external APIs directly from workflow |
| 58 | Non-deterministic logic in workflows |
| 59 | |
| 60 | **Activity Mistakes**: |
| 61 | |
| 62 | Non-idempotent operations (can't handle retries) |
| 63 | Missing timeouts (activities run forever) |
| 64 | No error classification (retry validation errors) |
| 65 | Ignoring payload limits (2MB per argument) |
| 66 | |
| 67 | ### Operational Considerations |
| 68 | |
| 69 | **Monitoring**: |
| 70 | |
| 71 | Workflow execution duration |
| 72 | Activity failure rates |
| 73 | Retry attempts and backoff |
| 74 | Pending workflow counts |
| 75 | |
| 76 | **Scalability**: |
| 77 | |
| 78 | Horizontal scaling with workers |
| 79 | Task queue partitioning |
| 80 | Child workflow decomposition |
| 81 | Activity batching when appropriate |
| 82 | |
| 83 | ## Additional Resources |
| 84 | |
| 85 | **Official Documentation**: |
| 86 | |
| 87 | Temporal Core Concepts: docs.temporal.io/workflows |
| 88 | Workflow Patterns: docs.temporal.io/evaluate/use-cases-design-patterns |
| 89 | Best Practices: docs.temporal.io/develop/best-practices |
| 90 | Saga Pattern: temporal.io/blog/saga-pattern-made-easy |
| 91 | |
| 92 | **Key Principles**: |
| 93 | |
| 94 | Workflows = orchestration, Activities = external calls |
| 95 | Determinism is non-negotiable for workflows |
| 96 | Idempotency is critical for activities |
| 97 | State preservation is automatic |
| 98 | Design for failure and recovery |
| 99 |
Details
- Updated
- Sep 21, 2026
- License
- MIT
- Stars on the repo
- ★ 39,857
- Checked
- Source
- wshobson/agents ↗
- Creator
- wshobson · 179 listings
Similar skills
See all →
SkillWeb browser automation with AI-optimized snapshotsBrowser Automation Skill
SkillDeepEval evaluation workflow for AI agents
SkillBrowser automation with persistent named pagesDev browser
SkillTurn visible project context, a proven thread, skillTurn into app
SkillComplete browser automation with PlaywrightPlaywright Browser Automation
SkillUse TinyFish for web search, fetching URLs, reading pagesTinyFish CLIMore from wshobson
SkillMaster C/.NET backend development patterns for building
SkillImplement WCAG 2.2 compliant interfaces with mobileAccessibility compliance
SkillMaster Material Design 3 and Jetpack Compose patternsAndroid Mobile Design
SkillMigrate from AngularJS to Angular using hybrid modeAngular migration
SkillUnderstand anti-reversing, obfuscationAnti reversing techniques
SkillBuild production Apache Airflow DAGs with best practicesApache Airflow DAG Patterns