Skip to content

Latest commit

 

History

History
69 lines (49 loc) · 2.35 KB

File metadata and controls

69 lines (49 loc) · 2.35 KB

n8n Automation Engineer Task – Analytos

This repository contains workflows for lead qualification automation using n8n.

🎥 Demo Video

Watch the demo video

Click the thumbnail above to watch the full demo video on YouTube.


Workflows

  1. workflow.json

    • End-to-end workflow for lead qualification:
      • Trigger: Gmail new email
      • Categorization: OpenAI (High/Medium/Low) via reusable subflow
      • High Intent → Google Sheet (High Intent tab)
      • Medium/Low → Gmail reply + Google Sheet (Low/Medium Intent tab)
      • Discord notifications for all leads
      • Retry logic enabled on all API nodes (OpenAI, Gmail, Google Sheets, Discord) with up to 3 retries and 1s wait between retries
  2. lead-categorization-subflow.json

    • Reusable subflow that takes a lead message as input and returns:
      {
        "category": "High",
        "confidence": 0.92
      }
    • Can be called from any workflow using a Subflow node
    • Confidence score represents the AI's certainty (0 = low, 1 = high)
    • Retry logic applied to OpenAI node
  3. subflow-wrapper.json

    • Minimal workflow to test the subflow independently
    • Trigger: Webhook
    • Calls the subflow and returns category + confidence

Setup Instructions

  1. Connect your Google account in n8n to enable Gmail and Google Sheets operations.

  2. Create a Google Sheet document to store lead data.

  3. Create two tabs (sheets) inside the document:

    • High Intent → for leads categorized as High Intent
    • Low/Medium Intent → for leads categorized as Medium or Low Intent
  4. Replace placeholders in workflows with your credentials:

    • YOUR_OPENAI_API_KEY → for OpenAI connection
    • YOUR_DISCORD_WEBHOOK_URL → for sending notifications to Discord
  5. Import workflows into n8n and test:

    • Trigger via Gmail new email or via webhook
    • Confirm leads are categorized correctly
    • Verify Google Sheet updates, Gmail replies, and Discord notifications

Notes

  • Retry logic ensures that temporary network/API failures don’t break the workflow.
  • The subflow can be reused in multiple workflows or tested independently via webhook.
  • The AI categorization returns a confidence score between 0 and 1 to indicate certainty.