Files
vyndr/workflows/cheatsheet-daily.json

116 lines
4.5 KiB
JSON

{
"name": "VYNDR · Cheatsheet · Daily 4:30 PM ET",
"active": false,
"nodes": [
{
"parameters": {
"rule": { "interval": [{ "field": "cronExpression", "expression": "30 16 * * *" }] },
"triggerAtSecond": 0
},
"id": "cron-cheatsheet",
"name": "Cron · 4:30 PM ET",
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1,
"position": [200, 200],
"notes": "Set timezone to America/New_York at the workflow level."
},
{
"parameters": {
"url": "={{ $env.VYNDR_API_BASE }}/api/pipeline/refresh",
"method": "POST",
"sendHeaders": true,
"headerParameters": { "parameters": [
{ "name": "X-Pipeline-Secret", "value": "={{ $env.VYNDR_PIPELINE_SECRET }}" },
{ "name": "Content-Type", "value": "application/json" }
] },
"sendBody": true,
"bodyParametersJson": "={ \"sport\": \"nba\" }",
"options": { "timeout": 60000 }
},
"id": "refresh-pipeline",
"name": "Refresh pipeline",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [440, 200]
},
{
"parameters": {
"url": "={{ $env.VYNDR_API_BASE }}/api/cheatsheet",
"method": "GET",
"options": { "timeout": 20000 }
},
"id": "fetch-cheatsheet",
"name": "Fetch cheatsheet data",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [680, 200]
},
{
"parameters": {
"url": "={{ $env.VYNDR_API_BASE }}/api/share-card",
"method": "POST",
"sendHeaders": true,
"headerParameters": { "parameters": [{ "name": "Content-Type", "value": "application/json" }] },
"sendBody": true,
"bodyParametersJson": "={\n \"type\": \"cheatsheet\",\n \"format\": \"square\",\n \"date\": \"={{ $json.data.date }}\",\n \"gameCount\": \"={{ $json.data.gameCount }}\",\n \"grades\": \"={{ $json.data.grades }}\"\n}",
"options": { "response": { "response": { "responseFormat": "file", "outputPropertyName": "card" } }, "timeout": 30000 }
},
"id": "generate-card",
"name": "Generate share card",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [920, 200]
},
{
"parameters": {
"url": "https://api.telegram.org/bot{{ $env.TELEGRAM_BOT_TOKEN }}/sendPhoto",
"method": "POST",
"sendBinaryData": true,
"binaryPropertyName": "card",
"sendBody": true,
"bodyContentType": "multipart-form-data",
"bodyParameters": { "parameters": [
{ "name": "chat_id", "value": "={{ $env.TELEGRAM_CHANNEL_ID }}" },
{ "name": "caption", "value": "Tonight's cheatsheet → vyndr.app" }
] },
"options": { "timeout": 20000 }
},
"id": "push-telegram",
"name": "Push · Telegram",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [1160, 100]
},
{
"parameters": {
"url": "={{ $env.DISCORD_WEBHOOK_DAILY }}",
"method": "POST",
"sendBinaryData": true,
"binaryPropertyName": "card",
"sendBody": true,
"bodyContentType": "multipart-form-data",
"bodyParameters": { "parameters": [
{ "name": "payload_json", "value": "={\"username\":\"VYNDR\",\"embeds\":[{\"description\":\"Tonight's cheatsheet — vyndr.app\",\"color\":56480,\"image\":{\"url\":\"attachment://vyndr.png\"},\"footer\":{\"text\":\"VYNDR · vyndr.app\"}}]}" }
] },
"options": { "timeout": 20000 }
},
"id": "push-discord",
"name": "Push · Discord",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [1160, 300]
}
],
"connections": {
"Cron · 4:30 PM ET": { "main": [[{ "node": "Refresh pipeline", "type": "main", "index": 0 }]] },
"Refresh pipeline": { "main": [[{ "node": "Fetch cheatsheet data","type": "main", "index": 0 }]] },
"Fetch cheatsheet data": { "main": [[{ "node": "Generate share card","type": "main", "index": 0 }]] },
"Generate share card": { "main": [[
{ "node": "Push · Telegram", "type": "main", "index": 0 },
{ "node": "Push · Discord", "type": "main", "index": 0 }
]] }
},
"settings": { "timezone": "America/New_York" },
"notes": "Required env vars: VYNDR_API_BASE, VYNDR_PIPELINE_SECRET, TELEGRAM_BOT_TOKEN, TELEGRAM_CHANNEL_ID, DISCORD_WEBHOOK_DAILY. Verify n8n HTTP node version before importing — schemas drift across releases."
}