Lemline documentation Help

Workflow Task Types

A workflow's do list contains named tasks. Each entry has exactly one name with a task configuration beneath it. See Supported Features for which configuration variants Lemline can execute.

Task

Purpose

do

Group tasks in a nested list

set

Construct a value from literal data and expressions

switch

Choose a flow directive using conditions

for

Iterate over a collection

fork

Run independent branches concurrently

wait

Pause an instance for a duration

try

Catch errors, retry or run a fallback

raise

Raise a defined or inline workflow error

emit

Publish a CloudEvent

listen

Wait for matching CloudEvents

call

Invoke a service or workflow function

run

Invoke a child workflow or other process

Connect tasks

A task can provide an if condition, configure data with input, output and export, or change the default sequence with then.

document: dsl: '1.0.3' namespace: examples name: validate-and-route-order version: '1.0.0' input: schema: format: json document: type: object required: [orderId, total] properties: orderId: type: string total: type: number minimum: 0 do: - routeOrder: switch: - largeOrder: when: ${ .total >= 1000 } then: requestReview - automatic: then: acceptOrder - requestReview: set: status: needs-review then: exit - acceptOrder: set: status: accepted output: as: '${ { orderId: $workflow.input.orderId, status: .status } }'

See DSL Syntax Reference for workflow-level sections and expression scopes.

Run the Examples

Every example on this page is a complete workflow. Complete the SQLite setup, save each example under the file name used below, and run the commands from the setup directory. With the JAR, substitute java -jar lemline.jar for bin/lemline.

Keep the setup worker running and use a second terminal in the setup directory.

bin/lemline definition post -f validate-and-route-order.yaml bin/lemline instance start examples validate-and-route-order --input '{"orderId":"ORD-301","total":250}' bin/lemline instance start examples validate-and-route-order --input '{"orderId":"ORD-302","total":1500}'

Example

Expected result

ORD-301

{"orderId":"ORD-301","status":"accepted"}

ORD-302

{"orderId":"ORD-302","status":"needs-review"}

25 November 2026