Generated banner for Workflow Orchestration Patterns
Generated logo for Workflow Orchestration Patterns

Workflow Orchestration Patterns

Seth HobsonCommunityCreated by Seth Hobson

  • Skill
  • Guidelines
  • Software development
  • MIT
  • No issues found

From the author

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.
— the description by Seth Hobson

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides architectural guidance for designing durable, fault-tolerant workflows using Temporal. It focuses on the separation of orchestration logic from external interactions, ensuring determinism in workflows and idempotency in activities. The content covers essential design patterns for distributed systems, including the Saga pattern for transactions, entity-based workflows, parallel execution strategies, and asynchronous callbacks.

What it does

  • Defines the distinction between workflow orchestration and activity execution
  • Explains the Saga pattern for managing distributed transactions
  • Provides patterns for long-lived entity management
  • Outlines strategies for parallel task execution and aggregation
  • Details requirements for workflow determinism and state preservation
  • Lists best practices for error handling and activity design

When to use it

  • When building multi-step processes that span multiple services
  • When implementing distributed transactions with rollback requirements
  • When managing long-running business processes that require state persistence
  • When designing systems that must recover automatically from infrastructure failures
  • When coordinating human-in-the-loop approvals or external callbacks

Advantages

  • Ensures system reliability through automatic state persistence
  • Provides clear separation of concerns between logic and side effects
  • Enables robust failure recovery and retry mechanisms
  • Supports complex coordination of distributed services

Usage examples

“How should I structure a payment process that requires a rollback if the order fulfillment fails?”
The agent explains the Saga pattern, detailing how to register compensation activities before executing the primary payment step to ensure consistency.
“What are the rules for writing code inside a Temporal workflow?”
The agent provides guidelines on maintaining determinism, such as avoiding direct external API calls and using workflow-specific time functions.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/wshobson/workflow-orchestration-patterns/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip workflow-orchestration-patterns.zip -d .agents/skills

Documentation by Seth Hobson

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
  1. Keep workflows focused - Single responsibility per workflow

  2. Small workflows - Use child workflows for scalability

  3. Clear boundaries - Workflow orchestrates, activities execute

  4. Test locally - Use time-skipping test environment

Activity Design
  1. Idempotent operations - Safe to retry

  2. Short-lived - Seconds to minutes, not hours

  3. Timeout configuration - Always set timeouts

  4. Heartbeat for long tasks - Report progress

  5. Error handling - Distinguish retryable vs non-retryable

Common Pitfalls

Workflow Violations:

  • Using datetime.now() instead of workflow.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:

  1. Workflows = orchestration, Activities = external calls

  2. Determinism is non-negotiable for workflows

  3. Idempotency is critical for activities

  4. State preservation is automatic

  5. Design for failure and recovery

Files

LICENSE

MIT License

Copyright (c) 2024 Seth Hobson

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. 

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
Seth Hobson
Publisher
Seth Hobson (Community)
Source
wshobson/agents · plugins/backend-development/skills/workflow-orchestration-patterns · commit 4bde316
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Seth Hobson or Seth Hobson.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download workflow-orchestration-patterns.zip