{
  "updatedAt": "2026-05-18T17:37:47.374Z",
  "createdAt": "2026-05-10T02:20:42.354Z",
  "id": "IL9hNpWdzJfGar9V",
  "name": "Paperless Inbox Reminder",
  "description": null,
  "active": true,
  "isArchived": false,
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "weeksInterval": 1,
              "triggerAtDay": [
                1
              ],
              "triggerAtHour": 9,
              "triggerAtMinute": 0
            }
          ]
        }
      },
      "id": "2a6f25ee-9a71-4024-9bda-881c0f9c65e2",
      "name": "Every Monday 9 AM",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "method": "GET",
        "url": "https://paperless.paccoco.com/api/documents/",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "={{'Token ' + $env.PAPERLESS_API_TOKEN}}"
            }
          ]
        },
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "is_tagged",
              "value": "0"
            },
            {
              "name": "page_size",
              "value": "25"
            },
            {
              "name": "ordering",
              "value": "created"
            },
            {
              "name": "fields",
              "value": "id,title,created,document_type,tags"
            }
          ]
        },
        "options": {}
      },
      "id": "542f642c-8714-4d70-b09a-142819cd4f90",
      "name": "Fetch Inbox Docs",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        224,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "const data = $input.first().json;\nconst docs = data.results || [];\nconst total = data.count || 0;\n\n// Oldest 5 for the reminder body\nconst oldest = docs.slice(0, 5).map(d => {\n  const date = d.created ? d.created.substring(0, 10) : 'unknown date';\n  return `  • ${d.title || 'Untitled'} (added ${date})`;\n});\n\nreturn [{\n  json: {\n    total,\n    hasItems: total > 0,\n    oldestList: oldest.join('\\n'),\n    remaining: Math.max(0, total - 5)\n  }\n}];"
      },
      "id": "97e50c04-0e2a-42cd-ad14-6adc48fd6c19",
      "name": "Parse Response",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        448,
        0
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "efdd4f81-1976-4d26-a565-d110bfeba1df",
              "leftValue": "={{ $json.hasItems }}",
              "rightValue": true,
              "operator": {
                "type": "boolean",
                "operation": "equal"
              }
            }
          ],
          "combinator": "and"
        }
      },
      "id": "2d7aee2a-bd53-44fe-8663-041a04d1ac28",
      "name": "Has Inbox Items?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        672,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "const d = $input.first().json;\nconst extra = d.remaining > 0 ? `\\n  … and ${d.remaining} more` : '';\nconst body = `${d.total} untagged document${d.total !== 1 ? 's' : ''} in Paperless inbox:\\n${d.oldestList}${extra}\\n\\nhttps://paperless.paccoco.com`;\nreturn [{ json: { title: '📥 Paperless Inbox Needs Attention', message: body, priority: 5 } }];"
      },
      "id": "ca64d429-5340-4bff-aaf1-80ed56f31a18",
      "name": "Format Reminder",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        896,
        -120
      ]
    },
    {
      "parameters": {
        "jsCode": "return [{ json: { title: '✅ Paperless Inbox Clear', message: 'No untagged documents — inbox is clean.', priority: 1 } }];"
      },
      "id": "ce983e8c-5e6b-4265-a3ce-54601d5613cf",
      "name": "Format Clear",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        896,
        120
      ]
    },
    {
      "parameters": {
        "message": "={{ $json.message }}",
        "additionalFields": {
          "priority": "={{ $json.priority }}",
          "title": "={{ $json.title }}"
        },
        "options": {
          "contentType": "text/plain"
        }
      },
      "id": "5ad3b20b-1a87-47c6-9b1f-3b6bbee0f942",
      "name": "Push to Gotify (Reminder)",
      "type": "n8n-nodes-base.gotify",
      "typeVersion": 1,
      "position": [
        1120,
        -120
      ],
      "credentials": {
        "gotifyApi": {
          "id": "tf7TwAsI8E3d0X0L",
          "name": "Reminders"
        }
      }
    },
    {
      "parameters": {
        "message": "={{ $json.message }}",
        "additionalFields": {
          "priority": "={{ $json.priority }}",
          "title": "={{ $json.title }}"
        },
        "options": {
          "contentType": "text/plain"
        }
      },
      "id": "1c6ed90d-6350-4259-b9dd-63f978185b4f",
      "name": "Push to Gotify (Clear)",
      "type": "n8n-nodes-base.gotify",
      "typeVersion": 1,
      "position": [
        1120,
        120
      ],
      "credentials": {
        "gotifyApi": {
          "id": "tf7TwAsI8E3d0X0L",
          "name": "Reminders"
        }
      }
    }
  ],
  "connections": {
    "Every Monday 9 AM": {
      "main": [
        [
          {
            "node": "Fetch Inbox Docs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Inbox Docs": {
      "main": [
        [
          {
            "node": "Parse Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Response": {
      "main": [
        [
          {
            "node": "Has Inbox Items?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has Inbox Items?": {
      "main": [
        [
          {
            "node": "Format Reminder",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Format Clear",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Reminder": {
      "main": [
        [
          {
            "node": "Push to Gotify (Reminder)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Clear": {
      "main": [
        [
          {
            "node": "Push to Gotify (Clear)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate"
  },
  "staticData": {
    "node:Every Monday 9 AM": {
      "recurrenceRules": []
    }
  },
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "pinData": {},
  "versionId": "b2988080-f935-41d6-9dd9-630d9a3ac8cf",
  "activeVersionId": "b2988080-f935-41d6-9dd9-630d9a3ac8cf",
  "versionCounter": 28,
  "triggerCount": 1,
  "shared": [
    {
      "updatedAt": "2026-05-10T02:20:42.354Z",
      "createdAt": "2026-05-10T02:20:42.354Z",
      "role": "workflow:owner",
      "workflowId": "IL9hNpWdzJfGar9V",
      "projectId": "dxCRnBdX5uJizCGa",
      "project": {
        "updatedAt": "2026-05-06T01:10:37.484Z",
        "createdAt": "2026-05-06T01:08:07.721Z",
        "id": "dxCRnBdX5uJizCGa",
        "name": "Wilfred Fizzlepoof <admin@paccoco.com>",
        "type": "personal",
        "icon": null,
        "description": null,
        "creatorId": "47b2227f-2fc2-4a08-bd35-ea157b92df0d"
      }
    }
  ],
  "tags": [
    {
      "updatedAt": "2026-05-09T18:01:37.325Z",
      "createdAt": "2026-05-09T18:01:37.325Z",
      "id": "GkSPhkZk6jOi8ERF",
      "name": "reminders"
    },
    {
      "updatedAt": "2026-05-06T22:39:46.476Z",
      "createdAt": "2026-05-06T22:39:46.476Z",
      "id": "NxHjuO4MMd5kdPR7",
      "name": "paperless"
    },
    {
      "updatedAt": "2026-05-09T18:01:37.295Z",
      "createdAt": "2026-05-09T18:01:37.295Z",
      "id": "PYzt74cSdu6cC6P1",
      "name": "scheduled"
    }
  ],
  "activeVersion": {
    "updatedAt": "2026-05-18T17:37:47.375Z",
    "createdAt": "2026-05-18T17:37:47.375Z",
    "versionId": "b2988080-f935-41d6-9dd9-630d9a3ac8cf",
    "workflowId": "IL9hNpWdzJfGar9V",
    "nodes": [
      {
        "parameters": {
          "rule": {
            "interval": [
              {
                "field": "weeks",
                "weeksInterval": 1,
                "triggerAtDay": [
                  1
                ],
                "triggerAtHour": 9,
                "triggerAtMinute": 0
              }
            ]
          }
        },
        "id": "2a6f25ee-9a71-4024-9bda-881c0f9c65e2",
        "name": "Every Monday 9 AM",
        "type": "n8n-nodes-base.scheduleTrigger",
        "typeVersion": 1.2,
        "position": [
          0,
          0
        ]
      },
      {
        "parameters": {
          "method": "GET",
          "url": "https://paperless.paccoco.com/api/documents/",
          "sendHeaders": true,
          "headerParameters": {
            "parameters": [
              {
                "name": "Authorization",
                "value": "={{'Token ' + $env.PAPERLESS_API_TOKEN}}"
              }
            ]
          },
          "sendQuery": true,
          "queryParameters": {
            "parameters": [
              {
                "name": "is_tagged",
                "value": "0"
              },
              {
                "name": "page_size",
                "value": "25"
              },
              {
                "name": "ordering",
                "value": "created"
              },
              {
                "name": "fields",
                "value": "id,title,created,document_type,tags"
              }
            ]
          },
          "options": {}
        },
        "id": "542f642c-8714-4d70-b09a-142819cd4f90",
        "name": "Fetch Inbox Docs",
        "type": "n8n-nodes-base.httpRequest",
        "typeVersion": 4.2,
        "position": [
          224,
          0
        ]
      },
      {
        "parameters": {
          "jsCode": "const data = $input.first().json;\nconst docs = data.results || [];\nconst total = data.count || 0;\n\n// Oldest 5 for the reminder body\nconst oldest = docs.slice(0, 5).map(d => {\n  const date = d.created ? d.created.substring(0, 10) : 'unknown date';\n  return `  • ${d.title || 'Untitled'} (added ${date})`;\n});\n\nreturn [{\n  json: {\n    total,\n    hasItems: total > 0,\n    oldestList: oldest.join('\\n'),\n    remaining: Math.max(0, total - 5)\n  }\n}];"
        },
        "id": "97e50c04-0e2a-42cd-ad14-6adc48fd6c19",
        "name": "Parse Response",
        "type": "n8n-nodes-base.code",
        "typeVersion": 2,
        "position": [
          448,
          0
        ]
      },
      {
        "parameters": {
          "conditions": {
            "options": {
              "caseSensitive": true,
              "leftValue": "",
              "typeValidation": "strict"
            },
            "conditions": [
              {
                "id": "efdd4f81-1976-4d26-a565-d110bfeba1df",
                "leftValue": "={{ $json.hasItems }}",
                "rightValue": true,
                "operator": {
                  "type": "boolean",
                  "operation": "equal"
                }
              }
            ],
            "combinator": "and"
          }
        },
        "id": "2d7aee2a-bd53-44fe-8663-041a04d1ac28",
        "name": "Has Inbox Items?",
        "type": "n8n-nodes-base.if",
        "typeVersion": 2.2,
        "position": [
          672,
          0
        ]
      },
      {
        "parameters": {
          "jsCode": "const d = $input.first().json;\nconst extra = d.remaining > 0 ? `\\n  … and ${d.remaining} more` : '';\nconst body = `${d.total} untagged document${d.total !== 1 ? 's' : ''} in Paperless inbox:\\n${d.oldestList}${extra}\\n\\nhttps://paperless.paccoco.com`;\nreturn [{ json: { title: '📥 Paperless Inbox Needs Attention', message: body, priority: 5 } }];"
        },
        "id": "ca64d429-5340-4bff-aaf1-80ed56f31a18",
        "name": "Format Reminder",
        "type": "n8n-nodes-base.code",
        "typeVersion": 2,
        "position": [
          896,
          -120
        ]
      },
      {
        "parameters": {
          "jsCode": "return [{ json: { title: '✅ Paperless Inbox Clear', message: 'No untagged documents — inbox is clean.', priority: 1 } }];"
        },
        "id": "ce983e8c-5e6b-4265-a3ce-54601d5613cf",
        "name": "Format Clear",
        "type": "n8n-nodes-base.code",
        "typeVersion": 2,
        "position": [
          896,
          120
        ]
      },
      {
        "parameters": {
          "message": "={{ $json.message }}",
          "additionalFields": {
            "priority": "={{ $json.priority }}",
            "title": "={{ $json.title }}"
          },
          "options": {
            "contentType": "text/plain"
          }
        },
        "id": "5ad3b20b-1a87-47c6-9b1f-3b6bbee0f942",
        "name": "Push to Gotify (Reminder)",
        "type": "n8n-nodes-base.gotify",
        "typeVersion": 1,
        "position": [
          1120,
          -120
        ],
        "credentials": {
          "gotifyApi": {
            "id": "tf7TwAsI8E3d0X0L",
            "name": "Reminders"
          }
        }
      },
      {
        "parameters": {
          "message": "={{ $json.message }}",
          "additionalFields": {
            "priority": "={{ $json.priority }}",
            "title": "={{ $json.title }}"
          },
          "options": {
            "contentType": "text/plain"
          }
        },
        "id": "1c6ed90d-6350-4259-b9dd-63f978185b4f",
        "name": "Push to Gotify (Clear)",
        "type": "n8n-nodes-base.gotify",
        "typeVersion": 1,
        "position": [
          1120,
          120
        ],
        "credentials": {
          "gotifyApi": {
            "id": "tf7TwAsI8E3d0X0L",
            "name": "Reminders"
          }
        }
      }
    ],
    "connections": {
      "Every Monday 9 AM": {
        "main": [
          [
            {
              "node": "Fetch Inbox Docs",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Fetch Inbox Docs": {
        "main": [
          [
            {
              "node": "Parse Response",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Parse Response": {
        "main": [
          [
            {
              "node": "Has Inbox Items?",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Has Inbox Items?": {
        "main": [
          [
            {
              "node": "Format Reminder",
              "type": "main",
              "index": 0
            }
          ],
          [
            {
              "node": "Format Clear",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Format Reminder": {
        "main": [
          [
            {
              "node": "Push to Gotify (Reminder)",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Format Clear": {
        "main": [
          [
            {
              "node": "Push to Gotify (Clear)",
              "type": "main",
              "index": 0
            }
          ]
        ]
      }
    },
    "authors": "Wilfred Fizzlepoof",
    "name": null,
    "description": null,
    "autosaved": false,
    "workflowPublishHistory": [
      {
        "createdAt": "2026-05-18T17:37:47.410Z",
        "id": 315,
        "workflowId": "IL9hNpWdzJfGar9V",
        "versionId": "b2988080-f935-41d6-9dd9-630d9a3ac8cf",
        "event": "deactivated",
        "userId": "47b2227f-2fc2-4a08-bd35-ea157b92df0d"
      },
      {
        "createdAt": "2026-05-18T17:37:47.438Z",
        "id": 316,
        "workflowId": "IL9hNpWdzJfGar9V",
        "versionId": "b2988080-f935-41d6-9dd9-630d9a3ac8cf",
        "event": "activated",
        "userId": "47b2227f-2fc2-4a08-bd35-ea157b92df0d"
      }
    ]
  }
}
