name: user-dashboard
trigger:
- type: http
path: /dashboard/:userId
methods: [GET]
auth:
type: bearer
secret: ${env.API_KEY}
responses:
html: {enabled: true}
templateEngine: liquid
flow:
# Step 1: Fetch user data
- agent: get-user
input: {userId: ${input.params.userId}}
# Step 2: Fetch user stats
- agent: get-user-stats
input: {userId: ${input.params.userId}}
# Step 3: Render HTML dashboard
- operation: html
config:
template: |
<!DOCTYPE html>
<html>
<head>
<title>Dashboard - {{ get-user.name }}</title>
</head>
<body>
<h1>Welcome, {{ get-user.name }}</h1>
<div class="stats">
<p>Total Orders: {{ get-user-stats.orders }}</p>
<p>Revenue: ${{ get-user-stats.revenue }}</p>
</div>
</body>
</html>
data:
get-user: ${get-user}
get-user-stats: ${get-user-stats}