Workflow Orchestration Patterns
SkillMediaThis skill helps an AI agent design durable workflows for distributed systems using Temporal. It covers the separation of workflows and activities, saga patterns for compensation, state management, and determinism constraints. Use it when building long-running processes, distributed transactions, or microservice orchestration.
Use Workflow Orchestration Patterns in Claude, ChatGPT or Ahel Desktop
Free. Sign in, add Workflow Orchestration Patterns and connect your AI. About a minute.
Also: Claude Code · Cursor · Codex
Then ask your AI: use the Workflow Orchestration Patterns skill
Details
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; ahel provides instructions and does not run this skill.
No other account needed.
Have an AI agent that can load skills.
What your AI can do with it
- Separate workflow logic from activity execution
- Apply saga patterns for distributed transactions
- Manage state in long-running processes
- Respect determinism constraints in workflow code
- Design microservice orchestration with Temporal
Getting started
- Have an AI agent that can load skills.
- Add the workflow-orchestration-patterns skill to the agent.
- Ask the agent to design a workflow for your distributed system.
- Review the proposed workflow and activity separation.
What this skill tells your AI
The instructions your AI receives, as published by wshobson/agents in plugins/backend-development/skills/workflow-orchestration-patterns/SKILL.md and read by ahel’s review.
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
Signals
- GitHub stars
- 40k
- Forks
- 4k
- Last commit
- Sep 2026
Questions
- What is workflow vs activity separation?
- Workflows define the orchestration logic and must be deterministic. Activities perform side effects like network calls or database writes. Keeping them separate lets Temporal replay workflows reliably.
- What are saga patterns?
- Saga patterns coordinate distributed transactions by defining compensating actions for each step. If a later step fails, earlier steps are undone through their compensations.
- What are determinism constraints?
- Workflow code must be deterministic so it can be replayed from history. Avoid random values, direct time calls, and non-deterministic operations inside workflows.
- When should I use this skill?
- Use it when building long-running processes, distributed transactions, or microservice orchestration that need durable execution.
Advanced
- Item type
- skill
- Key
workflow-orchestration-patterns- Source
- github.com/wshobson/agents