LinkedIn auto-responder chatbot with machine learning

I do not log into five or ten LinkedIn accounts every morning to read replies. A message extractor pulls the chat. A router decides if they answered. Keyword filters send the obvious replies. A classifier covers the ones the keywords miss. Slack gets everything that still needs a human.

This is the Integromat scenario — now Make.com — I used for that. Same canvas if you are on five accounts or a hundred.

Extract the conversation, not just the last line

The module opens a LinkedIn chat by profile. You can take the first message or the whole history. Each object has the author, their LinkedIn URL, the text, the timestamp, and the conversation URL.

In the demo I asked for two messages. I got the latest reply plus one from five days earlier. That is enough to build reply logic: who spoke last, and what they said.

Reply logic is whose name is on the last message

Put a router on the author field. If it contains the name on your account — mine is Nathan — they have not replied. Mark the contact. Send a follow-up.

If the author does not contain your name, they replied. That is the only check. You do not need to parse the thread by hand.

Dump replies into Slack or a CRM

On a reply I post to Slack: author plus message content. That is the whole inbox if you are managing more than a couple of accounts.

Same branch can write onto a lead. I do not use HubSpot myself. If you already synced the person there, add the message as a property. Or write it to a database. The extractor does not care where the text goes.

Sales replies fall into about seven buckets

If your outreach is similar, the answers cluster. I usually see: yes I am interested; interested but have questions; interested but not right now; maybe; not interested; other. Some businesses have more. Most do not need more than that.

Keyword filters before you touch a model

Clone a filter per bucket. Match on message content, contains, case-insensitive. Capitals should not drop a yes.

Interested: "how do I get started", "how do I sign up", "yeah let's get started", "I'm interested". Stack ORs. You can have hundreds under one path if you go through your own history.

More information: "can you send more information", or "I would like to hear more", or an AND of "send more" plus "information".

Not interested: mark them. Do not send another pitch.

If a message matches none of the filters, it needs a person. Send it to Slack. For the video I only built four paths: interested, has a question, needs more information, not interested.

The actual auto-replies

Example outbound: I was wondering if you were interested in website plugins, happy to offer a 90-day free trial for you and your team, I will set you up with a discount code.

If they say how do I get started or I'm interested, reply immediately: Hi {first name}, great, you can sign up via this link, here is today's discount code.

If they need more information, send whatever you already have — an explainer video is enough. Pricing is another filter if you keep getting asked.

Spend a few hours in your message history and add every phrasing you actually see. You should be able to automate about 80% of replies that way. The leftover 20% is the Slack queue.

MonkeyLearn for the replies keywords miss

MonkeyLearn has an outbound sales response classifier. HTTP POST from Integromat, application/json, they had a free plan. Transform the extracted message to a JSON string and send it. Do not wrap extra brackets — the module adds those.

Their template text came back as interested at 49.3% confidence. I do not route on that. I route when the classification tag contains interested and the confidence is greater than 0.75. Use 0.80 if you want it tighter.

The same model returns not interested and neutral. Build those filters next to your keyword paths. The chatbot is the mixture: your classifications plus the model.

Iterate the whole history, skip your own lines

To run every message in the extract, drop an iterator on the messages array and run the rest of the scenario on each item. Filter first: author does not contain your name. Otherwise you classify your own follow-ups as inbound replies.

OFM Insider and Automation Academy if you want the communities from this video. Tools and resources are Bento. A one-off session is Calendly. Four sessions is 4x Consultations.

Transcript

Hey guys it's Nathan again and I've been getting a lot of questions about how to manage the LinkedIn message extractor so I'm just going to make a video today. We're going to go over the basics of how to actually use a message extractor, how it pulls messages from your LinkedIn message history, and then we're going to go into some more advanced workflows in terms of what it is fully capable of. So we'll just start off with an example profile. I'll just pull something out of my message history.

Just to explain what this does in the simplest way possible, it's going to go into a LinkedIn chat just like this one. Let's find someone who's actually responded to me. So we use this one as an example and we just want his LinkedIn profile. And if there's a conversation history we can choose to extract the whole thing or we can just choose to just take the first message. So it will give you the content of the actual message. It will tell you the time that he responded or she responded. But also on top of that, this is how we would build out reply-based logic, but we can also make some really advanced flows. So I'll just give you a quick demonstration of how this will actually work.

