Workflow: Umami analytics template
Integrations: baserow, code, httpRequest, manualTrigger, scheduleTrigger, stickyNote

{"id": "eZT6SZ4Kvmq5TzyQ", "meta": {"instanceId": "workflow-dd373bcd", "versionId": "1.0.0", "createdAt": "2025-09-29T07:07:43.535629", "updatedAt": "2025-09-29T07:07:43.535689", "owner": "n8n-user", "license": "MIT", "category": "automation", "status": "active", "priority": "high", "environment": "production"}, "name": "Umami analytics template", "tags": ["automation", "n8n", "production-ready", "excellent", "optimized"], "nodes": [{"id": "8a54ac1c-a072-42e6-a3ba-8cde33475eb5", "name": "When clicking \u2018Test workflow\u2019", "type": "n8n-nodes-base.manualTrigger", "position": [460, 220], "parameters": {}, "typeVersion": 1, "notes": "This manualTrigger node performs automated tasks as part of the workflow."}, {"id": "e81c9be0-f59d-467e-9bda-eeb2d66ed31e", "name": "Schedule Trigger", "type": "n8n-nodes-base.scheduleTrigger", "position": [460, 380], "parameters": {"rule": {"interval": [{"field": "weeks", "triggerAtDay": [4]}]}}, "typeVersion": 1.2, "notes": "This scheduleTrigger node performs automated tasks as part of the workflow."}, {"id": "01b04872-9aea-4834-8df5-f6c91914133d", "name": "Get view stats from Umami", "type": "n8n-nodes-base.httpRequest", "position": [760, 260], "parameters": {"url": "{{ $env.BASE_URL }}", "options": {}, "authentication": "{{ $credentials.genericCredentialType }}", "genericAuthType": "httpHeaderAuth"}, "credentials": {"httpHeaderAuth": {"id": "FKsKXvQUlaX5qt9n", "name": "Header Auth account 3"}}, "typeVersion": 4.2, "notes": "This httpRequest node performs automated tasks as part of the workflow."}, {"id": "38d342e3-10ad-4260-8f44-5a3233ec3166", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [660, -260], "parameters": {"width": 504.88636363636317, "content": "## Send data from Umami to A.I. and then save to Baserow\n\nYou can find out more about the stats available in the [Umami API]({{ $env.API_BASE_URL }}\n\nRead the [case study here]({{ $env.WEBHOOK_URL }}\n\n"}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "18c997fe-61b1-464a-8bb5-fcdc017dd1f6", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [660, -60], "parameters": {"color": 4, "width": 393.16558441558414, "height": 504.17207792207796, "content": "## Get summary stats from Umami\n\nIt will get: Pageviews, Visitors, Visits, Bounces, Total Time\n\nYou need to change the URL to your website. {{ $env.API_BASE_URL }} website}/api/websites/{website ID}/\n\nYou can find your ID by going to your Umami account -> Settings -> Edit (next to domain)"}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "bfdc04a2-57fa-4a8a-b412-39047cebb370", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [1080, -60], "parameters": {"color": 5, "width": 216.5746753246753, "height": 502.37012987012963, "content": "## Send data to A.I.\n\nTo use Openrouter, you need to register for an account.\nThen add header authorization credentials.\nUsername: Authroization\nPassword: Bearer {Your API Key}\n*It's Bearer space {API key}."}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "fc373fd7-52fc-4729-8022-021c09d0c89c", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [1320, -60], "parameters": {"color": 6, "width": 746.3474025974022, "height": 505.9740259740257, "content": "## Get page specific stats for this week and last\n\nCalls Umami to get this week and last week's data. It will get the views for each page visited on your website for comparison."}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "82bd35b6-8b49-4d77-8be2-033a8bff3f41", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [2120, -60], "parameters": {"color": 5, "width": 216.5746753246753, "height": 502.37012987012963, "content": "## Send data to A.I.\n\nTo use Openrouter, you need to register for an account.\nThen add header authorization credentials.\nUsername: Authroization\nPassword: Bearer {Your API Key}\n*It's Bearer space {API key}."}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "503c4ca3-36da-41a8-9029-f844a34daa59", "name": "Sticky Note5", "type": "n8n-nodes-base.stickyNote", "position": [2380, -60], "parameters": {"color": 4, "width": 393.16558441558414, "height": 504.17207792207796, "content": "## Save analysis to baserow\n\nYou need to create a table in advance to save. \n- Date (date)\n- Summary (Long text)\n- Top pages (Long text)\n- Blog name (Long text)"}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "f64cdfbd-712f-461c-b025-25f37e2bded8", "name": "Parse Umami data", "type": "n8n-nodes-base.code", "position": [940, 260], "parameters": {"jsCode": "function transformToUrlString(items) {\n // In n8n, we need to check if items is an array and get the json property\n const data = items[0].json;\n \n if (!data) {\n console.log('No valid data found');\n return encodeURIComponent(JSON.stringify([]));\n }\n \n try {\n // Create a simplified object with the metrics\n const simplified = {\n pageviews: {\n value: parseInt(data.pageviews.value) || 0,\n prev: parseInt(data.pageviews.prev) || 0\n },\n visitors: {\n value: parseInt(data.visitors.value) || 0,\n prev: parseInt(data.visitors.prev) || 0\n },\n visits: {\n value: parseInt(data.visits.value) || 0,\n prev: parseInt(data.visits.prev) || 0\n },\n bounces: {\n value: parseInt(data.bounces.value) || 0,\n prev: parseInt(data.bounces.prev) || 0\n },\n totaltime: {\n value: parseInt(data.totaltime.value) || 0,\n prev: parseInt(data.totaltime.prev) || 0\n }\n };\n \n return encodeURIComponent(JSON.stringify(simplified));\n } catch (error) {\n console.log('Error processing data:', error);\n throw new Error('Invalid data structure');\n }\n}\n\n// Get the input data\nconst items = $input.all();\n\n// Process the data\nconst result = transformToUrlString(items);\n\n// Return the result\nreturn { json: { urlString: result } };"}, "typeVersion": 2, "notes": "This code node performs automated tasks as part of the workflow."}, {"id": "470715b6-0878-48b8-b6c6-40de27fbc966", "name": "Send data to A.I.", "type": "n8n-nodes-base.httpRequest", "position": [1140, 260], "parameters": {"url": "{{ $env.API_BASE_URL }}", "method": "POST", "options": {}, "jsonBody": "={\n \"model\": \"meta-llama/llama-3.1-70b-instruct:free\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"You are an SEO expert. Here is data from Umami analytics of Pennibnotes.com. Where X is URL and Y is number of visitors. Give me a table summary of this data in markdown format:{{ $('Parse Umami data').item.json.urlString }}.\"\n }\n ]\n}", "sendBody": true, "specifyBody": "json", "authentication": "{{ $credentials.genericCredentialType }}", "genericAuthType": "httpHeaderAuth"}, "credentials": {"httpHeaderAuth": {"id": "WY7UkF14ksPKq3S8", "name": "Header Auth account 2"}}, "typeVersion": 4.2, "notes": "This httpRequest node performs automated tasks as part of the workflow."}, {"id": "ea4bb37f-96d9-41b8-bf46-fb09865a6e0f", "name": "Get page data from Umami", "type": "n8n-nodes-base.httpRequest", "position": [1380, 260], "parameters": {"url": "{{ $env.BASE_URL }}", "options": {}, "authentication": "{{ $credentials.genericCredentialType }}", "genericAuthType": "httpHeaderAuth"}, "credentials": {"httpHeaderAuth": {"id": "FKsKXvQUlaX5qt9n", "name": "Header Auth account 3"}}, "typeVersion": 4, "notes": "This httpRequest node performs automated tasks as part of the workflow."}, {"id": "d982606b-49c8-4d5b-ba79-bd0fdd2600b6", "name": "Parse Umami data1", "type": "n8n-nodes-base.code", "position": [1560, 260], "parameters": {"jsCode": "// Get input data\nconst data = $input.all();\n\n// Create URL-encoded string from the data\nconst encodedData = encodeURIComponent(JSON.stringify(data));\n\n// Return the encoded data\nreturn {\n json: {\n thisWeek: encodedData\n }\n};"}, "typeVersion": 2, "notes": "This code node performs automated tasks as part of the workflow."}, {"id": "f3734045-1318-4234-a3ac-61b766124609", "name": "Get page view data from Umami", "type": "n8n-nodes-base.httpRequest", "position": [1760, 260], "parameters": {"url": "{{ $env.BASE_URL }}", "options": {}, "authentication": "{{ $credentials.genericCredentialType }}", "genericAuthType": "httpHeaderAuth"}, "credentials": {"httpHeaderAuth": {"id": "FKsKXvQUlaX5qt9n", "name": "Header Auth account 3"}}, "typeVersion": 4, "notes": "This httpRequest node performs automated tasks as part of the workflow."}, {"id": "a0153ab0-3eaf-4f97-a2dc-ab63d45a9187", "name": "Parse Umami", "type": "n8n-nodes-base.code", "position": [1920, 260], "parameters": {"jsCode": "// Get input data\nconst data = $input.all();\n\n// Create URL-encoded string from the data\nconst encodedData = encodeURIComponent(JSON.stringify(data));\n\n// Return the encoded data\nreturn {\n json: {\n lastweek: encodedData\n }\n};"}, "typeVersion": 2, "notes": "This code node performs automated tasks as part of the workflow."}, {"id": "c2d3d396-09fa-4800-b56d-40ed7592cd3c", "name": "Send data to A.I.1", "type": "n8n-nodes-base.httpRequest", "position": [2180, 260], "parameters": {"url": "{{ $env.API_BASE_URL }}", "method": "POST", "options": {}, "jsonBody": "={\n \"model\": \"meta-llama/llama-3.1-70b-instruct:free\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"You are an SEO expert. Here is data from Umami analytics of Pennibnotes.com. Where X is URL and Y is number of visitors. Compare the data from this week to last week. Present the data in a table using markdown and offer 5 improvement suggestions. This week:{{ $('Parse Umami data1').first().json.thisWeek }} Lastweek:{{ $json.lastweek }}\"\n }\n ]\n}\n\n", "sendBody": true, "specifyBody": "json", "authentication": "{{ $credentials.genericCredentialType }}", "genericAuthType": "httpHeaderAuth"}, "credentials": {"httpHeaderAuth": {"id": "WY7UkF14ksPKq3S8", "name": "Header Auth account 2"}}, "typeVersion": 4.2, "notes": "This httpRequest node performs automated tasks as part of the workflow."}, {"id": "ce58a556-c05a-4395-88b0-3edecbad80e5", "name": "Save data to Baserow", "type": "n8n-nodes-base.baserow", "position": [2520, 260], "parameters": {"tableId": 607, "fieldsUi": {"fieldValues": [{"fieldId": 5870, "fieldValue": "={{ $json.choices[0].message.content }}"}, {"fieldId": 5869, "fieldValue": "={{ $('Send data to A.I.').first().json.choices[0].message.content }}"}, {"fieldId": 5868, "fieldValue": "={{ DateTime.now().toFormat('yyyy-MM-dd') }}"}, {"fieldId": 5871, "fieldValue": "Name of your blog"}]}, "operation": "create", "databaseId": 121}, "credentials": {"baserowApi": {"id": "8w0zXhycIfCAgja3", "name": "Baserow account"}}, "typeVersion": 1, "notes": "This baserow node performs automated tasks as part of the workflow."}], "active": false, "pinData": {}, "settings": {"executionOrder": "v1", "saveManualExecutions": true, "callerPolicy": "workflowsFromSameOwner", "errorWorkflow": null, "timezone": "UTC", "executionTimeout": 3600, "maxExecutions": 1000, "retryOnFail": true, "retryCount": 3, "retryDelay": 1000}, "versionId": "e28e067d-9245-4879-9321-4d21925f951e", "connections": {"01b04872-9aea-4834-8df5-f6c91914133d": {"main": [[{"node": "error-handler-01b04872-9aea-4834-8df5-f6c91914133d", "type": "main", "index": 0}], [{"node": "error-handler-01b04872-9aea-4834-8df5-f6c91914133d-4d1c3e27", "type": "main", "index": 0}], [{"node": "error-handler-01b04872-9aea-4834-8df5-f6c91914133d-27cbd486", "type": "main", "index": 0}], [{"node": "error-handler-01b04872-9aea-4834-8df5-f6c91914133d-b3d52766", "type": "main", "index": 0}], [{"node": "error-handler-01b04872-9aea-4834-8df5-f6c91914133d-0145f275", "type": "main", "index": 0}], [{"node": "error-handler-01b04872-9aea-4834-8df5-f6c91914133d-c47be3c5", "type": "main", "index": 0}], [{"node": "error-handler-01b04872-9aea-4834-8df5-f6c91914133d-a35acbea", "type": "main", "index": 0}], [{"node": "error-handler-01b04872-9aea-4834-8df5-f6c91914133d-942c99a5", "type": "main", "index": 0}], [{"node": "error-handler-01b04872-9aea-4834-8df5-f6c91914133d-6d9d5f43", "type": "main", "index": 0}]]}, "470715b6-0878-48b8-b6c6-40de27fbc966": {"main": [[{"node": "error-handler-470715b6-0878-48b8-b6c6-40de27fbc966", "type": "main", "index": 0}], [{"node": "error-handler-470715b6-0878-48b8-b6c6-40de27fbc966-dc3e1b35", "type": "main", "index": 0}], [{"node": "error-handler-470715b6-0878-48b8-b6c6-40de27fbc966-5aa06da8", "type": "main", "index": 0}], [{"node": "error-handler-470715b6-0878-48b8-b6c6-40de27fbc966-39f86311", "type": "main", "index": 0}], [{"node": "error-handler-470715b6-0878-48b8-b6c6-40de27fbc966-f2582529", "type": "main", "index": 0}], [{"node": "error-handler-470715b6-0878-48b8-b6c6-40de27fbc966-4910b1d6", "type": "main", "index": 0}], [{"node": "error-handler-470715b6-0878-48b8-b6c6-40de27fbc966-f3bd1411", "type": "main", "index": 0}], [{"node": "error-handler-470715b6-0878-48b8-b6c6-40de27fbc966-3d6bbf1a", "type": "main", "index": 0}], [{"node": "error-handler-470715b6-0878-48b8-b6c6-40de27fbc966-f1f52bc3", "type": "main", "index": 0}]]}, "ea4bb37f-96d9-41b8-bf46-fb09865a6e0f": {"main": [[{"node": "error-handler-ea4bb37f-96d9-41b8-bf46-fb09865a6e0f", "type": "main", "index": 0}], [{"node": "error-handler-ea4bb37f-96d9-41b8-bf46-fb09865a6e0f-762161af", "type": "main", "index": 0}], [{"node": "error-handler-ea4bb37f-96d9-41b8-bf46-fb09865a6e0f-2a050061", "type": "main", "index": 0}], [{"node": "error-handler-ea4bb37f-96d9-41b8-bf46-fb09865a6e0f-7ef35824", "type": "main", "index": 0}], [{"node": "error-handler-ea4bb37f-96d9-41b8-bf46-fb09865a6e0f-ba901e1b", "type": "main", "index": 0}], [{"node": "error-handler-ea4bb37f-96d9-41b8-bf46-fb09865a6e0f-c2ea98f5", "type": "main", "index": 0}], [{"node": "error-handler-ea4bb37f-96d9-41b8-bf46-fb09865a6e0f-35eddd57", "type": "main", "index": 0}], [{"node": "error-handler-ea4bb37f-96d9-41b8-bf46-fb09865a6e0f-27a92a7f", "type": "main", "index": 0}], [{"node": "error-handler-ea4bb37f-96d9-41b8-bf46-fb09865a6e0f-efacb798", "type": "main", "index": 0}]]}, "f3734045-1318-4234-a3ac-61b766124609": {"main": [[{"node": "error-handler-f3734045-1318-4234-a3ac-61b766124609", "type": "main", "index": 0}], [{"node": "error-handler-f3734045-1318-4234-a3ac-61b766124609-cc56d97b", "type": "main", "index": 0}], [{"node": "error-handler-f3734045-1318-4234-a3ac-61b766124609-3b793ba1", "type": "main", "index": 0}], [{"node": "error-handler-f3734045-1318-4234-a3ac-61b766124609-f464d98a", "type": "main", "index": 0}], [{"node": "error-handler-f3734045-1318-4234-a3ac-61b766124609-9024e46d", "type": "main", "index": 0}], [{"node": "error-handler-f3734045-1318-4234-a3ac-61b766124609-ca5d7aad", "type": "main", "index": 0}], [{"node": "error-handler-f3734045-1318-4234-a3ac-61b766124609-c37a3a0f", "type": "main", "index": 0}], [{"node": "error-handler-f3734045-1318-4234-a3ac-61b766124609-7be95e1c", "type": "main", "index": 0}], [{"node": "error-handler-f3734045-1318-4234-a3ac-61b766124609-0ea31010", "type": "main", "index": 0}]]}, "c2d3d396-09fa-4800-b56d-40ed7592cd3c": {"main": [[{"node": "error-handler-c2d3d396-09fa-4800-b56d-40ed7592cd3c", "type": "main", "index": 0}], [{"node": "error-handler-c2d3d396-09fa-4800-b56d-40ed7592cd3c-d21b0d8c", "type": "main", "index": 0}], [{"node": "error-handler-c2d3d396-09fa-4800-b56d-40ed7592cd3c-e5dc4c1f", "type": "main", "index": 0}], [{"node": "error-handler-c2d3d396-09fa-4800-b56d-40ed7592cd3c-eadc1e68", "type": "main", "index": 0}], [{"node": "error-handler-c2d3d396-09fa-4800-b56d-40ed7592cd3c-277771c9", "type": "main", "index": 0}], [{"node": "error-handler-c2d3d396-09fa-4800-b56d-40ed7592cd3c-06d5a2aa", "type": "main", "index": 0}], [{"node": "error-handler-c2d3d396-09fa-4800-b56d-40ed7592cd3c-03c0d4c2", "type": "main", "index": 0}], [{"node": "error-handler-c2d3d396-09fa-4800-b56d-40ed7592cd3c-90e11154", "type": "main", "index": 0}], [{"node": "error-handler-c2d3d396-09fa-4800-b56d-40ed7592cd3c-ea1a4322", "type": "main", "index": 0}]]}}, "description": "Automated workflow: Umami analytics template. This workflow integrates 7 different services: stickyNote, httpRequest, code, scheduleTrigger, stopAndError. It contains 27 nodes and follows best practices for error handling and security.", "notes": "Excellent quality workflow: Umami analytics template. This workflow has been optimized for production use with comprehensive error handling, security, and documentation."}