Workflow: Production Workflow
Integrations: cron, function, functionItem, httpRequest, manualTrigger, moveBinaryData, readBinaryFile, set, stopAndError, telegram, writeBinaryFile

{"nodes": [{"name": "On clicking 'execute'", "type": "n8n-nodes-base.manualTrigger", "position": [340, 380], "parameters": {}, "typeVersion": 1, "id": "node-4e521ae3"}, {"name": "Write Binary File", "type": "n8n-nodes-base.writeBinaryFile", "position": [1680, 280], "parameters": {"fileName": "={{$node[\"Config\"].parameter[\"values\"][\"string\"][0][\"value\"]}}"}, "typeVersion": 1, "id": "node-7944b55e"}, {"name": "Read Binary File", "type": "n8n-nodes-base.readBinaryFile", "position": [580, 460], "parameters": {"filePath": "={{$node[\"Config\"].parameter[\"values\"][\"string\"][0][\"value\"]}}"}, "typeVersion": 1, "continueOnFail": true, "alwaysOutputData": true, "id": "node-14a690e0"}, {"name": "HTTP Request", "type": "n8n-nodes-base.httpRequest", "position": [1020, 460], "parameters": {"url": "{{ $env.BASE_URL }}", "options": {}, "authentication": "{{ $credentials.headerAuth }}", "queryParametersUi": {"parameter": [{"name": "schemaVersion", "value": "5"}, {"name": "filter[updated_at][gt]", "value": "={{$json[\"last_synced\"]}}"}]}, "headerParametersUi": {"parameter": []}}, "credentials": {"httpHeaderAuth": {"id": "{{ $credentials.httpHeaderAuth.id }}", "name": "Header Auth account"}}, "typeVersion": 1, "id": "node-d51a839f"}, {"name": "Telegram", "type": "n8n-nodes-base.telegram", "position": [1480, 460], "parameters": {"text": "={{$json[\"title\"]}} by {{$json[\"author\"]}}\n\n{{$json[\"summary\"]}}\n\n{{$json[\"url\"]}}", "chatId": "={{$node[\"Config\"].parameter[\"values\"][\"number\"][0][\"value\"]}}", "additionalFields": {}}, "credentials": {"telegramApi": {"id": "{{ $credentials.telegramApi.id }}", "name": "my bot"}}, "typeVersion": 1, "id": "node-8c78f659"}, {"name": "Binary to json", "type": "n8n-nodes-base.moveBinaryData", "position": [800, 460], "parameters": {"options": {}}, "typeVersion": 1, "alwaysOutputData": true, "id": "node-7c9ba4b9"}, {"name": "Json to binary", "type": "n8n-nodes-base.moveBinaryData", "position": [1480, 280], "parameters": {"mode": "jsonToBinary", "options": {}}, "typeVersion": 1, "id": "node-31f98dd2"}, {"name": "Set new update time", "type": "n8n-nodes-base.functionItem", "position": [1280, 280], "parameters": {"functionCode": "return {\n  last_synced: new Date().getTime()\n};"}, "typeVersion": 1, "id": "node-4f083ca0"}, {"name": "Split into baches", "type": "n8n-nodes-base.function", "position": [1280, 460], "parameters": {"functionCode": "const newValue = Object.values(items[0].json.documents).filter(it => it.category === 'article').filter(it => it.children.length === 0).map(it => ({\n  json: {\n      url: it.url,\n  title: it.title,\n  author: it.author,\n  summary: it.summary,\n  saved_at: new Date(it.saved_at),\n  }\n}))\n\n\nreturn newValue;"}, "typeVersion": 1, "id": "node-16ff9b9e"}, {"name": "Cron", "type": "n8n-nodes-base.cron", "position": [340, 540], "parameters": {"triggerTimes": {"item": [{"mode": "everyX", "unit": "minutes", "value": 10}]}}, "typeVersion": 1, "id": "node-73f40462"}, {"name": "Config", "type": "n8n-nodes-base.set", "position": [800, 300], "parameters": {"values": {"number": [{"name": "Telegram chat it", "value": 19999}], "string": [{"name": "file path", "value": "/whatever/readwiseLastSynced.json"}]}, "options": {}}, "typeVersion": 1, "id": "node-76f1f324"}, {"id": "error-8ab207d4", "name": "Error Handler", "type": "n8n-nodes-base.stopAndError", "typeVersion": 1, "position": [1000, 400], "parameters": {"message": "Workflow execution error", "options": {}}}], "connections": {}, "name": "Production Workflow", "settings": {"executionOrder": "v1", "saveManualExecutions": true, "callerPolicy": "workflowsFromSameOwner", "errorWorkflow": null, "timezone": "UTC", "executionTimeout": 3600, "maxExecutions": 1000, "retryOnFail": true, "retryCount": 3}, "meta": {"instanceId": "workflow-0a843e92", "versionId": "1.0.0", "createdAt": "2025-09-29T07:07:56.011990", "updatedAt": "2025-09-29T07:07:56.012001", "owner": "n8n-user", "license": "MIT", "category": "automation", "status": "active", "priority": "high", "environment": "production"}, "tags": ["automation", "n8n", "production-ready", "excellent", "optimized"], "description": "Production-ready workflow: Production Workflow. This workflow has been optimized for production use with comprehensive error handling, security, and documentation."}