Cool so we've got our response. And if you want the result object then keep opening these up. So as we told it to expect two messages this is what it has returned us. So we've got this is the author, the person who sent the message, this is their LinkedIn profile, and this is the message that he sent me. This is the time he sent it. This is the URL of the conversation and it's got his LinkedIn profile again. So again we also have another message that he sent previously to that a couple of days before, four days before, five days sorry.

And so if we have that information, now what you can actually do is you could filter out reply-based logic. So I'll give you an example of how to do that. So we've put in a router and we would say if condition result object messages author contains — so we need to know the name of the account that we've sent from — so if it contains Nathan for example then we want to go in and mark that that contact hasn't replied yet. We haven't got a response. So we could go and send a follow-up message for example would be an example flow. So we could just go and send him another message. Or does not contain Nathan, so it hasn't been sent from our account, then we know he's replied.

And then for example, just to give you a quick example of what we can do here, we maybe create a Slack message and I could send it to myself. And this is really useful if you're managing like hundreds of or even like five or ten LinkedIn accounts. You don't really want to have to go through the process of logging into the account every day or looking into multiple accounts and keeping on top of all the messages. So if you can just send it directly into like a Slack channel or something like that then we can just choose to send it here. And then under text we would choose to send probably the author and then we would put the message content. So it's something like that if that makes sense. And then that would send the replies back and then whatever message he said.

So that would be like an easy example flow to do. You could also do it another way. For example if you have like a CRM, if you have like HubSpot or any of them, this would work. You could add a property to a lead. So I don't use HubSpot myself but we would use the same flow and you could add that message onto a lead if you've synced them over there already. So that would be how to sync over new messages coming in. You could also store them in a database, like whatever it is that you want to do.

What I will actually do though is we can make a little bit of a more interesting automation. So I can show you a very basic way to do this first actually. We can do like a message sender and after that we'll actually add in a machine learning model so you can add that into your flow. So let's say, let me just add in my, in fact it's not, cool, and then we can just clone this and pull this across.

So as a very quick example, like if we're doing sales outreach from LinkedIn and we're always using similar messages, you're going to find that you see trends in responses and it's going to usually fall into like one of seven different categories in most cases. Maybe more depending on your business, maybe less. So it's going to be yes I'm interested, interested but have questions, interested but not right now, maybe, not interested, or it's going to fall into like an other category.

So what you can actually do is based on keywords in a message you could probably automate a load of your own. You could build like an auto respondent. So I can just clone these down here and based on the content that is in that initial message, the one that we've received here, we can set up a filter. So we could do interested and we would do messages message content and then you would do contains case-insensitive. And maybe they would say something like how do I get started. Yeah but for example there can be loads of different responses so that could all mean the same thing. So you need to add in a load of these and it's going to vary from one business depending on your outreach.

So again we can put in contains case-insensitive. We could put like how do I sign up. So the best thing to do, obviously I'm just giving a quite a simple basic demo, the best thing to do should be to go through your LinkedIn messages and see the type of responses that you get. And every time you have a new one you would just add it in, putting in another OR. Also if the message contains yeah let's get started. It could be loads of different things. So you could have like hundreds of different filters under the purely yes I'm interested to get started model.

And then we could have like this one is, and again if the message contains case-insensitive. The reason that we do case-insensitive is if they have like a capital or not it's going to filter out when really they're saying what we want them to. So this could be can you send more information, and then send more, and then we could have an AND rule and it could be info or information if that makes sense. So these are both running independently and then we have another, we can keep them going on separately right if that makes sense.

So up here we can have like another OR and these are all separate instances right. So I would love to hear more. So if this contains can you send more information, I would like to hear more is within there, or if they say send more and also contains information in this message then we're going to route it down to this path. And then again this just goes on and on. So it depends. You kind of want a number of different messages to be filtered down a different path.

If they say, for example if a condition if message contains not interested, then we probably don't want to send them a message. We actually want to mark them that they're not interested right. So I hope that that sort of comes together and makes sense. And then maybe if they have a question that doesn't fall into any of these parameters then it means it needs human attention right. It means that our filtering system hasn't been able to pick it up and we're going to need someone to go back and respond to the message. So in that case it could be sent over like to Slack or something like that.

So we've just, for the purpose of this video, we've just set up three different filtering options. So we've got interested, has a question, needs more information, and not interested. So then what you would do is under this template, here's your discount code, you can get started, something like that. So for example if we sent out like an automated message that said hi there I was wondering if you were interested in website plugins, would be happy to offer you a 90 day free trial for you and your team, just let me know and I'll set you up with a discount code.

