Your first process
Begin with two states and one expression action. This keeps the process independent of external services.
Define the process
Save this as hello-process.json in your working directory.
json
{
"schemaVersion": "1.0",
"key": "hello-process",
"version": 1,
"name": "Hello process",
"initialState": "prepare",
"variables": {
"strict": true,
"schema": {
"message": { "type": "string" }
}
},
"states": {
"prepare": {
"kind": "automatic",
"onEntry": [
{
"id": "set-message",
"type": "expression",
"assignTo": "message",
"config": { "$expr": "'Hello from Duna'" }
}
],
"transitions": [{ "id": "finish", "to": "done", "default": true }]
},
"done": { "kind": "terminal", "outcome": "completed" }
}
}This is a website-authored example using the documented definition model. initialState names the entry state. The expression writes a declared variable; the default transition enters a terminal state.
Publish and start
With the development stack running:
bash
curl -i -X POST http://localhost:5218/definitions \
-H 'Content-Type: application/json' \
--data-binary @hello-process.json
curl -i -X POST http://localhost:5218/definitions/hello-process/instances \
-H 'Content-Type: application/json' \
-d '{}'Publication assigns the saved version. Inspect the response and instance history to confirm the message value and completed outcome.
Make one change at a time
Add a human task or timer, validate the definition, and simulate it before publishing another version. For richer examples, start from the template collection.