🤝 Work with me: https://www.inflate.agency/?utm_source=youtube&utm_medium=build-advanced-voice-agen...
Video Transcript:
in this video I will do a complete walkthrough of vy's workflow Builder previously on the channel I've been building many different AI voice agents using a single prompt this single set of instructions is excellent for building appointment Setters simple support systems and even more complex voice agents that connect with multiple apis however the scale at which we can continue to add to these voice agents does begin to decrease my name is Brendan and I've been creating AI agents for small to mediumsized businesses for almost 2 years at my agency in flate AI I've used various tools to create Automation workflows and more recently to develop AI voice agents papy's workflow Builder is a visual canvas enabling us to connect multiple prompts and add conditional logic to determine specific Pathways and and which way to go initially using this will seem a bit daunting compared to a single prompt although when we start to build more complex voice agents a builder like this does make it far easier to manage and fix as they grow and to give you a real example here is a visual diagram we created for one of our clients requiring the setup of a single prompt agent and now let's compare this to a diagram for one of our multi- prompt clients as you can see there is quite a significant difference in the scale of these voice agents recreating this diagram via a single prompt is incredibly difficult and as reliability will undoubtedly be less than that of a more conditional approach to illustrate how to build an agent using the new workflow Builder I'm going to create an inbound receptionist for an internet services company this agent will include several flows for different types of requests such as new business inquiries outage problems accounting issues ETC additionally it will accommodate both new and existing customers which means we're going to have two separate flows that respond differently to each of those categories each flow will communicate with various apis to send information as well if you want to access the VY workflow template I'm going to be creating in this video you can join my school community which is linked in the description we've got a masterclass for vapy retail voice flow in addition to 40 plus AI agent templates so come join our Vibrant Community we've got many voice AI enthusiasts who can help answer any of your questions so without further Ado let's jump in so jumping right into it this right here is vy. a if you have never touched vapy before you don't have a clue how to build an agent on vapy I do have plenty of other videos they do a bit more of a deep dive into actually using the vapy platform actually getting a bit of a better hand as to how to build these systems on here but the purpose of this video will be to walk through specifically vapy workflows and building an agent using vapy workflows so this right here is my vapy dashboard my vapy account so what I'm going to do right out the gate is click on create assistant I'm going to create a brand new assistant just for this video and walk through you know everything step by step as to how to get this workflow system up and running so typically what you'd create is an assistant here this is the very Standard Process we can call this the uh internet service provider and I'll just add YouTube here as well we'll go ahead and just collect the blank template we're not going to be using any of these blank template and then create a assistant once we've gone ahead and done that we're going to land on this page right here which is the standardized the vapy assistant Builder this is where we're going to be using you know your system prompts doing all of your basic stuff here and they've got all of the vappy traditional settings here as well now what we're going to do differently this time as opposed to just building out our agent here is go to the left hand side of our screen where we've got the workflows tab we're going to click into here and this is going to open up a whole host of new options for creating with fappy workflows so I do have a couple of projects already in here that I was playing around with but all you need to do is click on create workflow the big button up here it's going to open up this new workflow tab enter the name of your new workflow so we're going to call this I'll just call it YouTube demo you can call it obviously anything You' like it doesn't matter choose an assistant now this is really key we're going to now connect this to the assistant that we just created and so there you go I just went ahead and selected the agent that I just created it does say optional here but I do recommend it it gives you a little bit more settings later on to to modify with so we've selected it now and we'll hit create workflow and so there you go pretty easy to get that going you've already set up vapy workflows setup so this is now connected to the agent that we set up previously and we've got access to a canvas so as you saw there I can now move around I can scroll I can move and what we've got is a really quite a different approach to what you might be used to in terms of just building an agent through prompting we now actually got a bit of a canvas to work with with if you've used a tool like voice flow before which I covered quite a bit on the channel it's going to be a very similar system and a very similar setup for building because it is a canvas display so right at the gate I'm just going to walk through everything to do with building on the vapy workflows platform so on this canvas you'll see that you sort of spawn in with and start a with a start module here start call that's just where the call is initiating from just helps you understand that the next module is a say module so it's the say step this is for communicating any type of message so we want to say something to the user we're going to use this step now if you go down and hover over the step that it provides you with and click on the plus button what it's then going to prompt up is a whole host of other modules that we can use and connect to build obviously a more advanced agent to to do something and so we've got add a step the sa step a condition step gather API request transfer call and end call so pretty much what we're going to be using for the most part is the say condition gather an API request step they're going to be the key ones for creating our conditions our flows Pathways Etc uh and so I'll get back to using them in just a minute but just to demonstrate exactly how this works what we can do is actually just save what we've got at the moment and we can hit start call at the top say hello so right out the gate it's just said say hello uh and the reason it just said say hello is that if we click into our step here what we're using is an exact step so it's just reading out the text exactly as we wrote it now this is very different to how we would do it with any other method where we're just typing a prompt because it's it's not reading a prompt at all it didn't use AI to actually generate its response and so if you are going to be using this for your first message it's going to be incredibly helpful you don't want it to be too different you can just you know obviously have this as your first message but otherwise you can also swap it over to a prompt so if you wanted it to to be prompted you can prompt everything here to you know base on anything you want say hello if we make that switch as well and we do hit the save button and we give it another call it should just say hello so we'll give it a call hello what can I help you with today and so there you go it said hello what can I help you with today it obviously you know went on a little bit more that's what it would do as a prompt and there you go that was that was far better uh in that case and the other thing you may have noticed is that right after that happened so it didn't stay and wait for me to respond if I tried to respond it wouldn't have accepted it and that's because we are we're really stripping back as to what we are you know building here this is not a a single prompt agent we aren't able to communicate through this as it stands because it just ends there is no there's no further steps here and so that just you know hopefully you can really understand that we really are building this entire agent from scratch so to get started in building out our demo for the internet services company what I'm going to do is add a a static first message so we'll use the exact step and I'm just going to type hi this is John from the internet company on a recorded line are you a new or existing customer so we're going to use that as our first message like I said this is an inbound receptionist so I think it's okay for it to have a static first message doesn't need to be prompted and there's also you know a couple of other reasons why you would want to have an exact first message one of them being a lot of the the regulatory aspects as well so mentioning that you are on a recorded line is very critical if you're recording the calls and the other thing will also be mentioning that it's an AI agent so in some jurisdictions whether in the US you're in Australia like me sometimes you do actually have to mention that it's an AI agent I do recommend it as well so we could say hi this is John an AI phone agent from the internet company on a recorded line are you a new or existing customer and so that'll just begin the conversation from there the next step will be to gather some information so we aren't able to just capture information natively we do need to actually you know add in a step to do that it's not just going to happen automatically and so what we can do is add The Gather step and now we can start to add in some values that we want to capture from the previous step and so at the moment we simply want to identify if they're a new or existing customer and base that condition on the input that they've given us so what we can type here is give it a variable or maybe we'll call it customer type and then we want to type in essentially a prompt so so at the moment it's a description for capturing a bit of information we essentially want to type in a prompt to determine two different Pathways which is they're either a new customer or they're going to be an existing customer and so we can just type here this is the type of customer they are either a new or existing customer in the type here we can type enum so we not using a string a string is just like a specific value so that's not going to be helpful a number is a number Boolean is true or false which potentially could work but otherwise we're going to be using enum enum is essentially an AI value so it's just going to evaluate based on the description we've given us based on a series of values we've given it which one it should choose so to make that make more sense you see here we've got enum values enum values is essentially where we're going to be adding in the types of values that we want to be determining so I've got this here new and existing or new or existing so essentially this customer type is only going to be output as new or existing based on the prompt that we've given it and based on the values that we want it to Output we'll set that's the required and hit save and then once we've got that essentially this will no matter what Give us new or existing based on the information the client or the the call is giving us and then what we can do is click on the plus button and add in a condition step and this is really one of the most critical parts of the vapy workflows is that we we can use a condition step to determine multiple different Pathways and so once we've added in that condition step we do need to hover over and click the plus button and then we're going to add in some more steps for what we want to have happen next so we'll just add in some stay modules so we'll add in say based on one condition logic and then what you'll notice is that if you come back to the condition step you can click it again and add in some more logic so we can have multiple different flows occur based on the gather step that occurred previously so we can conditionally add in some logic by clicking on the logic pathway that it automatically generates there's nothing that we can add in in this step as per say but we can add in the logic step and then it says follow this pathway follow this path if all and then we just add some logic conditions and so it's just using all of the gather variables that's that's happened previously so we can go select field customer type and then it can just say equals and then we can just add in literally our values so we've got new right there customer type is equal to new come over here all logic customer type equal to existing and we do just have to add some of these around that so existing and new two different Pathways and so there you go we've conditionally added in a couple of different Pathways based on what the user's input is and we're going down that path so we can then add in some specific text based on on what they've given us so we can just add in a prompt that says greet the new caller to our company that's all we want to do they're a new customer we want to greet them and then we'll add in here welcome back our existing customer and there you go we two prompts welcoming them and greeting them and that's it so basically that should go down two different paths based on the condition that we give it right at the gate so let's test if this works we'll hit save once again and we'll give it a call hi this is John an AI phone agent from the internet company on a recorded line are you a new or existing customer hey John I'm a new customer hi there thanks for calling how can I assist you today so there you go you saw it went down the the pathway there for new customers based on the fact that I said I was a a new customer and there you go you could also see the the the modules being highlighted as it worked down the flow and that worked perfectly that did exactly what we wanted it to so for the next step in this flow let's capture some information so if we want to capture a first name we want to capture an email a phone number all that type of information we can simply do it using pretty much the exact same set of logic to do so so greet the new caller to our company and also ask for their first name we should if there are an existing customer have their first name one thing that we could do is actually run an API request to to find their first name to find their details if you've got them within a CRM system and so that's something that we can do as an API step so we click here we can do API request and we can essentially set up a condition to to look up into the CRM okay this is their phone number they've said they're an existing customer let's try to find some of their information additionally if we were to make this a bit more advanced and something that I won't cover right now but something that you can do is essentially run an automatic detection based on if they're new or existing and so we can look up their phone number we don't even have to ask them and we can actually just find their information and see if they're new or existing before asking them any questions and so very simply that's something that you can just do right out the game running the API requests with the phone number although just to for the purpose of actually going down these two Pathways I haven't done that but that is something that you can do and would work quite well and something that we have done quite a few times with real clients essentially as long as you've got those phone numbers uploaded in CRM you can just do exactly that so we've added in and also ask for their first name now hopefully if that works we'll move on to a gather step which is just going to you know grab that first name one of the the populated values here is for capturing a first name so we can just copy that first name of the customer type string that's completely fine and the output is required save and there you go we should now have the first name captured and we can very simply move on to a a second set of conditions so we can just add in a condition here and this is just going to be for capturing the first name we can either add a condition or we can just read the first name to them so you know ask for their first name collect first name so what I might do instead is actually just capture the first name and then I'm just going to read it back out to them so we'll do the save step and then we can add in variables given that we're doing the save step after a gather step we can insert variables here and you'll see both both these variables are here so in the prompt we could just say say thank insert variable first name for providing their first name or we'll just say name and then we'll want to ask them for some more details about their job request or the you know the requests uh in general so once again this is for an internet services company we just want to capture some information as to why they're calling in so please ask them why they are calling in today and so now let's test this uh let's test this workflow hi this is John an AI phone agent from the internet company on a recorded line are you a new or existing customer hi John I'm a new customer thanks for holding Welcome to our company um may I get your first name please yeah my name is Brandon thanks Brendan what can I help you with today so perfect there you have it it worked exactly as we planned it to read the first message captured that we're a new customer did a nice prompt there to read out to us and and ask for our first name captured the first name and then read it out with a prompt using the variable perfectly as well so once we've said this message right here we can then essentially move on to capturing what they're calling in about and so for this particular flow given that it is a a new customer we're going to be tailoring it for that specifically and so we could just type customer inquiry and we type this is the type of inquiry the customer is calling for and then we'll just go to enum once again and so there's a few different you know values that are going to be associated with new customer inquiries so this could to be an account issue they're trying to sign up for an account they don't know how to sign up for an account all stuff like that we'll do through an account issue so then for these enum values one of the values we might do is register so this is for new customers obviously this particular flow and one of the things they may want to do is simply register so we'll have a register flow for doing that another flow we might add is just for questions so if they've just got questions we can do that so they want to register they've got questions so just for now I'm just going to do register and questions as our two Pathways we'll set the output as required and hit save we then once again come down to adding in a new condition step we'll then add in brand new Logic for this so one step here come back and add in another save step I'm going to be going down two different paths essentially based on the info previously in this step so once we've created two brand new flows we can now edit the logic so all of the following conditions match add logic select field customer inquiry and then we're going to do equals and we're going to add in here we're going to type in register and then for the other logic step we're going to add in same thing customer inquiry equals and we're just going to do questions and there you go there the two Pathways that we set come back here register questions and now one thing that we may also want to do is add a little bit more prompting so it doesn't have a whole hi of context as to when to assign register or the questions value so what we could say is assign the value regist register when the user would like to sign up for an account with us and then we can say assign the value and maybe we just add this questions when the user has any general questions about our services and we'll just hit update that'll make it a bit better obviously as we start to build this and scale this you will want to obviously focus in on those prompts and and make them far better and make them actually work but you know we'll see what happens in this case make sure the logic's there for register add in a brand new prompt or we just say thank them for their interest in our services and then pretty much you know we can go down that flow whatever we'll just do that for now and then we can add in a prompt and we can just say thank or we can simply just say ask the user what their question is hi this is John an AI phone agent from the internet company on a recorded line are you a new or existing customer I'm a new customer hello thanks for calling what's your your first name Brendan thanks Brendan what can I help you with today I just wanted to know what your prices were got it what's your question and then for our second step here just for the instruction what we can type is answer the users's question or what we can say is if the user has provided a question please answer it otherwise please ask them to provide a question so pretty much we're adding in some logic here at this step we've just asked them you know please ask them why they're calling in today so we're just going to ask them you know why you're calling in today and it's likely that they're just going to say their question you know at this part of the step and so at the moment we actually have no way of bringing the context from this save step over to this step so pretty much as it stands it's just going to ask them okay you know what was your question after you've just said your question and so it's you not natural it's a bit awkward and it's not the best you know way to go about it so what we can do and what we will do we can go into the gather step and actually add multiple multiple outputs and so you know we've gaed the customer quiries variable here but we can also add in you know a brand new flow here as well so pretty much we just want to get a of what they've just said or we can just capture their request so I can just call this request this is what the user has requested set it as a string output is required and hit save and then now we've got their inquiry type and then we've got their request in general and then we can just add that in as a variable here so what we're going actually type is do a little bit more prompt engineering so we just type user question insert variable request it's gone down there grab this Quest delete that and then yeah if the user has provided a question please answer it otherwise please ask them to provide a question and so now that's going to be a bit more Dynamic should be a bit smoother and we'll give that a test run hi this is John an AI phone agent from the internet company on a recorded line are you a new or existing customer hey I'm a new customer hello thanks for calling what's your first name Brandon great thanks Brendan hey I was just wondering uh what some of your prices were sure could you specify which Services you're interested in so I can give you the right pricing details so as you can see there that did bring through the context uh last in the last step there from this step as you may have noticed it wasn't the best in reading out the secondary question here so it thanked them for or it thanked me for providing my name but it didn't actually ask me uh to actually provide but didn't actually ask me to provide why I was calling in so this is you know very simply just a prompt issue uh it you know we need to just do some more prompting as to not please ask them but pretty much you must ask them uh why they're calling in today and then you know hopefully if it reads it out it's a bit more natural but as you can see the main thing was that it brought through context through there and it was able to you know seemed natural it didn't seem like it was jumping between steps it just followed on from the last step and so that's really the best way to bring through context is to do a sort of a summary with a with a string well now I'll just go on and I'll just continue on this step here so thank them for their interest in our services so this is based on the condition that someone's interested in registering and so just to to really get you up to speed as to you know how to build these agents in in the workflow Builder I want to do sort of like a mock API request sending some information to me. com and so just show you exactly how to do it same sort of process as to the traditional vapy Builder and some of the other you know web hook systems pretty much all we're going to do is is capture some information using the gather step and then we'll do an API request to send that information off and I'll show you exactly how to do that as well so we'll just start off we'll delete this module thank them for the interest in our services and then what we can very simply do is just ask them to provide some more details so thank them for their interest please ask them to provide their email and we can help sign them up for an account then we'll move on gather step now we're going to specify an email this is the email of the user type we can do string outputs required save and so we're going to say thank you for the interest ask provide the email and we'll help them sign up for an account do that we'll then do an API request and we're going to send this off so we'll add in The Gather step collect the email this is the email of the user got the string outputs required hit the plus button add in an API request it's very very similar to how we've done it you know previously with other builds all we're doing is then sending information off to any endpoint that we want to so I'm going to jump over to make.
com this is a blank ma. com scenario and what we can do is use the workbooks module to to generate an endpoint to receive information so I've just created this one here it's very simple to do just click on the create button give it a name and it automatically generates a URL for you we hit copy address to clipboard and we can very simply just paste it in the URL at the top here and so now it's connected that's all you need to do make sure it's a post request cuz we are going to be posting off information and then all we need to do is click on the tab here I'm just going to add in a key called email the value is going to be VI variable email cuz we want to send the email that we just captured and we don't even need to we don't need to modify description or or type or anything like that we can just hit save and that is it that's all we need to do AP request is set up we can hit save coming over here we can also you know hit run once so it'll start to listen for information so we can give it a test and and see if that works hi this is John an AI phone agent from the internet company on a recorded line are you a new or existing customer hey John I'm a new customer hi there thanks for calling what's your first name Brendan thanks Brendan what can I help you with today I was looking to sign up for a new account what specifically would you like assistance with for your account registration just making it that's all thanks for your interest in our services could you provide your email address I can help you get signed up for an account Brendan inflate. agency so there you have it the flow works perfectly went through and did everything we needed it to and as you can see here on m.
com we' just received a value for our email that has come through so value email and then obviously the email that I just gave it captured that perfectly as well and there you go we're able to send an aiqu is as easy as that so really simple to do information comes here and then what you could do is anything you want it's m.