Sequential Execution

Items inside <steps> execute in document order. Successful earlier outputs become available to later items.

Build a dependency

WOML
<steps>
  <step id="load"><script>return { value: 21 };</script></step>
  <step id="double"><script>return { value: context.steps.load.value * 2 };</script></step>
</steps>

This source creates an edge from load to double. WOML validates the reference before execution.

Keep steps meaningful

Give each durable operation a stable ID and a human-readable name. A step should return only data needed later. Use local functions for tiny calculations that do not need a separate durable boundary.

Control-flow containers participate in the same sequence: the next main-flow item waits until the container's continuation rule is satisfied.

Build a readable pipeline

WOML
<steps>
  <step id="loadOrder" name="Load order">
    <script>
      return { orderId: context.payload.orderId, subtotal: 100 };
    </script>
  </step>

  <step id="calculateTotal" name="Calculate total">
    <script>
      const order = context.steps.loadOrder;
      return { ...order, total: order.subtotal * 1.2 };
    </script>
  </step>

  <step id="confirm" name="Build confirmation">
    <script>
      return {
        message: `Order ${context.steps.calculateTotal.orderId} totals ${context.steps.calculateTotal.total}`
      };
    </script>
  </step>
</steps>

The graph follows the document: loadOrder must succeed before calculateTotal, which must succeed before confirm. No after attribute is required or accepted.

Understand failure propagation

If calculateTotal exhausts its attempts, confirm never runs. WOML records the failed node and settles the main business flow. Lifecycle failure hooks may observe the outcome, but they do not turn the failed business process into success.

Avoid unnecessary steps

Create a separate step when work needs its own operational name, durable result, retry boundary, timing, or failure visibility. Keep tiny pure calculations inside their surrounding step when splitting them would only add ceremony.

Sequential flow should be the default. Introduce concurrency only when operations are genuinely independent and safe to overlap.