# Orchestrate Complex Workflows with Ease

> Compose multiple actions into sophisticated workflows with parallel execution, dependency management, and automatic rollback.

Canonical: https://actions.do/

## In code

```ts
import { Actions } from 'actions.do'

on.Purchase.completed(async $ => {
  // Run actions in parallel for speed
  const [payment, inventory, shipping] = await Actions.parallel([
    $.Stripe.capture.Payment({ orderId: $.id }),
    $.Inventory.reserve.Items({ items: $.items }),
    $.Logistics.calculate.Route({ destination: $.address })
  ])

  // Create shipment and notify customer
  $.Shipment.create.Order({ orderId: $.id, tracking: shipping.id })
  $.Email.send.Confirmation({ to: $.customer, tracking: shipping.id })
})
```

## Frequently asked questions

### How does parallel execution work in actions.do?

Actions.parallel() executes multiple actions concurrently with intelligent scheduling across 300+ edge locations, achieving 5-10x speedup while maintaining transactional consistency and preserving partial results with automatic compensation.

### What happens if one action in a workflow fails?

Automatic compensation (saga pattern) rolls back completed actions using inverse operations with exponential backoff retry, full audit trails, and dead letter queues for unrecoverable failures.

### Can workflows handle long-running distributed transactions?

Yes, with durable execution checkpointing every 100ms and ACID guarantees across services (Stripe, Shopify, Salesforce) using two-phase commit or saga patterns—handling processes spanning minutes to days.

### How do I monitor and debug workflow execution?

Real-time execution graphs, distributed tracing via OpenTelemetry, time-travel debugging, and automatic insights like 'Payment action taking 2s avg' with full logs exported to your observability platform.

### Can workflows adapt to changing business logic?

Yes, with automatic migration of in-flight executions, AI-powered optimization suggestions, hot-reload without downtime, A/B testing via feature flags, and instant rollback capabilities.

## Part of Platform.do

actions.do is one of the primitives of Platform.do, in the Workflows layer (triggers, steps and functions). Every .do shares one grammar, Business-as-Code, and one SDK.

- What is Business-as-Code? https://platform.do/business-as-code
- Platform.do: https://platform.do/
- Docs: https://docs.platform.do
