{
  "name": "Email Outreach with n8n: AI, NocoDB and SMTP (free JSON)",
  "nodes": [
    {
      "id": "d5cc818c-806e-4b8a-86a3-6eb090fbf10b",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 10,
              "triggerAtMinute": 30
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "cc7c393b-1edb-496f-9739-71ba7dcfe692",
      "name": "Get many rows",
      "type": "n8n-nodes-base.nocoDb",
      "position": [
        176,
        0
      ],
      "parameters": {
        "table": "YOUR_NOCODB_TABLE_ID",
        "options": {},
        "operation": "getAll",
        "projectId": "YOUR_NOCODB_PROJECT_ID",
        "returnAll": true,
        "authentication": "nocoDbApiToken"
      },
      "typeVersion": 3
    },
    {
      "id": "2b19fa40-85c2-4d12-810c-04bcffabb877",
      "name": "Filter",
      "type": "n8n-nodes-base.filter",
      "position": [
        352,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "0fac1715-b303-4697-a3cf-1cb8c47ab439",
              "operator": {
                "type": "dateTime",
                "operation": "notExists",
                "singleValue": true
              },
              "leftValue": "={{ $json['Initial Contact Date'] }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "46c0f6e6-64c8-4f46-b322-16d20e711aa5",
      "name": "Limit",
      "type": "n8n-nodes-base.limit",
      "position": [
        560,
        0
      ],
      "parameters": {
        "maxItems": 15
      },
      "typeVersion": 1
    },
    {
      "id": "5f2d6070-ac2a-4e75-a12d-0dae1cda1abb",
      "name": "Basic LLM Chain",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        752,
        0
      ],
      "parameters": {
        "text": "=You are an email personalization assistant. Your job is to modify an email template by replacing ONLY two specific elements:\n\n1. Replace the recipient's name\n2. Replace the company name\n\nCRITICAL INSTRUCTIONS:\n- Change ONLY the name and company name\n- Keep ALL other content exactly the same\n- Maintain the exact formatting, spacing, and structure\n- Do not modify subject lines, signatures, or any other text\n- Do not add extra content or make style changes\n\nINPUT FORMAT:\nYou will receive:\n- Original Email: \n---START OF TEMPLATE---\nHey ((Name)),\n\nPASTE YOUR EMAIL TEMPLATE HERE. Write ((Name)) where the first name goes and ((Company)) where the company name goes.\n---END OF TEMPLATE---\n\n- New Name: {{ $json.first_name }}\n- New Company: {{ $json.organization_name }}\n\nREPLACEMENT RULES:\n- Look for the placeholder ((Name)), in any capitalization, or obvious name placeholders\n- Look for the placeholder ((Company)), in any capitalization, or obvious company placeholders\n- If no placeholders exist, intelligently identify where names/companies should go\n- Use the exact capitalization provided in the input\n\nOUTPUT FORMAT:\nReturn only the modified email with no additional commentary, explanations, or metadata.\n\nEXAMPLE:\nInput:\nOriginal Email: \"Hi ((name)), Welcome to ((company))! We're excited to work with you.\"\nNew Name: \"Sarah Johnson\"\nNew Company: \"TechCorp Solutions\"\n\nOutput:\nHi Sarah Johnson, Welcome to TechCorp Solutions! We're excited to work with you.",
        "batching": {},
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "7cac1b8d-5521-42ac-b33d-3dbc148b6e6d",
      "name": "Groq Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
      "position": [
        752,
        208
      ],
      "parameters": {
        "model": "openai/gpt-oss-120b",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "11d4208c-d028-4502-89a7-516e3afa3c6e",
      "name": "Send email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1104,
        0
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "YOUR_SUBJECT_LINE",
        "toEmail": "={{ $('Limit').item.json.email }}",
        "emailFormat": "text",
        "fromEmail": "YOUR_SENDER_EMAIL"
      },
      "typeVersion": 2.1
    },
    {
      "id": "917b005c-8f57-4692-bb07-08d1f7bcdd82",
      "name": "Update a row",
      "type": "n8n-nodes-base.nocoDb",
      "position": [
        1520,
        0
      ],
      "parameters": {
        "table": "YOUR_NOCODB_TABLE_ID",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldName": "Id",
              "fieldValue": "={{ $('Get many rows').item.json.Id }}"
            },
            {
              "fieldName": "=Initial Contact Date",
              "fieldValue": "={{ $json.currentDate.toDateTime().format('M/dd/yy') }}"
            },
            {
              "fieldName": "Next Follow up/Contact",
              "fieldValue": "={{ $json.currentDate.toDateTime().plus(3, 'Days').format('M/dd/yy') }}"
            }
          ]
        },
        "operation": "update",
        "projectId": "YOUR_NOCODB_PROJECT_ID",
        "authentication": "nocoDbApiToken"
      },
      "typeVersion": 3
    },
    {
      "id": "024256ad-46f8-4eab-82fa-e27aa8f58cd3",
      "name": "Date & Time",
      "type": "n8n-nodes-base.dateTime",
      "position": [
        1312,
        0
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 2
    },
    {
      "id": "7b67d2c4-327d-4f7d-ae58-5bf3f04eb2b3",
      "name": "Before you turn it on",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        -640
      ],
      "typeVersion": 1,
      "parameters": {
        "color": 4,
        "width": 640,
        "height": 520,
        "content": "## Before you turn it on\n\nThis file contains placeholders. Replace each one:\n\n- `YOUR_NOCODB_PROJECT_ID` and `YOUR_NOCODB_TABLE_ID`, in both NocoDB nodes\n- `YOUR_SENDER_EMAIL` and `YOUR_SUBJECT_LINE`, in Send email\n- the sample text between START OF TEMPLATE and END OF TEMPLATE in Basic LLM Chain\n\nThen add your own credentials: NocoDB API token, Groq API key, SMTP account.\n\nFirst run: put only your own email address in the table, run the workflow by hand, and read the email before anything else.\n\nThe file has been checked for structure only. It has not been run against live accounts."
      }
    },
    {
      "id": "28ecbb9a-a783-442c-b8f1-4b875390649e",
      "name": "Table columns",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        620,
        -640
      ],
      "typeVersion": 1,
      "parameters": {
        "color": 5,
        "width": 520,
        "height": 520,
        "content": "## Table columns\n\nThe names must match exactly, including capitals and spaces:\n\n- `Id` (the table's own row id)\n- `first_name`\n- `email`\n- `organization_name`\n- `Initial Contact Date`\n- `Next Follow up/Contact`\n\nA lead is picked up only when `Initial Contact Date` has no value. After a send, the workflow writes the date in the form month/day/year, for example 11/14/26. Check that your column accepts that format."
      }
    },
    {
      "id": "ae1a5399-e4f7-4813-8612-3307a99f48e2",
      "name": "What it does not do",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1180,
        -640
      ],
      "typeVersion": 1,
      "parameters": {
        "color": 6,
        "width": 560,
        "height": 520,
        "content": "## What it does not do\n\n- It does not send follow-ups. It only writes a follow-up date.\n- It has no unsubscribe link and does not read replies or bounces.\n- All emails of a run are sent first and the table is updated afterwards. If one send fails, the run stops before any update, and the leads already emailed can be emailed again next time.\n- The limit of 15 is a setting in the Limit node, not a safe level.\n- Check the rules that apply to cold email where you and your leads are."
      }
    }
  ],
  "connections": {
    "Limit": {
      "main": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter": {
      "main": [
        [
          {
            "node": "Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send email": {
      "main": [
        [
          {
            "node": "Date & Time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Date & Time": {
      "main": [
        [
          {
            "node": "Update a row",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get many rows": {
      "main": [
        [
          {
            "node": "Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Basic LLM Chain": {
      "main": [
        [
          {
            "node": "Send email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Groq Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get many rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}