{
  "name": "Send SaaS trial follow-up emails with MongoDB and Gmail",
  "nodes": [
    {
      "id": "bf726ab7-2509-48ff-b182-2e252140c2ff",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        5504,
        4256
      ]
    },
    {
      "id": "0cabb810-baac-4860-8efa-a70020181309",
      "name": "Find documents",
      "type": "n8n-nodes-base.mongoDb",
      "position": [
        5680,
        4256
      ]
    },
    {
      "id": "c71658b0-93b7-403c-a5ae-7fb764110d9b",
      "name": "Code in JavaScript",
      "type": "n8n-nodes-base.code",
      "position": [
        5872,
        4256
      ]
    },
    {
      "id": "8b901153-fdb4-47ee-a1e2-fee784b43ee7",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        6144,
        4256
      ]
    },
    {
      "id": "92fe7d8f-ed54-4b41-b53c-3f8fcf5c01be",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        6368,
        4224
      ]
    },
    {
      "id": "1eaed7c1-fde9-48cb-827e-59b7650cefa7",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        6816,
        4224
      ]
    },
    {
      "id": "f891dc78-12dc-4788-b930-613bcdd2f177",
      "name": "Send day 3 email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        6592,
        3968
      ]
    },
    {
      "id": "7614911e-e4c1-4aac-9570-699aa04ffe3f",
      "name": "Send day 7 mail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        6592,
        4160
      ]
    },
    {
      "id": "9e0b3c3c-668e-4282-baf6-532e255354e8",
      "name": "Send day 13 mail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        6592,
        4352
      ]
    },
    {
      "id": "0914ef25-8817-416e-b694-5f99e93b464e",
      "name": "Send Last day email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        6592,
        4544
      ]
    },
    {
      "id": "f474438b-6111-41d2-bf83-48869bc9ff55",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4736,
        3712
      ],
      "parameters": {
        "width": 656,
        "height": 1008,
        "content": "# Automated SaaS Trial Expiry Nudge Sequence\n\nThis workflow automates follow-up emails for users during their SaaS trial period. It ensures timely engagement by sending personalized nudges at key inte"
      }
    },
    {
      "id": "7100a310-ea36-4793-b9dd-12ef2e358460",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6064,
        3712
      ],
      "parameters": {
        "width": 928,
        "height": 1008,
        "content": "## Step 2 : Send Stage-Based Nudge Emails\n\nLoops through filtered users and sends the appropriate email based on trial stage. "
      }
    },
    {
      "id": "026919c7-514f-4f18-80f5-1a25108e7ae4",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5424,
        3712
      ],
      "parameters": {
        "width": 608,
        "height": 1008,
        "content": "## Step 1 : Fetch & Filter Trial Users\n\nRuns daily at midnight, retrieves user and plan data, and filters users based on their trial stage (Day 3, 7, 13, or last day before expiry)."
      }
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Send day 3 email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send day 7 mail",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send day 13 mail",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Last day email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find documents": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send day 7 mail": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Find documents",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send day 13 mail": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Send day 3 email": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Last day email": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 3
          }
        ]
      ]
    }
  }
}