Habilidades workflow-orchestration-patterns
⚙️

workflow-orchestration-patterns

Seguro

Design reliable distributed workflows with Temporal patterns

Também disponível em: wshobson

Building reliable distributed systems is challenging due to failures, timeouts, and state management complexity. This skill provides proven workflow orchestration patterns from Tempotal that handle failures automatically, preserve state across crashes, and scale horizontally.

Suporta: Claude Codex Code(CC)
🥉 75 Bronze
1

Baixar o ZIP da skill

2

Upload no Claude

Vá em Configurações → Capacidades → Skills → Upload skill

3

Ative e comece a usar

Testar

A utilizar "workflow-orchestration-patterns". Design a payment workflow with inventory reservation, charge, and fulfillment steps

Resultado esperado:

Here is a saga pattern design: 1) ReserveInventoryActivity (compensation: ReleaseInventoryActivity), 2) ChargePaymentActivity (compensation: RefundPaymentActivity), 3) FulfillOrderActivity (compensation: CancelFulfillmentActivity). Register each compensation before execution. On any failure, run compensations in LIFO order. All activities must be idempotent.

A utilizar "workflow-orchestration-patterns". Why can't I use datetime.now() in my workflow?

Resultado esperado:

Workflows must be deterministic for replay. datetime.now() returns different values each time, breaking determinism. Use workflow.now() instead, which provides deterministic time based on workflow clock time. The same principle applies to random() - use workflow.random() for deterministic random numbers.

A utilizar "workflow-orchestration-patterns". How do I handle a 3rd party API call that might take hours?

Resultado esperado:

Use the Async Callback Pattern: 1) Activity sends request to external system, 2) Workflow waits for signal using workflow.wait_for_condition(), 3) External system calls webhook when complete, 4) Signal handler resumes workflow with response. Include timeout in case external system never responds.

Auditoria de Segurança

Seguro
v1 • 2/25/2026

Static analysis detected 24 potential security issues (external commands, weak cryptography, system reconnaissance), but all are FALSE POSITIVES. The skill contains only markdown documentation with code examples in backticks for illustration purposes. No executable code is present - this is a purely educational skill about Temporal workflow patterns with pseudo-code diagrams and best practices. The 'backtick' patterns are markdown formatting, not shell execution. The 'weak cryptography' flags are false positives from words like 'temporal' matching crypto patterns. The skill is safe to publish.

1
Arquivos analisados
336
Linhas analisadas
1
achados
1
Total de auditorias
Problemas de Baixo Risco (1)
Static Analysis False Positives
Static scanner detected 24 patterns (external_commands, blocker, cryptography) but all are markdown documentation formatting, not executable code. Lines 27, 92-222 contain backtick-enclosed text for code examples (e.g., `workflow.now()`, `datetime.now()`) and pseudo-code diagrams. These are documentation illustrations, not actual shell commands or cryptographic operations. The skill is pure educational content with no execution capabilities.
Auditado por: claude

Pontuação de qualidade

38
Arquitetura
100
Manutenibilidade
87
Conteúdo
50
Comunidade
100
Segurança
100
Conformidade com especificações

O Que Você Pode Construir

E-commerce transaction coordination

Implement distributed transactions for order processing that reserves inventory, charges payment, and fulfills orders with automatic rollback on any failure

Long-running business process automation

Create multi-step approval workflows that span days or weeks with automatic state persistence, timeout handling, and human escalation logic

Microservices orchestration architecture

Design resilient service communication patterns using entity workflows and saga compensation instead of brittle distributed transactions

Tente Estes Prompts

Design a distributed transaction workflow
Design a Temporal workflow for a [domain] transaction that involves [steps]. Include compensation logic for each step and explain how to handle partial failures.
Convert state machine to workflow
I have a state machine with [states] and transitions. Help me design this as a Temporal workflow with proper determinism and activity separation.
Troubleshoot workflow determinism violations
My workflow failed with determinism error. The code uses [code snippet]. Explain why this violates determinism and how to fix it using workflow-safe alternatives.
Scale workflow architecture design
I need to process [number] items per day through workflows. Design a scalable architecture using fan-out/fan-in, child workflows, and task queue partitioning.

Melhores Práticas

  • Keep workflows focused on orchestration logic - put all external calls in activities
  • Make all activities idempotent so retries are safe - use idempotency keys or upserts
  • Always configure timeouts and retry policies - distinguish between retryable and non-retryable errors

Evitar

  • Calling external APIs or databases directly from workflow code - always use activities
  • Using datetime.now(), random(), or threading in workflows - breaks determinism and replay
  • Making activities non-idempotent - retries will cause duplicate side effects

Perguntas Frequentes

What is the difference between a workflow and an activity?
Workflows contain orchestration logic and decision-making. They must be deterministic and cannot make external calls. Activities handle all external interactions like API calls and database writes. Activities can be non-deterministic and include built-in retry logic.
Why must workflows be deterministic?
Temporal replays workflows from history during recovery. If the same inputs produce different outputs, replay breaks and state becomes inconsistent. Determinism guarantees that workflows recover exactly from failures and behave predictably across executions.
How do I handle compensation in saga transactions?
Register each compensation activity before executing its corresponding step. Store compensations in a list. On failure, execute all compensations in reverse order (last-in-first-out). Ensure each compensation is idempotent so retries are safe.
Can workflows run forever?
Yes, workflows can run for years. Temporal persists state automatically and survives infrastructure failures. Entity workflows representing long-lived objects like carts or accounts can persist for the lifetime of that entity, receiving signals and responding to queries.
How do I scale workflows to process millions of tasks?
Do not scale individual workflows. Use fan-out/fan-in: spawn many child workflows or parallel activities, wait for completion, then aggregate results. For one million tasks, spawn one thousand child workflows each processing one thousand tasks. Keep each workflow bounded.
What happens if an activity fails?
Temporal retries activities automatically by default. Configure retry policies with initial interval, backoff coefficient, maximum interval, and maximum attempts. For non-retryable errors like invalid input, throw a specific error type to stop retries immediately.

Detalhes do Desenvolvedor

Estrutura de arquivos

📄 SKILL.md