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
mkdir woml-quick-start
cd woml-quick-startCreate a file named order.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:
<manual>says a person starts each run from the keyboard.prepareOrderreturns a JSON object.calculateTotalreads that object throughcontext.steps.prepareOrder.confirmreads 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
woml check order.womlwoml 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
woml run order.womlWOML 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:
prepareOrder → context.steps.prepareOrder
calculateTotal → context.steps.calculateTotal
confirm → final workflow resultThe 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:
{
"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:
woml check order.womlThis validate-first loop is the normal WOML development cycle:
write → check → run → inspect → refineWhat to learn next
- Workflow Anatomy explains every top-level part of this file.
- Context and Data Flow explains payloads and step outputs.
- Steps and Scripts teaches script behavior and durable return values.
- Manual Triggers explains keyboard activation in more detail.