Quick Start

In this tutorial you will build an order workflow, validate it, run it from the keyboard, and follow data from one step into the next. The example is intentionally small, but it uses the same document and execution model as a production workflow.

Create a project directory

Terminal
mkdir woml-quick-start
cd woml-quick-start

Create a file named order.woml:

WOML
<woml>
  <workflow
    id="order-demo"
    name="Process an order"
    description="Calculate an order total and build a confirmation."
    version="1.0.0"
  >
    <triggers>
      <manual id="start" />
    </triggers>

    <steps>
      <step
        id="prepareOrder"
        name="Prepare order"
        description="Create sample input for this keyboard-driven tutorial."
      >
        <script>
          return {
            orderId: "order-42",
            customer: "Dali",
            subtotal: 120
          };
        </script>
      </step>

      <step
        id="calculateTotal"
        name="Calculate total"
        description="Add twenty percent tax to the prepared subtotal."
      >
        <script>
          const order = context.steps.prepareOrder;
          const tax = order.subtotal * 0.2;

          return {
            orderId: order.orderId,
            subtotal: order.subtotal,
            tax,
            total: order.subtotal + tax
          };
        </script>
      </step>

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

Read the document before running it

The source already tells the story:

  1. <manual> says a person starts each run from the keyboard.
  2. prepareOrder returns a JSON object.
  3. calculateTotal reads that object through context.steps.prepareOrder.
  4. confirm reads the calculated result and becomes the final value-producing step.

The IDs are not decorative. They provide durable identity and become the property names under context.steps.

Validate the workflow

Terminal
woml check order.woml

woml check parses the document, validates elements and attributes, checks identifiers and references, resolves modules, lowers the workflow into its compiled graph, and asks Rust to validate the model boundary. It does not execute your scripts or create a run.

If validation reports an error, read its code, file, line, column, and message. WOML rejects unknown or misplaced syntax instead of silently ignoring it.

Run the automation

Terminal
woml run order.woml

WOML prints the workflow identity and manual-trigger instructions. Press Enter once to create a run.

The process remains active after the run finishes. This is intentional: woml run activates automation rather than executing a one-shot script. Press Enter again to create another independent run, or press Ctrl+C to stop the runtime.

Understand context and results

Every successful step contributes one JSON-compatible result:

Text
prepareOrder  → context.steps.prepareOrder
calculateTotal → context.steps.calculateTotal
confirm       → final workflow result

The runtime does not preserve local variables or mutations to context. It preserves the successful value returned by each step. That event-derived data is what later steps receive.

The final output will resemble:

JSON
{
  "message": "Accepted order-42",
  "total": 144
}

Names and descriptions appear in the colored terminal report, making source and operations use the same vocabulary.

Make a change safely

Change the subtotal in prepareOrder, then validate before running again:

Terminal
woml check order.woml

This validate-first loop is the normal WOML development cycle:

Text
write → check → run → inspect → refine

What to learn next