{ "name": "Fetch Dashboard Data", "active": false, "nodes": [ { "id": "validate_context", "name": "Validate Context", "type": "metabuilder.validate", "typeVersion": 1, "position": [ 100, 100 ], "parameters": { "input": "{{ $context.user.id }}", "operation": "validate", "validator": "required" } }, { "id": "fetch_user_profile_parallel", "name": "Fetch User Profile Parallel", "type": "metabuilder.operation", "typeVersion": 1, "position": [ 400, 100 ], "parameters": { "operation": "parallel", "tasks": [ { "id": "fetch_user", "op": "database_read", "entity": "User", "params": { "filter": { "id": "{{ $context.user.id }}", "tenantId": "{{ $context.tenantId }}" } } }, { "id": "fetch_unread_notifications", "op": "database_count", "entity": "Notification", "params": { "filter": { "userId": "{{ $context.user.id }}", "tenantId": "{{ $context.tenantId }}", "isRead": false } } }, { "id": "fetch_recent_activity", "op": "database_read", "entity": "ForumPost", "params": { "filter": { "authorId": "{{ $context.user.id }}", "tenantId": "{{ $context.tenantId }}" }, "sort": { "createdAt": -1 }, "limit": 5 } } ] } }, { "id": "fetch_statistics", "name": "Fetch Statistics", "type": "metabuilder.operation", "typeVersion": 1, "position": [ 700, 100 ], "parameters": { "operation": "parallel", "tasks": [ { "id": "count_posts", "op": "database_count", "entity": "ForumPost", "params": { "filter": { "authorId": "{{ $context.user.id }}", "tenantId": "{{ $context.tenantId }}" } } }, { "id": "count_threads", "op": "database_count", "entity": "ForumThread", "params": { "filter": { "authorId": "{{ $context.user.id }}", "tenantId": "{{ $context.tenantId }}" } } }, { "id": "count_media", "op": "database_count", "entity": "MediaAsset", "params": { "filter": { "uploadedBy": "{{ $context.user.id }}", "tenantId": "{{ $context.tenantId }}" } } } ] } }, { "id": "format_response", "name": "Format Response", "type": "metabuilder.transform", "typeVersion": 1, "position": [ 100, 300 ], "parameters": { "output": { "profile": { "id": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_user.output.id }}", "email": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_user.output.email }}", "displayName": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_user.output.displayName }}", "avatar": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_user.output.avatar }}" }, "notifications": { "unread": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_unread_notifications.output }}" }, "statistics": { "posts": "{{ $steps.fetch_statistics.tasks.count_posts.output }}", "threads": "{{ $steps.fetch_statistics.tasks.count_threads.output }}", "mediaUploads": "{{ $steps.fetch_statistics.tasks.count_media.output }}" }, "recentActivity": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_recent_activity.output }}" }, "operation": "transform_data" } }, { "id": "return_success", "name": "Return Success", "type": "metabuilder.action", "typeVersion": 1, "position": [ 400, 300 ], "parameters": { "action": "http_response", "status": 200, "body": "{{ $steps.format_response.output }}" } } ], "connections": { "validate_context": { "main": [ [ { "node": "fetch_user_profile_parallel", "type": "main", "index": 0 } ] ] }, "fetch_user_profile_parallel": { "main": [ [ { "node": "fetch_statistics", "type": "main", "index": 0 } ] ] }, "fetch_statistics": { "main": [ [ { "node": "format_response", "type": "main", "index": 0 } ] ] }, "format_response": { "main": [ [ { "node": "return_success", "type": "main", "index": 0 } ] ] } }, "staticData": {}, "meta": {}, "settings": { "timezone": "UTC", "executionTimeout": 3600, "saveExecutionProgress": true, "saveDataErrorExecution": "all", "saveDataSuccessExecution": "all" }, "id": "workflow_fetch_dashboard_data", "version": "3.0.0", "tenantId": "${TENANT_ID}" }