{
  "name": "Generate Weekly Workflow Analytics Reports with n8n API & Email Delivery",
  "nodes": [
    {
      "id": "9c2f922e-2f23-417f-9e26-f2f91d719728",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        912,
        16
      ]
    },
    {
      "id": "ea56ce13-5b66-439c-8241-3c8eecb06eb8",
      "name": "Get all previous executions",
      "type": "n8n-nodes-base.n8n",
      "position": [
        1824,
        112
      ]
    },
    {
      "id": "22cefb90-bce7-402d-a996-6489bda7c136",
      "name": "Get all Workflows",
      "type": "n8n-nodes-base.n8n",
      "position": [
        1424,
        -160
      ]
    },
    {
      "id": "b6395b45-7c15-4ab4-9dc4-905ddf04d54b",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        2496,
        0
      ]
    },
    {
      "id": "8e131881-f7ab-46cf-9ebc-f006a819d66d",
      "name": "Edit Field ID to workflowId",
      "type": "n8n-nodes-base.set",
      "position": [
        2160,
        -160
      ]
    },
    {
      "id": "12a17b24-b3c7-4d40-8a03-3b84c932521b",
      "name": "Filter executions last week",
      "type": "n8n-nodes-base.filter",
      "position": [
        2896,
        0
      ]
    },
    {
      "id": "2e18c677-62ae-4228-9aeb-ba665f8d05c8",
      "name": "Prepare html report",
      "type": "n8n-nodes-base.code",
      "position": [
        3376,
        0
      ]
    },
    {
      "id": "4b1154e2-76bc-4b8c-a2b6-f4338a3c3f10",
      "name": "Send a message gmail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        3792,
        -176
      ]
    },
    {
      "id": "2946c6b2-f93f-4e31-bca1-14995de72e7d",
      "name": "Send a message outlook",
      "type": "n8n-nodes-base.microsoftOutlook",
      "position": [
        3792,
        96
      ]
    },
    {
      "id": "0faa8265-c32e-479f-873d-c603722afe12",
      "name": "Sticky Note - Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        224,
        -160
      ],
      "parameters": {
        "width": 600,
        "height": 1020,
        "content": "## Workflow Overview for Documenting n8n Executions\n\n### Goal:\nThis workflow automates the process of documenting all previous workflow executions within n8n. By fetching data on past executions and w"
      }
    },
    {
      "id": "595171e1-c6b0-48b8-bf86-86ffb155e118",
      "name": "Sticky Note - Send a message gmail",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3664,
        -1056
      ],
      "parameters": {
        "width": 380,
        "height": 860,
        "content": "## 📧 Send a message Gmail \n\n### Purpose\nSend an email using Gmail service with specified subject and message content.\n\n### Inputs / Outputs\n- **Inputs:** \n  - Subject: The title of the email.\n  - Mess"
      }
    },
    {
      "id": "7a12b760-b67c-47ff-995c-6ac53194a036",
      "name": "Sticky Note - Send a message outlook",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3680,
        304
      ],
      "parameters": {
        "width": 380,
        "height": 1020,
        "content": "## 📩 Send a message outlook \n\n### Purpose\nSend an email through Microsoft Outlook to specified recipients, integrating with workflows for communication purposes.\n\n### Inputs / Outputs\n- **Inputs:** \n "
      }
    },
    {
      "id": "a85a215d-c1ef-4695-b965-9d3a56cfd9b1",
      "name": "Sticky Note - Prepare html report",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3248,
        304
      ],
      "parameters": {
        "width": 380,
        "height": 1020,
        "content": "## 📁 Prepare HTML Report \n\n### Purpose\nGenerate an HTML report summarizing workflow execution statistics over the past 7 days, including counts of errors, successes, and waiting workflows.\n\n### Inputs"
      }
    },
    {
      "id": "d134b4f0-1fbc-404c-9edc-9f2884824226",
      "name": "Sticky Note - Filter executions last week",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2848,
        304
      ],
      "parameters": {
        "width": 380,
        "height": 1020,
        "content": "## Filter Executions Last Week\n\n### Purpose\nFilter out executions that were started in the last week, allowing for targeted analysis and documentation of recent workflow activities.\n\n### Inputs / Outp"
      }
    },
    {
      "id": "d6d8301c-b2f7-4e8b-b3ed-f32edd84c92b",
      "name": "Sticky Note - Merge",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2448,
        304
      ],
      "parameters": {
        "width": 380,
        "height": 1020,
        "content": "## Merge \n\n### Purpose\nCombine two data sets based on specified fields to enrich the input with additional information.\n\n### Inputs / Outputs\n- **Inputs:** \n  - Two data sets to be merged, identified "
      }
    },
    {
      "id": "95f22f9d-86fa-4cc3-aeba-38d90320ca29",
      "name": "Sticky Note - Edit Field ID to workflowId",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2064,
        304
      ],
      "parameters": {
        "width": 380,
        "height": 1020,
        "content": "## Edit Field ID to workflowId \n\n### Purpose\nThis node updates the field ID in the provided JSON data to a new key named `workflowId`, streamlining the data structure for easier identification and ref"
      }
    },
    {
      "id": "9be4bac7-d68a-47d8-87c5-99df34830f13",
      "name": "Sticky Note - Get all previous executions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1664,
        304
      ],
      "parameters": {
        "width": 380,
        "height": 1020,
        "content": "## Get All Previous Executions \n\n### Purpose\nRetrieve all previous executions of a specified resource, enabling users to track and document the history of actions performed in workflows.\n\n### Inputs /"
      }
    },
    {
      "id": "9946f889-e6c4-46e0-bd6e-b5fe41a6e991",
      "name": "Sticky Note - Get all Workflows",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1264,
        304
      ],
      "parameters": {
        "width": 380,
        "height": 1020,
        "content": "## Get all Workflows \n\n### Purpose\nFetch all workflows stored in n8n to facilitate documentation and management of automation processes.\n\n### Inputs / Outputs\n- **Inputs:** \n  - None (The node retriev"
      }
    },
    {
      "id": "27a53d26-b49c-41f9-9cde-49c81e3a5454",
      "name": "Sticky Note - Schedule Trigger",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        864,
        304
      ],
      "parameters": {
        "width": 380,
        "height": 1020,
        "content": "## 🗓️ Schedule Trigger \n\n### Purpose\nThis node initiates a scheduled trigger, allowing workflows to run at specified intervals."
      }
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Filter executions last week",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get all previous executions",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get all Workflows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get all Workflows": {
      "main": [
        [
          {
            "node": "Edit Field ID to workflowId",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare html report": {
      "main": [
        [
          {
            "node": "Send a message outlook",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send a message gmail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Field ID to workflowId": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter executions last week": {
      "main": [
        [
          {
            "node": "Prepare html report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get all previous executions": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    }
  }
}