How to Trigger n8n AI Agents from ChatGPT (no code)

Dr. Violet Howard shows how to connect ChatGPT to n8n workflows using webhooks, no coding required. ChatGPT reads a PDF invoice, extracts fields like date and total, and sends the data to n8n, which appends it to a Google Sheet. She walks through building a custom GPT with an OpenAPI schema and switching from test to production URLs.
Chapters
On the left we have ChatGPT. On the right we have my N8N assistant. And what I'm gonna do is send off this message that's asking my N8N assistant to send an email to Dexter Morgan asking for an update on Project Panda. I'm going to allow my ChatGPT to talk to N8N, and now you can see it's gonna grab that message, search through our contact database, and then it's gonna come over here and write that email using our email agent. And then when it responds to the webhook using this node right here, we're gonna get that response in ChatGPT on the left-hand side. So there you go. We just got the response. The email has been sent to Dexter Morgan asking if he has an update on Project Panda. Is there anything else you'd like to do? And as you can see over here, we have that email that was successfully sent to dexter@miami.com. So what I'm gonna be showing you guys is how you can connect your ChatGPT to an n8n webhook. And it doesn't have to be an ultimate assistant. It could be a workflow to update something in your CRM or to parse an invoice or to do whatever you want because you have the functionality in n8n to build custom workflows and then just have them be triggered by ChatGPT, which you probably are sitting there using every day. It's not gonna be too difficult at all, so let's get into it. Okay, so how the system works is we're gonna build a custom GPT, and in that GPT, we're gonna give it an action, which is the ability to send data to our n8n webhook right here. So the demo that I just showed was a pretty fun example, but we're gonna go over an example of a very practical one where you can drop in an invoice into your custom GPT, and then it will send you that data to upload to a database. And what's gonna be cool about this is ChatGPT is the one on the front end that is going to use its vision to analyze the invoice and extract the text. We don't have to worry about in n8n setting up any sort of OCR or document understanding tool because ChatGPT takes care of that. All right, so let's get started. What we're going to do is go to this custom GPT, which is one by ChatGPT. It's called ActionsGPT, and it helps us create that JSON schema that we need to give to our custom GPT so that it can send data to the webhook. So I'm going to have this GPT linked in the description. Click on that and then follow along what I'm about to do here. Okay, so I said, help me create an OpenAPI 3.1.0 schema in JSON so that I can give it to a custom GPT and it will send data to my webhook. And then we're gonna go into n8n and we're going to open up this webhook and grab this test URL real quick. Go back into the Actions GPT and paste that in there. And then what I wanna do is tell it the parameters that it's going to send over to this webhook. So in that first example, you saw I talked to my Ultimate Assistant. I just told it send over one field in the body called request. But in this one, we want the GPT to look at the invoice and pull out, you know, the date, the invoice number, the amount, all this kind of stuff. So I said, here are the fields to send over in the body request, and I gave it all of the fields I want, and then I gave it the data types, which all of these I just put as strings. You could always come back and change that, but for now, we're just going to go ahead and send this off. So as you can see, it's generating this JSON schema for us that's going to have our webhook URL, our path. It's going to have the things that we need to send over to N8N, and then once we grab that data and then all we have to do is map it to a Google Sheet. So I'm going to go ahead and copy this schema right here. I'm gonna open up my ChatGPT and go to custom GPTs, and then in the top right, I'm gonna click create. Okay, so this is gonna have you configure the name, the description, and the instructions for your GPT. You can go ahead and take a look at what I put in here and copy the instructions if you'd like. But where the magic really happens is when we give this agent access to actions. So I'm gonna scroll down to the bottom. I'm going to check on this box that says code interpreter and data analysis, and I'm gonna click on create new action. And then right here in the schema, this is where we paste in that OpenAI schema we just generated with that custom GPT. And once I paste this in, you're going to see down here with available actions, it creates basically a new tool called Send Invoice Data. We have our method as POST, and then we have the webhook path. So what I'm going to do real quick is we need to go to n8n, and we need to set our webhook as a POST method. So here's the webhook. I'm going to change the HTTP method to POST, and then I'm going to hit listen for test event. So right now, this webhook is listening. We'll go back to the GPT, and I'll hit test. And what this is going to do is it's basically going to try to talk to our and it in cloud. I'll hit confirm. And once we'll see that it's gonna talk to it, it has been able to communicate. And now if I go back to my workflow, you can see that we accepted some data. And if I scroll all the way down towards the bottom, you can see the body parameters that got sent over were date, invoice number, sold by, bill to, products and pricing, and total. So this is exactly what it's going to extract when we actually drop in an invoice. So obviously this is just sample made up data. So we have our webhook here, and what I'm gonna do is go back into our custom GPT, and we're basically configured, and I'm gonna hit create, and I'm gonna say only me, and then save it. And now that we just created this GPT, let's try to drop in an invoice and test it out. Okay, so we have an example invoice right here that's a PDF, and I'm gonna send this off, and it's going to say, please process this invoice. You can see the GPT is trying to talk to our N8N, so I'm gonna hit confirm, and then it's going to be able to send that data Well, we have to make sure it's listening for us. So I'm going to go back into the workflow. I'm going to hit execute workflow. Now it's listening and we'll try this again. Okay, so I said try again. I'm going to hit confirm, and this time it should be able to read that invoice and send data over. So you can see we just captured data in NNN. I'm going to go to table view so we can look at it better, and we can see we have a date, an invoice number, we have sold by with an address, we have bill to with an address, and then we have our products and pricing and our total. And here's the actual example invoice we dropped in. We can see the invoice number and the date. Those line up perfectly. We can see the sold by and the bill to, which should be local store, importing company, local store, importing company. We have the right email address and address as well. We have 2 items, conveyor belt for $400, pole for $85. And then here we have pole for $85 and conveyor belt for $400. And the total is $702, which you can see matches up over here. So like I said, we drop an invoice into our custom GPT. It uses its vision to analyze it, and then it sends over the parameters to us. And now all we have to do is put that into a Google Sheet. So I have this template real quick which has those exact parameters. I'm going to go into here, I'm going to connect a Google Sheet, and we're going to do append row and sheet. Now all I have to do is link up that sheet that we were talking about called Invoice Database. I'll link it to Sheet 1, and then this is going to pop up with all of those columns that we have set up in Google Sheets. So I would just close out of headers and go to the body. We have date, we have invoice number, we have sold by, we have bill to, we have products and pricing, and then we have our total. So now all I'm going to do is hit save. I'm going to make this thing listen to us once again. Then I'm going to go ahead back into our ChatGPT. I'm going to drop in the invoice once again and say, process this, send it off. And we should be able to talk to the connector. I'll hit confirm. And now we should see that once this is done, we'll go ahead and come into here and we should see that it's going to write that data to to this sheet. There we go. And so two things I wanna point out. The first one is how do you want your workflow in n8n to respond to your custom GPT? In that first demo, we basically used the Respond to Webhook node because sometimes we had to wait for data to come back. But in this case, we were just responding immediately. And you can change that setting in the webhook. So right here you have Respond. This one was set to immediately, or you can use the Respond to Webhook node, which will send back whatever comes at the end of the workflow back to the initial thing that triggered it. So there's that. And then the other thing is right now we're testing the webhook, so we have to hit execute workflow. If we wanted to switch this to active, we would have to actually use the production URL in here. So the only difference is that after cloud/webhook, the test one says -test and the production one doesn't say -test. So what you could do is go back in your custom GPT, you could open it up and say edit GPT. And then in here, you would just scroll down to your action, which is the one that we configured. And all you'd have to do is right here for the path, you would just basically get rid of the -test and everything else should already be configured. Then you'd hit update up here and your GPT would be saved and it would be able to talk to your active workflow. And just to show you guys how that respond to webhook node thing works, I'm asking the GPT to get Mark Johnson's contact information. It's going to send that query off to our Ultimate Assistant. and it has to wait over here until it actually gets Mark Johnson's contact information. So the agent's about to send it back to the webhook, and now our custom GPT can respond to us. And just so you guys see that that worked, we have Mark 2343 and 333444, which is exactly what we see for Mark in our Airtable base. So if you like this type of content and you want to take your N8N learning a little bit deeper, then definitely check out my paid community. The link for that is down in the description. Got a great community of members who are building with N8N every single day for themselves or for their businesses. Always sharing their resources and challenges that they're running into. On top of that, we have two full courses right now, one called Agent Zero, which is like the foundations for AI automation. And then this one is 10 Hours to 10 Seconds, where you learn how to identify, design, and build time-saving automations. We also just announced a pretty cool partnership where we're able to get our members up to $3 million in savings across some of the top AI tools like Bolt, Airtable, Perplexity, Azure Cloud credits, stuff like that. So if any of that sounds interesting to you, definitely check out the community. But I appreciate you guys making it to the end of the video. As always, if you learned something new or you enjoyed the video, please give it a like. Helps me out a ton, and I'll see you all in the next one. Thanks, guys.










