Modèle de réponse automatique par e-mail

Intermédiaire

Ceci est unAI Chatbot, Multimodal AIworkflow d'automatisation du domainecontenant 12 nœuds.Utilise principalement des nœuds comme Gmail, Filter, EmailReadImap, OpenAi. Classification et réponse automatique des e-mails de prospects basées sur l'IA, intégrant GPT-4o et Gmail

Prérequis
  • Compte Google et informations d'identification Gmail API
  • Clé API OpenAI
Aperçu du workflow
Visualisation des connexions entre les nœuds, avec support du zoom et du déplacement
Exporter le workflow
Copiez la configuration JSON suivante dans n8n pour importer et utiliser ce workflow
{
  "id": "XOp3UmuOGm0uEUOP",
  "meta": {
    "instanceId": "6dab325484db17217432bd17c46b16a74656e18b7a3b29fe24824c64123a2170",
    "templateCredsSetupCompleted": true
  },
  "name": "Email Autoreply Template",
  "tags": [],
  "nodes": [
    {
      "id": "46330a1e-99c2-4e0b-b2ef-fbc1ac382402",
      "name": "Déclencheur d'e-mail (IMAP)",
      "type": "n8n-nodes-base.emailReadImap",
      "notes": "Checks your email inbox for new incoming messages in real time using the IMAP protocol.\nThis node is the entry point of the workflow, capturing any new email so it can be processed.\nYou can configure it to watch a specific folder (e.g., INBOX, Leads).",
      "position": [
        0,
        0
      ],
      "parameters": {
        "options": {},
        "postProcessAction": "nothing"
      },
      "credentials": {
        "imap": {
          "id": "GBGE5j98GwOB5V51",
          "name": "IMAP account"
        }
      },
      "notesInFlow": true,
      "typeVersion": 2
    },
    {
      "id": "2a2a35ef-23cf-4612-ac7d-21f91f21a2c6",
      "name": "Filtrer",
      "type": "n8n-nodes-base.filter",
      "notes": "Filters out emails that are not classified as leads.\nOnly messages identified as leads will continue through the workflow for an automated reply.",
      "position": [
        608,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "4da59f1a-dd10-450e-a113-d193b63fcdac",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.message.content.lead.toBoolean() }}",
              "rightValue": ""
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 2.2
    },
    {
      "id": "ddba86b4-fe7d-4c36-b42c-6dde939d05f4",
      "name": "Get Message",
      "type": "n8n-nodes-base.gmail",
      "notes": "Retrieves the full details of the original email, including the sender’s address and the conversation thread, so the reply can be linked to the correct message.",
      "position": [
        1216,
        0
      ],
      "webhookId": "331d3af5-bd09-4535-be40-c9fd69060da8",
      "parameters": {
        "filters": {
          "q": "=from:\"{{ $('Email Trigger (IMAP)').item.json.from }}\" subject:\"{{ $('Email Trigger (IMAP)').item.json.subject }}\" "
        },
        "operation": "getAll"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "vsP48CVVz5mhUGAc",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "f1b3f3c5-a2fe-436e-a272-d3958ccab3e5",
      "name": "Reply to Message",
      "type": "n8n-nodes-base.gmail",
      "notes": "Sends the AI-generated reply back to the sender as a direct response to their email.\nThe reply will appear as part of the same conversation thread in the recipient’s inbox.",
      "position": [
        1536,
        0
      ],
      "webhookId": "38d18d52-4d45-4e12-bfcd-2e1f4bb5907f",
      "parameters": {
        "message": "={{ $('Reply with customized message').item.json.message.content }}",
        "options": {},
        "emailType": "text",
        "messageId": "={{ $('Email Trigger (IMAP)').item.json.metadata['message-id'] }}",
        "operation": "reply"
      },
      "notesInFlow": true,
      "typeVersion": 2.1
    },
    {
      "id": "2489c348-5d8e-4564-915f-1d933eae745b",
      "name": "Note adhésive",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1456,
        -320
      ],
      "parameters": {
        "color": 3,
        "height": 256,
        "content": "## Reply to Message\nSends the AI-generated reply back to the sender as a direct response to their email.  \nThe reply will appear as part of the same conversation thread in the recipient’s inbox.  \n[Guide](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.gmail/)\n"
      },
      "typeVersion": 1
    },
    {
      "id": "e7617aa6-1104-4cc9-af36-80d7c19cdc59",
      "name": "Note adhésive1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        -320
      ],
      "parameters": {
        "color": 4,
        "width": 208,
        "height": 256,
        "content": "## Email Trigger (IMAP)\nMake sure to replace you own [service/offer] in the prompt\nChecks your email inbox for new incoming messages in real time using the IMAP protocol.  \nThis node is the entry point of the workflow, capturing any new email so it can be processed.  \nYou can configure it to watch a specific folder (e.g., INBOX, Leads).  \n[Guide](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.emailimap/)\n"
      },
      "typeVersion": 1
    },
    {
      "id": "33fe0c88-6540-4087-bb60-ac6c4de9f6d3",
      "name": "Note adhésive2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        224,
        -320
      ],
      "parameters": {
        "color": 7,
        "height": 256,
        "content": "## Is Lead? (Message Model)\nUses an AI model to analyze the incoming email and determine whether the sender is a potential lead.  \nThe AI looks for keywords, tone, and intent within the message to classify it as a lead or not.  \n"
      },
      "typeVersion": 1
    },
    {
      "id": "54c5cf98-a106-4e3b-ad2d-d57fb8095044",
      "name": "Note adhésive3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        528,
        -320
      ],
      "parameters": {
        "color": 5,
        "height": 256,
        "content": "## Filter\nFilters out emails that are NOT classified as leads.  \nOnly messages identified as leads will continue through the workflow for an automated reply.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "94aedcf9-6abb-40e0-9856-e2fc3a84116a",
      "name": "Note adhésive4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        832,
        -320
      ],
      "parameters": {
        "color": 7,
        "height": 256,
        "content": "## Reply with customized message (Message Model)\nGenerates a personalized reply using AI based on the content of the incoming email.  \nMake sure to replace your own \"business/service\" in the prompt.\n\nThe response can be tailored to greet the sender, answer initial questions, and encourage further engagement.  "
      },
      "typeVersion": 1
    },
    {
      "id": "83e57764-c096-45fc-a475-0167caa7eeaf",
      "name": "Note adhésive5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1136,
        -320
      ],
      "parameters": {
        "color": 3,
        "width": 256,
        "height": 256,
        "content": "## Get Message\nRetrieves the full details of the original email, including the sender’s address and the conversation thread.  \nEnsures the reply is linked to the correct email conversation.  \n[Guide](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.gmail/)\n"
      },
      "typeVersion": 1
    },
    {
      "id": "4875fac3-0ca1-4d26-a116-3afcfe8477c9",
      "name": "Filtrer leads",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "notes": "Uses an AI model to analyze the incoming email and determine whether the sender is a potential lead.\nThe AI looks for keywords, tone, and intent within the message to classify it as a lead or not.",
      "position": [
        240,
        0
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "GPT-4O"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "= Indicate if the following message is a lead that's interested in my [service/offer]\n\nOutput as JSON {\"lead\": \"<true/false>\"}\n\n {{ $json.textPlain }}"
            }
          ]
        },
        "jsonOutput": true
      },
      "credentials": {
        "openAiApi": {
          "id": "pPLBqqocz7PcZiny",
          "name": "OpenAi account"
        }
      },
      "notesInFlow": true,
      "typeVersion": 1.8
    },
    {
      "id": "7c5f6533-c82e-4fa2-b794-c93b38903c7c",
      "name": "Reply with customized message",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "notes": "Generates a personalized reply using AI based on the content of the incoming email.\nThe response can be tailored to greet the sender, answer initial questions, and encourage further engagement.",
      "position": [
        848,
        0
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "GPT-4O"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "You're currently monitoring a sales email inbox for my [business and service you offer]. For every inquiry you receive, digest it and respond appropriately with a customized message that's tuned to the particular prospect. Make sure to use spartan, no-frills language."
            },
            {
              "content": "Name: Michael JacksonType: High-TicketMonthly Commitment: $8,000About: Hi I really want to get started on your high tickey monthly e-commerce offer - let me know how to start!"
            },
            {
              "role": "assistant",
              "content": "Hey Michael,\n\nNick here. Thanks for reaching out & I appreciate your interest in my high ticket e-commerce offer. Happy to help you get started!\n\nI just let someone on my team know about this & they'll give you a call in a couple of minutes to dive into detail. Looking forward to working with you.\n\nCheers,\nSanti"
            },
            {
              "content": "={{ $('Email Trigger (IMAP)').item.json.textPlain }}"
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 1.8
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "callerPolicy": "workflowsFromSameOwner",
    "executionOrder": "v1"
  },
  "versionId": "3d19076b-77ab-48ed-aa07-77e72067969c",
  "connections": {
    "Filter": {
      "main": [
        [
          {
            "node": "7c5f6533-c82e-4fa2-b794-c93b38903c7c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ddba86b4-fe7d-4c36-b42c-6dde939d05f4": {
      "main": [
        [
          {
            "node": "f1b3f3c5-a2fe-436e-a272-d3958ccab3e5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter leads": {
      "main": [
        [
          {
            "node": "Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Trigger (IMAP)": {
      "main": [
        [
          {
            "node": "Filter leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "7c5f6533-c82e-4fa2-b794-c93b38903c7c": {
      "main": [
        [
          {
            "node": "ddba86b4-fe7d-4c36-b42c-6dde939d05f4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Foire aux questions

Comment utiliser ce workflow ?

Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.

Dans quelles scénarios ce workflow est-il adapté ?

Intermédiaire - Chatbot IA, IA Multimodale

Est-ce payant ?

Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.

Informations sur le workflow
Niveau de difficulté
Intermédiaire
Nombre de nœuds12
Catégorie2
Types de nœuds5
Description de la difficulté

Adapté aux utilisateurs expérimentés, avec des workflows de complexité moyenne contenant 6-15 nœuds

Auteur

AI & automation consultant helping businesses streamline processes, generate leads, and scale faster with smart workflows. Founder of SyncraLabs, integrating AI with n8n to create practical, high-impact automations. Passionate about sharing knowledge through ready-to-use templates and community contributions.

Liens externes
Voir sur n8n.io

Partager ce workflow

Catégories

Catégories: 34