{ "name": "Engagement Monitor Template", "nodes": [ { "parameters": { "rule": { "interval": [ { "field": "cronExpression", "expression": "0 0,12 * * *" } ] } }, "id": "trigger1", "name": "Every 12 Hours", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.2, "position": [ 0, 0 ] }, { "parameters": { "url": "https://api.github.com/repos/YOUR_GITHUB_USERNAME/YOUR_REPO_1", "options": {}, "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "User-Agent", "value": "open-flow-workflow-templates" } ] } }, "id": "gh1", "name": "GitHub Repo 1", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 220, 0 ] }, { "parameters": { "url": "https://api.github.com/repos/YOUR_GITHUB_USERNAME/YOUR_REPO_2", "options": {}, "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "User-Agent", "value": "open-flow-workflow-templates" } ] } }, "id": "gh2", "name": "GitHub Repo 2", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 440, 0 ] }, { "parameters": { "url": "https://dev.to/api/articles/YOUR_DEVTO_USERNAME/YOUR_ARTICLE_SLUG", "options": {}, "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "User-Agent", "value": "open-flow-workflow-templates" } ] } }, "id": "dt1", "name": "dev.to Article 1", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 660, 0 ] }, { "parameters": { "language": "javaScript", "jsCode": "const summarize = ({ repo1, repo2, article }) => {\n function metric(record, field, label) {\n if (record === null || typeof record !== 'object' || !Number.isFinite(record[field])) {\n throw new Error('Missing or invalid metric: ' + label + '.' + field);\n }\n return record[field];\n }\n function repository(record, label) {\n return {\n stars: metric(record, 'stargazers_count', label),\n forks: metric(record, 'forks_count', label),\n open_issues: metric(record, 'open_issues_count', label),\n };\n }\n return {\n checked_at: new Date().toISOString(),\n repo1: repository(repo1, 'repo1'),\n repo2: repository(repo2, 'repo2'),\n article1: {\n reactions: metric(article, 'positive_reactions_count', 'article'),\n comments: metric(article, 'comments_count', 'article'),\n },\n };\n};\n\nreturn [{json: summarize({repo1: $('GitHub Repo 1').first().json, repo2: $('GitHub Repo 2').first().json, article: $('dev.to Article 1').first().json})}];\n" }, "id": "compile1", "name": "Compile Summary", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 880, 0 ] } ], "connections": { "Every 12 Hours": { "main": [ [ { "node": "GitHub Repo 1", "type": "main", "index": 0 } ] ] }, "GitHub Repo 1": { "main": [ [ { "node": "GitHub Repo 2", "type": "main", "index": 0 } ] ] }, "GitHub Repo 2": { "main": [ [ { "node": "dev.to Article 1", "type": "main", "index": 0 } ] ] }, "dev.to Article 1": { "main": [ [ { "node": "Compile Summary", "type": "main", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1", "timezone": "UTC" }, "active": false, "pinData": {} }