And then they say either like how do I get started, how do I sign up. We could even have like another OR saying like I'm interested. If it contains I'm interested then they're going to be filtered down this route and they're immediately going to get a message saying hi first name, great, you can sign up via this link, here's your today discount code, and then you just put like a link there. So that's just a little example.

Then if they say that hi I need more information we can put that, hi, like so whatever your product is related to you want to push them over to wherever you've got information stored. So we could do like sure there's a link to an explainer video. In fact you don't even need a link, keep this embedded. Yes so something like that. And so if they're asking for information you're just going to send that over to them. You could even put like what about pricing. You could have another filtering option.

So if you understand sort of what I'm getting at here you can constantly build on top of this. So the type of questions that you receive, they're going to be different to me. So I'm using quite generic messages here but you can sort of train this. This is essentially a chatbot to respond to any messages that you receive frequently within your outreach. And then if it's not able to be picked up in any of these, you would need to do if does not contain any of these parameters then send over the message in like Slack or something like we spoke about previously.

So yeah that is how you would make a chatbot and it would take you a little while to train. I think people need to spend a few hours here going through your message history to add in a lot of different filtering options. But I mean technically you should be able to actually automate about 80% of the responses that you receive because in general they're all going to be classified under specific keywords. This is just a really good way to automate your responses particularly as you scale out your campaign. So I think that's really interesting.

Now I will actually show you how we can go and add in an artificial intelligence module within Integromat. So we're going to use a tool called MonkeyLearn. And MonkeyLearn, they have a number of different APIs for analyzing responses and a number of APIs actually as well for natural language processing and various different other tools. So this is one that I was actually playing around with and it's called outbound sales response classifier. So as you can see it's going to say like this is just some template text and then they've returned it is interested. They're 49.3% confident that this person is interested.

So what we will do is copy this and this is a POST request. Cool. And then we need authorization. So MonkeyLearn have a completely free plan as well which is pretty pretty good. And what we're going to do is copy, where's our example. So in general you're always going to want to choose application/json. And if we come here we should be able to. Sometimes these get manipulated when you copy them so I'm just going to replace them. And then what we would do is delete that, go back into our result object and we would put in the message and then it's going to actually analyze the data that we received from our message.

So if we save, I'm not sure, yeah I was using this module previously so I think it's interfering somehow. Okay so to use this module what we're going to do is just create JSON. Sorry we're going to do aggregated JSON. So to use this module all we are going to do is just transform to JSON. We'll get the message out here and then delete your brackets because this is actually going to attach them automatically. That's going to be rendered as a JSON string. Hit save. And that this person is interested. Confidence score is level one.

So instead what we can do is change our, this is clean up this flow a little bit. We can instead, or we could also add at the bottom, or actually it's going to be data classifications. So confidence score is greater than, I don't like, 0.75 for our classification tag name contains interested. So that means that this machine learning module has told us that it's 75 percent confident. Obviously you can change that to whatever you want. You can put a minimum of like eighty percent confident or whatever number you want it to be that that person is interested in what you've proposed. So play around with it yourself.

And then you could also do not interested and it will return a different response. It has various different types of responses. Like it can be neutral and it can also be not interested. So you can set up your various different filtering options on that. But now that's like a little bit of a more advanced workflow.

So we went through the simple stuff to start with and now technically you do have a LinkedIn chatbot, a simple one, that you can continuously add to. And handle pretty much all of your LinkedIn responses automatically using a mixture of machine learning and your own classifications that you've added in. So I hope that's shed some light onto what you can do and how the message extractor works.

What you can also do, I was getting this question quite a lot, is if you want to run through all of the messages that are returned in the history you're going to need to use an iterator which is going to split all of the messages and run them through individually. So you would click this messages here and then instead of running on this we're going to run on the response from the iterator if that makes sense. And I would also set up the filter earlier on that the author does not contain Nathan because the messages are coming from my account from Nathan and I need to make sure that these are actual responses from real people that we're going to analyze. So as long as the response isn't from me then it will continue past this point and it will run through the automation.

So yeah I hope that all makes sense and gives you some idea of how you can build this. And I built this very quickly just to give you a quick example. I may continue building on this. I have been looking at implementing a lot of chatbots and things like that and I've built out a few already. But yeah thank you very much for watching. If for any more videos that you want to see on automation stuff, I'm putting quite a lot of effort into pushing out content so feel free to leave a comment if there's any questions and so on. Also just let me know. Yeah thank you for watching.