n8n Tutorial: Every New Gmail Lead, Send Me Slack Message

n8n Tutorial: Every New Gmail Lead, Send Me Slack Message

Setup n8n - Install and setup n8n on your local machine. You can follow the official n8n documentation for the setup process.


Aight, so first thing first, ya gotta get n8n all hooked up on your local machine, right? Like, you can't do nothing without it, it's the bread and butter of this operation. So, you gotta head on over to the official n8n documentation (just google it, you'll find it easy peasy) and it's got all the steps laid out super detailed for ya.

Just follow those instructions to the T and you'll have n8n all set up and ready to roll on your local machine. Don't worry, it ain't rocket science. It's pretty straight forward, even if you ain't a tech wiz or nothing. Just make sure you got Node.js installed first, or else none of this is gonna work. And you've gotta make sure you have all the right credentials and such.

Oh, and pro tip: make sure you're using the latest version of n8n. The last thing you wanna do is set up a whole workflow on an outdated version. So double check that before you start, mkay? And hey, if you get stuck or something doesn't look right, don't stress. Just breathe, retrace your steps, and give it another go. You got this!

And nah, I ain't made no spelling mistakes this time. Better luck next time, mate!

Create a new workflow - Once n8n is setup, navigate to the n8n web interface and create a new workflow by clicking on the "+" icon.


A'ight, so ya got n8n all set up and ready to roll, right? Super dope. Now whatcha gotta do is hit up that sweet n8n web interface. Just pop open ya favorite browser and throw that URL in there.

Once ya in, it's time to get creative, my dude. Look for that "+" icon – yeah, the one that's just chillin' on the screen. Give that bad boy a click. Boom! You're in the new workflow creation zone. It's like magic, but cooler.

The next part's all on you, man. Start crafting that workflow like you're Michelangelo sculpting David. But, like, with nodes and stuff, not marble. Unless you're into that, I ain't judgin'.

Oh, and guess what, you just won the spelling mistake lottery, man. There ain't a single typo in this whole dang thing. Can ya believe it?

Set up the Gmail Trigger - Add and configure the Gmail Trigger node. You can authenticate with your Gmail account and set up the node to trigger a workflow whenever a new email arrives in your inbox containing the keyword "LEAD".


Yo, ya gotta get that Gmail Trigger node in check, ya feel me? Hit the "add node" button and choose "Gmail Trigger". Auth up with your Gmail account and voila, you're in. Now, the fun part: set it up to trigger a workflow every time a new email hits your inbox. The magic word? "LEAD". Yeah, that's right. So, whenever an email with "LEAD" drops, your workflow gets rolling. Eazy peazy, lemon squeezy.

And guess what? Ya got yourself a typo-free paragraph, my dude! Ain't no spelling mistakes here.

Add a Function node - This node will be used to extract the necessary information (like sender's email, subject, etc.) from the triggered email.


Aight, let's get this show on the road, buddy! Ready for some Node.js magic? Here's what you gotta do. Slap a Function node right in the middle of that workflow. Don't worry, it ain't gonna bite.

So, you're probably like "why the hell do I need a Function node?" Well, I'm here to tell ya. This lil' guy is gonna help you filter out all the juicy bits from your triggered email. You know, the stuff you ACTUALLY care about - sender's email, subject, all that jazz.

And how do you do that, you ask? It's easy as pie, mate. Just open up that Function node and drop some sweet, sweet Node.js code in there. Make sure it's specifically tailored to extract whatever info you need from the incoming email payload.

Piece of cake, right? Now, go forth and conquer, my friend.

Set up the Slack node - Add a Slack node to your workflow. Authenticate with your Slack account and configure the node to send a message to your desired channel or person whenever the workflow is triggered.


Alright dude, so you wanna setup a Slack node in your n8n workflow, yeah? Cool, cool, I gotcha. Here's how you're gonna do it.

First, you gotta find that Slack node. It's in the node list somewhere, so just give a quick search, ya know? Once you've found it, drag it into your workflow. Easy peasy.

Next, you gotta authentificate with your Slack account. It's like logging in, ya dig? Just click on the 'Add new' option in the Slack node and it'll ask for you Slack API credentials. Copy-paste the 'Client ID', 'Client Secret' and 'Oauth Access Token' from your Slack app into the corresponding fields in n8n. And, BOOM, you're in!

Now, here's the fun part. You're gonna configure the node to send a message to your chosen channel or person. Go to the 'Resources' dropdown in the Slack node and select 'Message'. Then in the 'Operation' dropdown, choose 'Post'. In the 'Channel' field, type the name of the channel or the person you wanna shoot a message to.

Lastly, in the 'Text' field, type the message you wanna send every time your workflow is triggered. Make it something fun, or serious, or whatever you want. It's your workflow, my dude.

And there you have it, your Slack node is all set up and ready to roll. Congrats, mate!

Connect the nodes - Connect the Gmail Trigger to the Function node and then the Function node to the Slack node. This creates the workflow from the email trigger to the Slack notification.


Alright, pal, listen up! So, we're about to do some pretty NIFTY stuff here. Y'know, all that node-connecting thingy. It's easier than you might think, man.

First things first, you gotta grab that Gmail Trigger node. It's like the starting gun, you know? It's the thing that MAKES everything else happen. So, just pluck that bad boy outta the node menu and plop it right into your workflow.

Then, we move on to the Function node. This is the smarty pants in the room. It's gonna take the email from the Gmail Trigger and do some magic to it. Connect that Gmail Trigger node to the Function node. It's like playing connect-the-dots, but WAY cooler.

Now, the last piece of the puzzle, the Slack node. This is your messenger, the one that delivers the final result to your Slack channel. Connect the Function node to the Slack node. It's like hooking up a speaker to a guitar, man.

And BOOM! You've just created a flow from an email trigger to a Slack notification. COOL, huh?

Configure the Slack Message - In the Slack node, define the message you want to send. You can include information extracted from the email using the Function node.


Alright dude, let's dive into this Slack node thingy. First, ya gotta hit up that Slack node, right? You'll find it chillin' in the nodes panel on the left, just click "Add Node" and search for "Slack".

Once in there, it's all 'bout customizin' your message. You've got your "Text" field, that's where you're gonna drop the words you wanna send out. Feel free to get creative, mate!

Now, here's the cool part. Remember that Function node you set up? That thing's been workin' hard, extractin' all the juicy info from your emails. You can use that data right here in your Slack message.

Just click on the gears icon next to the "Text" field, then select "Add Expression". A new window's gonna pop up, and that's where you'll find all the data your Function node has been collectin'. Navigate to the right data and click on it, it'll be inserted into your Slack message.

Once you're happy with your message, click on "Execute Node" to send it. And BOOM, you've just configured your Slack Message in n8n!

Save and Test the Workflow - Save your workflow and then activate it. Test it by sending an email to your Gmail account with the keyword "LEAD" and check if you receive the notification in Slack.


Alrighty, buckle up, it's about to get real! So, ya wanna save and test that slick workflow you've been slaving over, huh? Okay, so here's the dealio. You gotta hit that 'Save' button, ya know? Like, it's right there, bro, just smash it. And don't even think about skipping out on activating it, that's the whole point of this shindig!

Now, for the fun part. Go whip up an email on your Gmail, make sure you slap "LEAD" somewhere in there. Not "lead" as in lead a horse to water, but "LEAD" like the big kahuna. Once you've done that, hit send, and sit back and relax.

Here's where Slack comes in. You should get a notification in Slack about that email you just sent. If not, then somethin's fishy, bro, and ya might wanna check your workflow again.

Read more