WithWorkflows

Interface for workflow-enabled entities

Audience: Programmer

The WithWorkflows interface is implemented by entities that can trigger and participate in Temporal workflows for complex business processes.

Fields

Field
Type
Description

workflows

[Workflow!]

Active workflows for this entity

workflowHistory

WorkflowConnection

Historical workflow executions

canStartWorkflow

Boolean!

Whether new workflows can be started

Workflow Integration

Entities with workflows can:

  • Trigger automated processes

  • Require approvals

  • Orchestrate multi-step operations

  • Handle long-running tasks

  • Implement saga patterns

Implementing Types

  • PickingOrder

  • ReceivingInbound

  • InventoryItem

  • Customer

  • Supplier

Usage

Common Workflows

  • Order Fulfillment - Pick, pack, ship

  • Receiving - Inspect, count, putaway

  • Inventory Counts - Cycle counting

  • Returns - RMA processing

  • Transfers - Multi-step movements

Workflow States

  • PENDING - Waiting to start

  • RUNNING - Currently executing

  • COMPLETED - Successfully finished

  • FAILED - Execution failed

  • CANCELLED - Manually cancelled

  • TERMINATED - Force stopped

Best Practices

  1. Design idempotent workflow activities

  2. Handle partial failures gracefully

  3. Implement compensation logic

  4. Monitor workflow metrics

  5. Set appropriate timeouts

See Also

Last updated

Was this helpful?