workflows.fit
Back to n8n workflows
n8n templateFreeBy Oskar

Auto-label incoming Gmail messages with AI nodes

This workflow uses AI to analyze the content of every new message in Gmail and then assigns specific labels, according to the context of the email. Default configuration of the workflow includes 3 labels: - „Partnersh...

CommunicationHITLAILangchainCore NodesSticky NoteGmail TriggerGmail
Loading interactive preview...

Template notes

This workflow uses AI to analyze the content of every new message in Gmail and then assigns specific labels, according to the context of the email.

Default configuration of the workflow includes 3 labels: - „Partnership” - email about sponsored content or cooperation, - „Inquiry” - email about products, services, - „Notification” - email that doesn't require response.

You can add or edit labels and descriptions according to your use case.

🎬 See this workflow in action [in my YouTube video](https://youtu.be/a8Dhj3Zh9vQ) about automating Gmail.

How it works?

Gmail trigger performs polling every minute for new messages (you can change the trigger interval according to your needs). The email content is then downloaded and forwarded to an AI chain.

💡 The prompt in the AI chain node includes instructions for applying labels according to the email content - change label names and instructions to fit your use case.

Next, the workflow retrieves all labels from the Gmail account and compares them with the label names returned from the AI chain. Label IDs are aggregated and applied to processed email messages.