{
"name": "Get User (Complete)",
"trigger": {
"type": "http",
"config": {
"method": "GET",
"path": "/users"
}
},
"nodes": [
{
"id": "validate",
"type": "request",
"config": {
"source": "request.query",
"schema": {
"user_id": "required|integer|min:1|max:10"
}
}
},
{
"id": "fetch_user",
"type": "http",
"config": {
"method": "GET",
"url": "https://jsonplaceholder.typicode.com/users/{{request.query.user_id}}",
"on_error": "continue"
}
},
{
"id": "check_exists",
"type": "condition",
"config": {
"conditions": [
{
"if": "{{fetch_user.output.success}} == true",
"then": ["respond_success"]
}
],
"else": ["respond_not_found"]
}
},
{
"id": "respond_success",
"type": "response",
"config": {
"status": 200,
"body": {
"success": true,
"user": "{{fetch_user.output.body | pick:id:name:email:phone}}"
}
}
},
{
"id": "respond_not_found",
"type": "response",
"config": {
"status": 404,
"body": {
"success": false,
"error": "User not found"
}
}
}
]
}