{
	"schemaVersion": "2",
	"name": "Greet flow",
	"start": "condition.1",
	"nodes": {
		"response.success": {
			"type": "nodehandler://axway-flow/http",
			"name": "Success (HTTP 200)",
			"method": "setresponse",
			"parameters": [
				{
					"name": "status",
					"value": "200",
					"type": "number"
				},
				{
					"name": "body",
					"value": "$.greeting"
				}
			],
			"outputs": {
				"next": {
					"context": "$.response"
				}
			}
		},
		"response.error": {
			"type": "nodehandler://axway-flow/http",
			"name": "Bad Request (HTTP 400)",
			"method": "setresponse",
			"parameters": [
				{
					"name": "status",
					"value": "400",
					"type": "number"
				}
			],
			"outputs": {
				"next": {
					"context": "$.response"
				}
			}
		},
		"doT.1": {
			"type": "nodehandler://nodehandler-dot/doT",
			"name": "Format Greeting",
			"method": "formatStr",
			"parameters": [
				{
					"name": "data",
					"value": "$"
				},
				{
					"name": "template",
					"value": "\"{{=it.config.helloworld.salutation}} {{=it.params.username}}\"",
					"type": "string"
				}
			],
			"outputs": {
				"next": {
					"context": "$.greeting",
					"routes": [
						"response.success"
					]
				},
				"error": {
					"context": "$.error",
					"routes": [
						"response.error"
					]
				}
			}
		},
		"condition.1": {
			"type": "nodehandler://axway-flow/condition",
			"name": "Check Username",
			"method": "exists",
			"parameters": [
				{
					"name": "source",
					"value": "$.params.username"
				}
			],
			"outputs": {
				"true": {
					"context": "$.exists",
					"routes": [
						"doT.1"
					]
				},
				"false": {
					"context": "$.exists",
					"routes": [
						"response.error"
					]
				}
			}
		}
	}
}
