{
  "workflow": {
    "id": 4285,
    "name": "Automatically delete spam emails in Gmail on schedule",
    "views": 5207,
    "recentViews": 0,
    "totalViews": 5207,
    "createdAt": "2025-05-21T14:19:52.816Z",
    "description": "## Who is this for?\nIf you hate SPAM emails or don't want to clean them up frequently.\n\n## What problem is this workflow solving?\nIt automatically deletes SPAM emails for you, so you don't have to. Save a bit of your time.\n\n## What this workflow does\n- You can specify when to execute the workflow: daily, weekly, or monthly.\n\n## Setup\n- Select the preferred execution time\n- Configure credentials for Gmail OAuth2\n\n## How to customize this workflow to your needs\n- There's no need. It just works!",
    "workflow": {
      "id": "DzNTc1Td148ti7RU",
      "meta": {
        "instanceId": "e76981884963d13b9deb7bc5a6b15daf6838937e1dd529f22f2c146d8b79cae4",
        "templateCredsSetupCompleted": true
      },
      "name": "Automatically delete SPAM emails",
      "tags": [
        {
          "id": "yjDYtffFaPyJlYcC",
          "name": "template",
          "createdAt": "2025-05-21T14:11:32.813Z",
          "updatedAt": "2025-05-21T14:11:32.813Z"
        }
      ],
      "nodes": [
        {
          "id": "a4fa3e50-5b63-4e69-97eb-534b1170ebab",
          "name": "Trigger at Sunday midnight",
          "type": "n8n-nodes-base.scheduleTrigger",
          "position": [
            -260,
            -20
          ],
          "parameters": {
            "rule": {
              "interval": [
                {
                  "field": "weeks"
                }
              ]
            }
          },
          "typeVersion": 1.2
        },
        {
          "id": "286e5c34-18ab-46da-b184-cfabf796b21d",
          "name": "Delete SPAM emails",
          "type": "n8n-nodes-base.gmail",
          "position": [
            160,
            -20
          ],
          "webhookId": "46b0fe0f-cc00-4994-8364-9048c888e9ef",
          "parameters": {
            "messageId": "={{ $json.id }}",
            "operation": "delete"
          },
          "credentials": {
            "gmailOAuth2": {
              "id": "credential-id",
              "name": "gmailOAuth2 Credential"
            }
          },
          "typeVersion": 2.1
        },
        {
          "id": "b755451e-7fc3-4c3b-b669-69d700c38fa4",
          "name": "Get all SPAM emails",
          "type": "n8n-nodes-base.gmail",
          "position": [
            -60,
            -20
          ],
          "webhookId": "c47419de-278c-40d1-a5da-c9414d3f89c6",
          "parameters": {
            "filters": {
              "labelIds": [
                "SPAM"
              ]
            },
            "operation": "getAll",
            "returnAll": true
          },
          "credentials": {
            "gmailOAuth2": {
              "id": "credential-id",
              "name": "gmailOAuth2 Credential"
            }
          },
          "typeVersion": 2.1
        },
        {
          "id": "cc3c9d36-a26e-47cb-bb74-3a1027b996cd",
          "name": "Sticky Note",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            -580,
            -260
          ],
          "parameters": {
            "color": 7,
            "width": 340,
            "height": 200,
            "content": "## Automatically delete your SPAM emails on frequent basis\n\nThis automation will run repeatedly at a particular time to delete all your SPAM emails\n\n"
          },
          "typeVersion": 1
        },
        {
          "id": "86749abf-16c8-4406-9394-b22a384b4e89",
          "name": "Sticky Note1",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            -280,
            140
          ],
          "parameters": {
            "color": 7,
            "width": 150,
            "height": 200,
            "content": "## :point_up: UPDATE ME\nSelect when to trigger the workflow"
          },
          "typeVersion": 1
        }
      ],
      "active": false,
      "pinData": {},
      "settings": {
        "executionOrder": "v1"
      },
      "versionId": "f47d2f29-89d0-4719-a47b-55b43e84466b",
      "connections": {
        "Get all SPAM emails": {
          "main": [
            [
              {
                "node": "Delete SPAM emails",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Trigger at Sunday midnight": {
          "main": [
            [
              {
                "node": "Get all SPAM emails",
                "type": "main",
                "index": 0
              }
            ]
          ]
        }
      }
    },
    "lastUpdatedBy": 29,
    "workflowInfo": {
      "nodeCount": 5,
      "nodeTypes": {
        "n8n-nodes-base.gmail": {
          "count": 2
        },
        "n8n-nodes-base.stickyNote": {
          "count": 2
        },
        "n8n-nodes-base.scheduleTrigger": {
          "count": 1
        }
      }
    },
    "status": "published",
    "readyToDemo": null,
    "user": {
      "name": "Bao Duy Nguyen",
      "username": "duynb",
      "bio": "",
      "verified": true,
      "links": [
        "https://myup.work/duynb"
      ],
      "avatar": "https://gravatar.com/avatar/3b4bffd9eac6a8589579d27460d3fa05efe10c0771e42f94495ff91797633394?r=pg&d=retro&size=200"
    },
    "nodes": [
      {
        "id": 356,
        "icon": "file:gmail.svg",
        "name": "n8n-nodes-base.gmail",
        "codex": {
          "data": {
            "alias": [
              "email",
              "human",
              "form",
              "wait",
              "hitl",
              "approval"
            ],
            "resources": {
              "generic": [
                {
                  "url": "https://n8n.io/blog/why-business-process-automation-with-n8n-can-change-your-daily-life/",
                  "icon": "🧬",
                  "label": "Why business process automation with n8n can change your daily life"
                },
                {
                  "url": "https://n8n.io/blog/supercharging-your-conference-registration-process-with-n8n/",
                  "icon": "🎫",
                  "label": "Supercharging your conference registration process with n8n"
                },
                {
                  "url": "https://n8n.io/blog/no-code-ecommerce-workflow-automations/",
                  "icon": "store",
                  "label": "6 e-commerce workflows to power up your Shopify s"
                },
                {
                  "url": "https://n8n.io/blog/how-to-get-started-with-crm-automation-and-no-code-workflow-ideas/",
                  "icon": "👥",
                  "label": "How to get started with CRM automation (with 3 no-code workflow ideas"
                },
                {
                  "url": "https://n8n.io/blog/automate-google-apps-for-productivity/",
                  "icon": "💡",
                  "label": "15 Google apps you can combine and automate to increase productivity"
                },
                {
                  "url": "https://n8n.io/blog/your-business-doesnt-need-you-to-operate/",
                  "icon": " 🖥️",
                  "label": "Hey founders! Your business doesn't need you to operate"
                },
                {
                  "url": "https://n8n.io/blog/using-automation-to-boost-productivity-in-the-workplace/",
                  "icon": "💪",
                  "label": "Using Automation to Boost Productivity in the Workplace"
                }
              ],
              "primaryDocumentation": [
                {
                  "url": "https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.gmail/"
                }
              ],
              "credentialDocumentation": [
                {
                  "url": "https://docs.n8n.io/integrations/builtin/credentials/google/oauth-single-service/"
                }
              ]
            },
            "categories": [
              "Communication",
              "HITL"
            ],
            "nodeVersion": "1.0",
            "codexVersion": "1.0",
            "subcategories": {
              "HITL": [
                "Human in the Loop"
              ]
            }
          }
        },
        "group": "[\"transform\"]",
        "defaults": {
          "name": "Gmail"
        },
        "iconData": {
          "type": "file",
          "fileBuffer": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTYiIGhlaWdodD0iMTkzIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCI+PHBhdGggZmlsbD0iIzQyODVGNCIgZD0iTTU4LjE4MiAxOTIuMDVWOTMuMTRMMjcuNTA3IDY1LjA3NyAwIDQ5LjUwNHYxMjUuMDkxYzAgOS42NTggNy44MjUgMTcuNDU1IDE3LjQ1NSAxNy40NTV6Ii8+PHBhdGggZmlsbD0iIzM0QTg1MyIgZD0iTTE5Ny44MTggMTkyLjA1aDQwLjcyN2M5LjY1OSAwIDE3LjQ1NS03LjgyNiAxNy40NTUtMTcuNDU1VjQ5LjUwNWwtMzEuMTU2IDE3LjgzNy0yNy4wMjYgMjUuNzk4eiIvPjxwYXRoIGZpbGw9IiNFQTQzMzUiIGQ9Im01OC4xODIgOTMuMTQtNC4xNzQtMzguNjQ3IDQuMTc0LTM2Ljk4OUwxMjggNjkuODY4bDY5LjgxOC01Mi4zNjQgNC42NyAzNC45OTItNC42NyA0MC42NDRMMTI4IDE0NS41MDR6Ii8+PHBhdGggZmlsbD0iI0ZCQkMwNCIgZD0iTTE5Ny44MTggMTcuNTA0VjkzLjE0TDI1NiA0OS41MDRWMjYuMjMxYzAtMjEuNTg1LTI0LjY0LTMzLjg5LTQxLjg5LTIwLjk0NXoiLz48cGF0aCBmaWxsPSIjQzUyMjFGIiBkPSJtMCA0OS41MDQgMjYuNzU5IDIwLjA3TDU4LjE4MiA5My4xNFYxNy41MDRMNDEuODkgNS4yODZDMjQuNjEtNy42NiAwIDQuNjQ2IDAgMjYuMjN6Ii8+PC9zdmc+"
        },
        "displayName": "Gmail",
        "typeVersion": 2,
        "nodeCategories": [
          {
            "id": 6,
            "name": "Communication"
          },
          {
            "id": 28,
            "name": "HITL"
          }
        ]
      },
      {
        "id": 565,
        "icon": "fa:sticky-note",
        "name": "n8n-nodes-base.stickyNote",
        "codex": {
          "data": {
            "alias": [
              "Comments",
              "Notes",
              "Sticky"
            ],
            "categories": [
              "Core Nodes"
            ],
            "nodeVersion": "1.0",
            "codexVersion": "1.0",
            "subcategories": {
              "Core Nodes": [
                "Helpers"
              ]
            }
          }
        },
        "group": "[\"input\"]",
        "defaults": {
          "name": "Sticky Note",
          "color": "#FFD233"
        },
        "iconData": {
          "icon": "sticky-note",
          "type": "icon"
        },
        "displayName": "Sticky Note",
        "typeVersion": 1,
        "nodeCategories": [
          {
            "id": 9,
            "name": "Core Nodes"
          }
        ]
      },
      {
        "id": 839,
        "icon": "fa:clock",
        "name": "n8n-nodes-base.scheduleTrigger",
        "codex": {
          "data": {
            "alias": [
              "Time",
              "Scheduler",
              "Polling",
              "Cron",
              "Interval"
            ],
            "resources": {
              "generic": [],
              "primaryDocumentation": [
                {
                  "url": "https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.scheduletrigger/"
                }
              ]
            },
            "categories": [
              "Core Nodes"
            ],
            "nodeVersion": "1.0",
            "codexVersion": "1.0"
          }
        },
        "group": "[\"trigger\",\"schedule\"]",
        "defaults": {
          "name": "Schedule Trigger",
          "color": "#31C49F"
        },
        "iconData": {
          "icon": "clock",
          "type": "icon"
        },
        "displayName": "Schedule Trigger",
        "typeVersion": 1,
        "nodeCategories": [
          {
            "id": 9,
            "name": "Core Nodes"
          }
        ]
      }
    ],
    "categories": [
      {
        "id": 43,
        "name": "Personal Productivity"
      }
    ],
    "image": []
  }
}