{ "id": "eZT6SZ4Kvmq5TzyQ", "meta": { "instanceId": "workflow-cd600ed0", "versionId": "1.0.0", "createdAt": "2025-09-29T07:07:43.789468", "updatedAt": "2025-09-29T07:07:43.789531", "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 ‘Test workflow’", "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, -460 ], "parameters": { "width": 505, "height": 320, "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\n[Watch youtube tutorial here]({{ $env.WEBHOOK_URL }}\n\n[Get my SEO A.I. agent system here]({{ $env.WEBHOOK_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": "0c09e5c7-49a9-4f11-b93e-35659360fe02", "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-624078c8", "type": "main", "index": 0 } ], [ { "node": "error-handler-01b04872-9aea-4834-8df5-f6c91914133d-7baca0df", "type": "main", "index": 0 } ], [ { "node": "error-handler-01b04872-9aea-4834-8df5-f6c91914133d-6ad4a325", "type": "main", "index": 0 } ], [ { "node": "error-handler-01b04872-9aea-4834-8df5-f6c91914133d-0b94eaef", "type": "main", "index": 0 } ], [ { "node": "error-handler-01b04872-9aea-4834-8df5-f6c91914133d-1a5cc3be", "type": "main", "index": 0 } ], [ { "node": "error-handler-01b04872-9aea-4834-8df5-f6c91914133d-b0ab440c", "type": "main", "index": 0 } ], [ { "node": "error-handler-01b04872-9aea-4834-8df5-f6c91914133d-52a35847", "type": "main", "index": 0 } ], [ { "node": "error-handler-01b04872-9aea-4834-8df5-f6c91914133d-37597962", "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-0ac52eb3", "type": "main", "index": 0 } ], [ { "node": "error-handler-470715b6-0878-48b8-b6c6-40de27fbc966-45f17769", "type": "main", "index": 0 } ], [ { "node": "error-handler-470715b6-0878-48b8-b6c6-40de27fbc966-a2ee828d", "type": "main", "index": 0 } ], [ { "node": "error-handler-470715b6-0878-48b8-b6c6-40de27fbc966-2d8a7e08", "type": "main", "index": 0 } ], [ { "node": "error-handler-470715b6-0878-48b8-b6c6-40de27fbc966-c1c0d490", "type": "main", "index": 0 } ], [ { "node": "error-handler-470715b6-0878-48b8-b6c6-40de27fbc966-947e26b7", "type": "main", "index": 0 } ], [ { "node": "error-handler-470715b6-0878-48b8-b6c6-40de27fbc966-515da42e", "type": "main", "index": 0 } ], [ { "node": "error-handler-470715b6-0878-48b8-b6c6-40de27fbc966-b8f7e3e3", "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-b3081c18", "type": "main", "index": 0 } ], [ { "node": "error-handler-ea4bb37f-96d9-41b8-bf46-fb09865a6e0f-248e497a", "type": "main", "index": 0 } ], [ { "node": "error-handler-ea4bb37f-96d9-41b8-bf46-fb09865a6e0f-ef78357b", "type": "main", "index": 0 } ], [ { "node": "error-handler-ea4bb37f-96d9-41b8-bf46-fb09865a6e0f-9f583126", "type": "main", "index": 0 } ], [ { "node": "error-handler-ea4bb37f-96d9-41b8-bf46-fb09865a6e0f-05327f50", "type": "main", "index": 0 } ], [ { "node": "error-handler-ea4bb37f-96d9-41b8-bf46-fb09865a6e0f-4921c6b6", "type": "main", "index": 0 } ], [ { "node": "error-handler-ea4bb37f-96d9-41b8-bf46-fb09865a6e0f-8bfc065e", "type": "main", "index": 0 } ], [ { "node": "error-handler-ea4bb37f-96d9-41b8-bf46-fb09865a6e0f-b1dce6d5", "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-13db855a", "type": "main", "index": 0 } ], [ { "node": "error-handler-f3734045-1318-4234-a3ac-61b766124609-25548b2e", "type": "main", "index": 0 } ], [ { "node": "error-handler-f3734045-1318-4234-a3ac-61b766124609-f050aecf", "type": "main", "index": 0 } ], [ { "node": "error-handler-f3734045-1318-4234-a3ac-61b766124609-c6693825", "type": "main", "index": 0 } ], [ { "node": "error-handler-f3734045-1318-4234-a3ac-61b766124609-465fd2f1", "type": "main", "index": 0 } ], [ { "node": "error-handler-f3734045-1318-4234-a3ac-61b766124609-114ad943", "type": "main", "index": 0 } ], [ { "node": "error-handler-f3734045-1318-4234-a3ac-61b766124609-d22bfd2b", "type": "main", "index": 0 } ], [ { "node": "error-handler-f3734045-1318-4234-a3ac-61b766124609-6c65ae43", "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-c3339f10", "type": "main", "index": 0 } ], [ { "node": "error-handler-c2d3d396-09fa-4800-b56d-40ed7592cd3c-444073ff", "type": "main", "index": 0 } ], [ { "node": "error-handler-c2d3d396-09fa-4800-b56d-40ed7592cd3c-23e2b652", "type": "main", "index": 0 } ], [ { "node": "error-handler-c2d3d396-09fa-4800-b56d-40ed7592cd3c-27a21614", "type": "main", "index": 0 } ], [ { "node": "error-handler-c2d3d396-09fa-4800-b56d-40ed7592cd3c-9bcfdd84", "type": "main", "index": 0 } ], [ { "node": "error-handler-c2d3d396-09fa-4800-b56d-40ed7592cd3c-4ed0b4d3", "type": "main", "index": 0 } ], [ { "node": "error-handler-c2d3d396-09fa-4800-b56d-40ed7592cd3c-24e025b4", "type": "main", "index": 0 } ], [ { "node": "error-handler-c2d3d396-09fa-4800-b56d-40ed7592cd3c-03eea5d1", "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." }