{
  "name": "Generate Sales Leads and Outreach Emails with n8n (free JSON)",
  "nodes": [
    {
      "id": "e69ffce4-1341-484d-8720-75b7dc1fcd93",
      "name": "When clicking \"Test workflow\"",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        240,
        240
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f6b5b0f4-0d51-4bda-90fb-59553593921a",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1264,
        240
      ],
      "parameters": {
        "options": {
          "reset": false
        }
      },
      "typeVersion": 3
    },
    {
      "id": "ec7256ed-57b8-48a5-82ad-9eb0e58c0c56",
      "name": "Lead Person Research",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1632,
        416
      ],
      "parameters": {
        "url": "https://deepsearch.jina.ai/v1/chat/completions",
        "method": "POST",
        "options": {
          "timeout": 240000
        },
        "jsonBody": "={\n  \"model\": \"jina-deepsearch-v1\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"I'm looking to find sale leads.\\nI need to find the decision maker for the business. In some small business it could be the owner, a director, a manager, etc... Maybe you could perform a Google search, investigate the business website or even the LinkedIn profiles connected to the business.\\nThe business is:\\n<business>\\nBusiness_Name: {{ $json.Company_name }}\\nWebsite: {{ $json.Company_website }}\\n</business>\\n\\nThe informations I'm looking about the sale lead person is:\\n<informations>\\nLead_Name, role, email and a quick summary of the person\\n</informations>\\nImportant: Do not hallucinate, don't make things up, if you don't find a information, just left the answer null.\"\n    }\n  ],\n  \"stream\": false,\n  \"reasoning_effort\": \"low\"\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Bearer {{ $('Jina_API_Key').item.json.jina_api }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "a50e2069-3674-4d88-ae94-b5235484f291",
      "name": "Lead Analyzer",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2112,
        368
      ],
      "parameters": {
        "text": "=# Goal: Your goal is to identify the best Lead contact to send a marketing email about our business: {{ $('Business_Info').item.json.BUSINESS_NAME }}.\n\n# Description: Use the deep_research about the Leads, analyze what I found and identify the best lead to send the marketing email.\n<deep_research>\n{{ $json.choices[0].message.content }}\n</deep_research>\n\nAlso, this is the Lead Company informations:\n<info>\ncompany_name: {{ $json.Company_name }}\naddress: {{ $json.Address }}\ncompany_email: {{ $json['Company_e-mail'] }}\n</info>\n\nThe expected_output should be in JSON with those informations:\nlead_name, lead_email, company_name, summary_of_your_though\n\nImportant: \n1. If you couldn't identify a lead in the deep_research information or if you think the lead isn't a good fit for our propose, use the company_name \"{{ $json.Company_name }}\" as lead_name.\n2. If the deep_research didn't find the lead_email, use the company_email \"{{ $json['Company_e-mail'] }}\" as lead_email.\n3. Add in your output a summary of your decision on the field summary_of_your_though.",
        "options": {
          "maxIterations": 4,
          "systemMessage": "=# Role: You are a Lead Generation Specialist.\n\n# Instructions: I'll provide you with a Business information (company_name, website and company_email) and a deep_research about the avaliable leads.\n\n# Rules:\n- Reduce hallucination. Don't make things up, just use the information you have.\n\nAdditional_Context: \n- Today is: {{ $now }}\n"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.6
    },
    {
      "id": "f6b92eda-6a74-41da-90f7-ade8ca4361ca",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        2304,
        592
      ],
      "parameters": {
        "jsonSchemaExample": "{\n\t\"company_name\": \"\",\n  \t\"lead_email\": \"\",\n  \t\"lead_name\": \"\",\n    \"summary_of_your_though\": \"\"\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "2e8f146f-efa7-4d17-ad79-10c9a5dddf57",
      "name": "Structured Output Parser3",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        2960,
        608
      ],
      "parameters": {
        "jsonSchemaExample": "{\n\t\"contact_name\": \"\",\n    \"contact_email\": \"\",\n    \"email_subject\": \"\",\n  \t\"email_wrote\": \"\",\n  \t\"your_summary\": \"\"\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "27ecf1ea-bec6-463e-a2b8-ef46d7942f36",
      "name": "Email Content Creator",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2768,
        368
      ],
      "parameters": {
        "text": "=# Goal: Create a marketing email, introducing {{ $('Business_Info').item.json.BUSINESS_NAME }} to our leads.\nThe email should be professional yet friendly, persuasive but not overly aggressive, and concise while engaging.\n\nAlso, generate a subject for the email.\n\n**Target Audience:**  \nOur main target audience are {{ $('Business_Info').item.json.LEAD_TARGET_AUDIENCE }} and the contact person:\n<lead_info>\ncompany_name: {{ $json.output.company_name }}\nlead_name: {{ $json.output.lead_name }}\nlead_email: {{ $json.output.lead_email }}\nlead_summary: {{ $json.output.summary_of_your_though }}\n</lead_info>\n\n**Our Key Benefits to Highlight:**  \n<key_benefits>\n{{ $('Business_Info').item.json.BUSINESS_KEY_BENEFITS }}\n</key_benefits>\n\n**Call to Action:**  \nEncourage the reader to check our web. Use a compelling closing statement and include the Landing Page link: {{ $('Business_Info').item.json.LANDING_PAGE_URL }}.\n\nUse the our_business_info as source of the information about our business.",
        "options": {
          "systemMessage": "=# Role: You are a email Content Creator Specialist.\n\n# Instructions:\nEnsure the email follows this structure:  \n1. **Attention-Grabbing Subject Line**  \n2. **Engaging Opening Paragraph**  \n3. **Key Benefits & Unique Selling Points**  \n4. **Strong Call-to-Action**\n5. **Closing Statement with Contact Info and option to schedule a demo**\n\n# Rules:\n- Reduce hallucination. Don't make things up, just use the information you have.\n- Create a finished email, do not add any field to be complete later like [your name], [phone], etc...\n\nAdditional_Context:\n- Today is: {{ $now }}\n- Our Business Info:\n<our_business_info>\n{{ $('Business_Info').item.json.BUSINESS_INFORMATION }}\n</our_business_info>\n"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.7
    },
    {
      "id": "f6c875f7-b5a9-4558-af50-f2ac6834b6fd",
      "name": "Evaluator",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        3232,
        368
      ],
      "parameters": {
        "text": "=# Evaluation Request\n\nPlease evaluate the following marketing email created for our company {{ $('Business_Info').item.json.BUSINESS_NAME }} targeting {{ $('Business_Info').item.json.LEAD_TARGET_AUDIENCE }}.\n\n## Original Brief:\nGoal: Create a marketing email introducing our company to a lead. The email should be professional yet friendly, persuasive but not overly aggressive, and concise while engaging. Secondary goal is to bring users to our website.\n\nTarget Audience: {{ $('Business_Info').item.json.LEAD_TARGET_AUDIENCE }}\nKey Benefits to Highlight:\n<key_benefits>\n{{ $('Business_Info').item.json.BUSINESS_KEY_BENEFITS }}\n</key_benefits>\n\nCall to Action: Encourage the reader to check website with landing page link: \"{{ $('Business_Info').item.json.LANDING_PAGE_URL }}\"\n\n## Email to Evaluate:\n<email>\n{{ $json.output.email_wrote }}\n</email>\n\n## Specific Evaluation Focus:\n1. Does the email effectively communicate capabilities that differentiate our company?\n2. Is the tone appropriate for the target audience while still being persuasive?\n3. Does the email successfully emphasize the key benefits offered?\n4. Is the call-to-action compelling enough to drive traffic?\n\nPlease provide your comprehensive evaluation and out following the framework outlined in your instructions.\n\n## Output format:\n{\n\t\"contact_name\": {{ $json.output.contact_name }},\n    \"contact_email\": {{ $json.output.contact_email }},\n    \"email_subject\": {{ $json.output.email_subject }},\n  \t\"email_wrote\": {{ $json.output.email_wrote }},\n  \t\"your_summary\": Your review about the marketing email,\n    \"overall_score\": the score you gave,\n    \"areas_for_improvement\": the areas of improvement\n}",
        "options": {
          "maxIterations": 3,
          "systemMessage": "=# Role: You are an Expert Email Marketing Evaluator\n\n# Purpose:\nYour role is to analyze marketing emails produced by our Content Creator Specialist and provide detailed, constructive feedback to improve their effectiveness, persuasiveness, and alignment with marketing goals.\n\n# Evaluation Framework:\nAssess each email across these key dimensions:\n\n1. **Subject Line Effectiveness**\n   - Attention-grabbing quality\n   - Clarity and relevance\n   - Appropriate length (4-7 words ideal)\n   - Personalization elements\n   \n2. **Content Quality**\n   - Alignment with target audience needs and pain points\n   - Clarity of value proposition\n   - Accuracy of product information\n   - Persuasiveness without being aggressive\n   - Proper highlighting of key benefits\n   \n3. **Structure & Readability**\n   - Logical flow and organization\n   - Paragraph length and scannability\n   - Use of formatting elements (bullets, bold, etc.)\n   - Professional yet conversational tone\n   \n4. **Call-to-Action Strength**\n   - Clarity and visibility\n   - Compelling motivation to act\n   - Proper placement\n   - Urgency elements (when appropriate)\n   \n5. **Technical Elements**\n   - Grammar and spelling accuracy\n   - Link functionality\n   - Contact information completeness\n   - Mobile-friendly formatting\n\n# Output Format:\nFor each evaluation, provide:\n\n1. **Overall Score**: 1-10 rating with brief justification\n2. **Summary**: Your summary about the text\n3. **Areas for Improvement**: 3-5 specific recommendations with examples\n\n# Rules:\n- Be specific and actionable in your feedback\n- Balance critique with positive reinforcement\n- Reference industry best practices when relevant\n- Consider the target audience's perspective\n- Maintain focus on the business goals stated in the brief\n- Evaluate based on content effectiveness, not personal preference"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.7
    },
    {
      "id": "42df0431-8c3c-424e-886a-9c670e5e6d71",
      "name": "Structured Output Parser1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        3424,
        608
      ],
      "parameters": {
        "jsonSchemaExample": "{\n\t\"contact_name\": \"\",\n    \"contact_email\": \"\",\n    \"email_subject\": \"\",\n  \t\"email_wrote\": \"\",\n  \t\"your_summary\": \"\",\n    \"overall_score\": 0,\n    \"areas_for_improvement\": [\"\", \"\", \"\"]\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "8e2e2e76-eebf-48dc-bc4d-be0614196c46",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        -192
      ],
      "parameters": {
        "width": 796,
        "height": 900,
        "content": "## Sales leads and outreach emails: overview\n\nFor each company in an Airtable table, this workflow asks Jina DeepSearch to research who the decision maker is, lets an AI agent pick the best contact, lets a second agent draft an outreach email, lets a third agent review the draft, and writes the result back to the same Airtable record. It does not send any email.\n\nYour Airtable table needs these fields:\n- Company_name, Company_website, Company_e-mail (input, required)\n- Address, Company_phone (input, optional)\n- processed: single select with the options no and yes. Only rows set to no are processed.\n- lead_name, lead_email, email_subject, email_text, email_summary, create_date, task_result (written by the workflow)\n\nTo set it up: fill in the Business_Info node, put your Jina key in the Jina_API_Key node, connect Airtable and OpenAI, choose your base and table in both Airtable nodes. The workflow starts when you click the test button; add a schedule if you want it to run by itself."
      },
      "typeVersion": 1
    },
    {
      "id": "05894e73-9cad-4555-85a2-0bf6a26dfb63",
      "name": "OpenAI - 4o-mini",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2768,
        608
      ],
      "parameters": {
        "options": {
          "temperature": 0.8
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f8d96c32-0b85-416b-bc4e-9a2ed0c28b6c",
      "name": "OpenAI o3-mini",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2112,
        592
      ],
      "parameters": {
        "model": "o3-mini",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "a125ca61-e51c-4d88-a1be-867d6b0ce30d",
      "name": "OpenAI - 4o-mini - low",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        3232,
        608
      ],
      "parameters": {
        "options": {
          "temperature": 0.3
        }
      },
      "typeVersion": 1
    },
    {
      "id": "7e3153a8-9926-4896-82ca-0d5981107db7",
      "name": "Merge-Search",
      "type": "n8n-nodes-base.merge",
      "position": [
        1824,
        368
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "typeVersion": 3
    },
    {
      "id": "7f5ee6a4-a712-4d6f-ab40-a54ef6d60d06",
      "name": "Wait-5-sec",
      "type": "n8n-nodes-base.wait",
      "position": [
        2528,
        368
      ],
      "parameters": {
        "amount": 5,
        "unit": "seconds"
      },
      "typeVersion": 1.1
    },
    {
      "id": "34039011-6fb6-4ddd-a062-022696625ea5",
      "name": "Update record",
      "type": "n8n-nodes-base.airtable",
      "position": [
        3856,
        384
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_AIRTABLE_BASE_ID"
        },
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_AIRTABLE_TABLE_ID"
        },
        "columns": {
          "value": {
            "id": "={{ $json.id }}",
            "lead_name": "={{ $json.output.contact_name }}",
            "processed": "yes",
            "email_text": "={{ $json.output.email_wrote }}",
            "lead_email": "={{ $json.output.contact_email }}",
            "create_date": "={{ DateTime.fromISO($now).toISO() }}",
            "task_result": "=Email wrote",
            "email_subject": "={{ $json.output.email_subject }}",
            "email_summary": "={{ $json.output.your_summary }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "Company_name",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Company_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Company_website",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Company_website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Company_e-mail",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Company_e-mail",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Address",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Company_phone",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Company_phone",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "processed",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "yes",
                  "value": "yes"
                },
                {
                  "name": "no",
                  "value": "no"
                },
                {
                  "name": "postponed",
                  "value": "postponed"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "processed",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "lead_name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "lead_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "lead_email",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "lead_email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email_subject",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "email_subject",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email_text",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "email_text",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email_summary",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "email_summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "create_date",
              "type": "dateTime",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "create_date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "task_result",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "task_result",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {
          "updateAllMatches": false
        },
        "operation": "update"
      },
      "typeVersion": 2.1
    },
    {
      "id": "7d6ba627-7ece-4f1b-be10-e92bc2fd6c06",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1568,
        32
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 576,
        "content": "## 3. Deep research\n\nLead Person Research sends the company name and website to Jina DeepSearch and waits up to 240 seconds for the answer. Each call uses Jina tokens. The answer is AI-written research from the web; names and emails in it can be wrong or out of date."
      },
      "typeVersion": 1
    },
    {
      "id": "22e8cdb7-2780-49b6-b7f3-1fc3bd1e6801",
      "name": "Wait-8-sec",
      "type": "n8n-nodes-base.wait",
      "position": [
        3856,
        608
      ],
      "parameters": {
        "amount": 8,
        "unit": "seconds"
      },
      "typeVersion": 1.1
    },
    {
      "id": "315b36cf-7b06-42ac-ac7c-09dde1642354",
      "name": "Get input records",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1056,
        240
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_AIRTABLE_BASE_ID"
        },
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_AIRTABLE_TABLE_ID"
        },
        "options": {},
        "operation": "search",
        "filterByFormula": "={processed} = \"no\""
      },
      "typeVersion": 2.1
    },
    {
      "id": "918e9d82-aded-4729-a0d5-764fece7e33e",
      "name": "Merge-loop",
      "type": "n8n-nodes-base.merge",
      "position": [
        3680,
        272
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "typeVersion": 3
    },
    {
      "id": "f756d500-e023-48db-82d0-12fad9268c04",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        416,
        -112
      ],
      "parameters": {
        "color": 7,
        "width": 464,
        "height": 528,
        "content": "## 1. Configuration\n\nBusiness_Info holds the facts about your company that the email agents may use: name, information (including who signs and how to contact you), key benefits, landing page and target audience. Replace every YOUR_ value.\n\nJina_API_Key holds your Jina key as plain text in the workflow. Remove it before you export or share the workflow, or move it into a credential."
      },
      "typeVersion": 1
    },
    {
      "id": "1353e698-f36f-48e8-9bab-26a5d3e2af2f",
      "name": "Business_Info",
      "type": "n8n-nodes-base.set",
      "position": [
        512,
        240
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "552b2535-f825-4e88-8e72-2beb25f4aa25",
              "name": "BUSINESS_NAME",
              "type": "string",
              "value": "YOUR_COMPANY_NAME"
            },
            {
              "id": "eee80220-fe61-4421-b381-4b9ba24362c3",
              "name": "BUSINESS_INFORMATION",
              "type": "string",
              "value": "YOUR_BUSINESS_INFORMATION: what the company does, who signs the emails (name and role) and how to contact you. Write only facts you can stand behind."
            },
            {
              "id": "c50fc262-c805-4dea-9b99-425bfe08c9fe",
              "name": "BUSINESS_KEY_BENEFITS",
              "type": "string",
              "value": "YOUR_KEY_BENEFITS: 3 to 6 benefits you can prove, one per line"
            },
            {
              "id": "879372f4-67f8-4d25-b3ed-f0b4e3171d2a",
              "name": "LANDING_PAGE_URL",
              "type": "string",
              "value": "YOUR_LANDING_PAGE_URL"
            },
            {
              "id": "039a704b-05cc-4882-9f9c-7ec1d4ada154",
              "name": "LEAD_TARGET_AUDIENCE",
              "type": "string",
              "value": "YOUR_TARGET_AUDIENCE"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "97fe1cfc-7050-4c4b-ae4e-f8763bcb36b8",
      "name": "Jina_API_Key",
      "type": "n8n-nodes-base.set",
      "position": [
        704,
        240
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "b4955d95-1447-461e-91c3-90fd935b01ec",
              "name": "jina_api",
              "type": "string",
              "value": "YOUR_JINA_API_KEY"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "b83d5c24-5579-45e6-b18c-c20b14fbca8a",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        944,
        -112
      ],
      "parameters": {
        "color": 7,
        "width": 512,
        "height": 528,
        "content": "## 2. Load the companies\n\nGet input records searches your Airtable table for rows where processed is no. Loop Over Items then handles one company at a time. Rows where processed is empty are not selected."
      },
      "typeVersion": 1
    },
    {
      "id": "4a0dfc34-f22b-4d0a-bed9-a69f5f69d58e",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2048,
        32
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 720,
        "content": "## 4. Lead analysis\n\nLead Analyzer reads the research and picks one contact. If it finds no suitable person, it uses the company name as the contact name, and if it finds no email, it uses the general company email. It returns lead_name, lead_email, company_name and summary_of_your_though (spelling kept, because the other nodes use it)."
      },
      "typeVersion": 1
    },
    {
      "id": "8e797a7c-4919-4b5f-aa89-8f28328535a4",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2704,
        32
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 720,
        "content": "## 5. Email draft\n\nEmail Content Creator writes a subject and a body from the contact, your business information and your key benefits. Wait-5-sec pauses 5 seconds before it, to space out the AI calls."
      },
      "typeVersion": 1
    },
    {
      "id": "88116213-7be4-49e7-921d-aac945e75bca",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3168,
        32
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 720,
        "content": "## 6. Review\n\nEvaluator gives the draft a score from 1 to 10, a short review and improvement ideas. It also repeats the email text, and that repeated text is what gets saved. The score and the improvement ideas are not saved anywhere."
      },
      "typeVersion": 1
    },
    {
      "id": "d30f8bcd-2be3-4bde-b654-f751192ccd10",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3632,
        -80
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 832,
        "content": "## 7. Save to Airtable\n\nUpdate record writes lead_name, lead_email, email_subject, email_text, email_summary (the review, not a summary of the email), create_date and task_result, and sets processed to yes. Wait-8-sec then pauses 8 seconds and the loop takes the next company."
      },
      "typeVersion": 1
    },
    {
      "id": "c4e7a1d2-93b5-4f68-8a0c-2d6e1b7f5a93",
      "name": "Before you turn it on",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        480
      ],
      "parameters": {
        "color": 3,
        "width": 1000,
        "height": 440,
        "content": "## Before you turn it on\n\n1. Test on two or three companies you chose, not on a long list.\n2. Read every lead and every email. The research can be wrong, and the lead email can be a guess.\n3. The lead_email field in Airtable should accept what the AI returns; an empty or invalid address can make the update fail.\n4. The workflow does not send emails. If you add sending, you are responsible for the rules on unsolicited email in your country and for honoring opt-outs.\n5. Company names, websites and the researched contact details go to Jina and OpenAI.\n6. Not tested on live APIs."
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Evaluator": {
      "main": [
        [
          {
            "node": "Merge-loop",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge-loop": {
      "main": [
        [
          {
            "node": "Update record",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait-5-sec": {
      "main": [
        [
          {
            "node": "Email Content Creator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait-8-sec": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Jina_API_Key": {
      "main": [
        [
          {
            "node": "Get input records",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge-Search": {
      "main": [
        [
          {
            "node": "Lead Analyzer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Business_Info": {
      "main": [
        [
          {
            "node": "Jina_API_Key",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Lead Analyzer": {
      "main": [
        [
          {
            "node": "Wait-5-sec",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update record": {
      "main": [
        [
          {
            "node": "Wait-8-sec",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI o3-mini": {
      "ai_languageModel": [
        [
          {
            "node": "Lead Analyzer",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Lead Person Research",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge-Search",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge-loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI - 4o-mini": {
      "ai_languageModel": [
        [
          {
            "node": "Email Content Creator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get input records": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Lead Person Research": {
      "main": [
        [
          {
            "node": "Merge-Search",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Email Content Creator": {
      "main": [
        [
          {
            "node": "Evaluator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI - 4o-mini - low": {
      "ai_languageModel": [
        [
          {
            "node": "Evaluator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Lead Analyzer",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "Evaluator",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser3": {
      "ai_outputParser": [
        [
          {
            "node": "Email Content Creator",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \"Test workflow\"": {
      "main": [
        [
          {
            "node": "Business_Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}