Examples & Recipes
This section provides practical examples and proven patterns for common Wolf DSL use cases. Each example is self-contained and can be adapted to your specific needs.
Quick Examples
Hello World Flow
Schema Greeting {
string message
string timestamp
}
value helloWorld -> Greeting {
message: "Hello, Wolf DSL!"
timestamp: ${currentDate("yyyy-MM-dd HH:mm:ss")}
}
Mapping formatGreeting input helloWorld output Greeting {
Greeting.message = " " + helloWorld.message
Greeting.timestamp = helloWorld.timestamp
}
Flow simpleFlow {
Start helloWorld {
transition { formatGreeting }
}
formatGreeting {}
}
Simple REST API Call
Schema ApiResponse {
string status
User data
}
Schema User {
string id
string name
string email
}
Service userService method GET as getUser
input UserId output ApiResponse {
Url -> @Config("api.base.url")
Path -> ${"/users/" + UserId.id}
@Header Accept -> ${"application/json"}
@Header Authorization -> ${"Bearer " + @Config("api.token")}
}