Beginner's Guide to Workflow Evaluation in n8n (Stop Guessing!) — Transcript
Full transcript
- 0:00Today we're going to talk about
- 0:01something pretty boring but super super
- 0:03important and that is workflow
- 0:04evaluation. So I'm going to start off by
- 0:06talking about what it is and how it
- 0:07works. Then we're going to get into NADN
- 0:09and I'm going to show you guys me
- 0:11actually running some evaluations. So
- 0:12let's get started. All right. Like I
- 0:14said today we're talking about AI
- 0:15workflow evaluation and specifically
- 0:17within NAND. I thought it would first
- 0:19make sense to talk about what is
- 0:20evaluation. In my mind the simplest way
- 0:22to put it is validating your hypothesis
- 0:25with objective proof. Think back to when
- 0:27you were building an AI agent or
- 0:28workflow and you weren't happy with the
- 0:30results. What you do is you think about,
- 0:32okay, if I do X, it's going to make the
- 0:35output better. And so that's your
- 0:37hypothesis. You go ahead and you make
- 0:39that change, you run it again, and you
- 0:40basically subjectively judge, is it
- 0:42better or worse. But by running
- 0:44evaluations, we can actually see data
- 0:46and we can see proof if your change
- 0:48validates your hypothesis or not. So now
- 0:51that we all are on the same page about
- 0:52what evaluation means, let's start to
- 0:54look at how this would actually work in
- 0:55NADN. So for this example, what we're
- 0:58looking at is a tagging agent. It will
- 1:00receive an email. It will look at the
- 1:02subject and the body and it will use its
- 1:04AI brain to basically tag the category
- 1:06and priority of an email and then do
- 1:09whatever it has to do later. And so what
- 1:11we're looking at here is a test data set
- 1:13where we say, "Okay, here are six really
- 1:15good examples of an email that came in
- 1:17and where they should be categorized and
- 1:19marked as far as priority goes." So what
- 1:22we would do in our evaluation is we
- 1:24would feed through these six inputs and
- 1:26we would basically validate are they
- 1:27answering the expected category and
- 1:29expected priority correctly. And when we
- 1:31run these through an evaluation, we can
- 1:33actually see each of those six test
- 1:35cases and we can look at how many tokens
- 1:37were consumed, how long it took in, you
- 1:39know, time. And then we can see if the
- 1:41priority or category was right or wrong.
- 1:43And then because we're able to identify
- 1:45patterns like, you know, maybe when it's
- 1:47shipping inquiry, it's actually being
- 1:48labeled as support or something like
- 1:50that. We can go ahead and use that data
- 1:52of what is actually happening to go
- 1:54ahead and fix the prompt. And then we
- 1:56fix the prompt, run it through again,
- 1:57and we see if we get a higher accuracy
- 1:59score. So, in a couple minutes, we're
- 2:00going to hop into noden and actually
- 2:02look at this exact example. But real
- 2:04quick, I wanted to get some of the more
- 2:05boring stuff out of the way real quick,
- 2:07which is just kind of laying a good
- 2:08foundation about the mindset of AI
- 2:10workflow evaluation. So, evaluation has
- 2:12been around for a long time. But why is
- 2:14AI workflow evaluation fundamentally
- 2:16different than code evaluation or other
- 2:18projects? Because AI LLMs are kind of
- 2:22known as a black box because we don't
- 2:24know exactly what is going on and how it
- 2:26gets to its end result. Meaning, if you
- 2:29put in a hundred of the exact same
- 2:30inputs, you'd likely get a hundred
- 2:32different variations of outputs.
- 2:34Whereas, in a traditional workflow with
- 2:35no AI or a code script, you could put in
- 2:39a 100 of the same inputs, and you should
- 2:40get a 100 of the same outputs. We also
- 2:42have the probabilistic nature. Output is
- 2:44shaped by probability, temperature, and
- 2:46context. And there's so many different
- 2:47levers that we can pull to train the way
- 2:50the AI actually behaves. We also have
- 2:51evolving models. As new ones come out,
- 2:53if they're cheaper and faster, and
- 2:55people say they're the best, you're
- 2:56going to switch it out. But does that
- 2:57new model actually increase the
- 2:59performance of your workflow or not? And
- 3:01there's other things that we want to
- 3:02optimize for beyond just accuracy and
- 3:04consistency. We also have stuff like
- 3:06bias and cost and time. So because
- 3:09there's so much to take a look at,
- 3:10there's a lot of noise. The key metrics
- 3:12to really be thinking about when you are
- 3:14running evaluations and you want to
- 3:15track would be performance, reliability,
- 3:18efficiency, and quality. And by the way,
- 3:21I'll have these slides in my free school
- 3:22community. The link for that will be
- 3:24down in the description. You can
- 3:25download that and you can also get the
- 3:26two workflows we're going to look at. So
- 3:28you can get all the resources shown in
- 3:29this video in the free school just in
- 3:31case you thought I was going a little
- 3:32too fast. And now moving on to something
- 3:33that is probably the most important part
- 3:35of evaluations. Well, second most the
- 3:37most important thing we'll talk about at
- 3:38the end, but the second most important
- 3:40thing is being able to isolate variables
- 3:42to actually understand what's going on.
- 3:44I don't know how long you guys have been
- 3:45watching my channel, but something I've
- 3:46talked about before is reactively
- 3:48prompting your AI agents. Meaning, if
- 3:51you aren't happy with the output of your
- 3:52agent, you want to change one thing in
- 3:54the prompt at a time rather than if you
- 3:56get in there and you add like two
- 3:57paragraphs and all of a sudden your
- 3:59agent's performing horribly, you don't
- 4:00know where in the two paragraphs you
- 4:03broke the agent. Or on the other side of
- 4:05things, if it makes it better, you don't
- 4:07know what specifically made it better.
- 4:08And this is honestly even more important
- 4:10when you're doing evaluations because
- 4:11let's say you're getting, you know, 70%
- 4:13accuracy and then you change the prompt
- 4:15and the tools and the chat model and all
- 4:18of a sudden you're getting 85% accuracy.
- 4:20You don't know which one of those had
- 4:22the the most effect on the actual
- 4:24increase in performance. So what you
- 4:26need to do is treat it as a scientific
- 4:28experiment to validate your hypothesis.
- 4:30Change one thing at a time, whatever
- 4:32that is. Keep all of the test conditions
- 4:34consistent. So keep all of the variables
- 4:37not variable, keep them consistent and
- 4:39only change one thing at a time and
- 4:40document what changed, why you changed
- 4:43it, and what the actual result was. This
- 4:45allows you to actually test different
- 4:47things and optimize for the best model
- 4:49possible. Common variables that you
- 4:50should change and test different things
- 4:52would be the prompt wording would be the
- 4:54actual LLM itself, and then within the
- 4:56LLM, you have different things like
- 4:57temperature, top P, all this kind of
- 4:59stuff. The workflow design and data
- 5:01prep-processing methods. So in other
- 5:03words, kind of the context that is being
- 5:05fed to the agent or to the AI before it
- 5:07does its action. And now this is the
- 5:10most important part of an evaluation is
- 5:12the data set. The purpose of your
- 5:14evaluation data set is that it has to be
- 5:16the ground truth. This is basically what
- 5:18we're training our AI workflow to
- 5:20perform like. So it has to be good. And
- 5:23what does good data look like? It's
- 5:25accurate, obviously. It's consistent.
- 5:27It's comprehensive and representative of
- 5:29lots of different scenarios that may go
- 5:31through the system. It covers edge cases
- 5:33and it has to be large enough for
- 5:35statistical significance to have
- 5:37confidence in it. And some examples of
- 5:38where you could get this type of data
- 5:40would be historical high-quality
- 5:42tickets, expert responses, high
- 5:44performing marketing content, and
- 5:46ultimately you're probably going to have
- 5:47to work with the subject matter expert
- 5:49of whoever was manually doing the
- 5:50process beforehand or overseeing the
- 5:52manual process. They are the ones that
- 5:54should be able to provide you with all
- 5:56of that good data. So, for example, if
- 5:57you're building a system to make
- 5:59LinkedIn posts, you would want to go
- 6:00grab all of the best performing LinkedIn
- 6:03posts and use those as data that you
- 6:05want the AI workflow to consistently
- 6:07output stuff like those posts. And last
- 6:10slide here, then we're hopping into
- 6:11NAND. Why data is the core of success?
- 6:13Well, it's pretty obvious. Good data
- 6:15would be, you know, good good
- 6:17evaluation, good AI behavior. Bad data
- 6:19is you're literally just training the
- 6:21LLM to be worse. It would be like every
- 6:23time you know a kid cusses, you just
- 6:26start laughing and you give them a
- 6:27cookie and you say good job. That's just
- 6:29like not the way you should do it. And
- 6:31anyways, when you think about size,
- 6:33ultimately more data the better, unless
- 6:36it's bad data. But if you start small
- 6:38and you're trying to get some early
- 6:39testing, 50 to 100 examples is good. I'm
- 6:42not going to do 50 examples today. I'm
- 6:43going to do like six or 10. But just I
- 6:45wanted to throw this out there to show
- 6:46you that you need more than just 10.
- 6:48When you really are starting to think
- 6:49about pushing this into production
- 6:51readiness, you want to have upwards of
- 6:53250 to 750 examples where you can
- 6:55actually get statistical significance
- 6:57and cover a wide range of scenarios.
- 6:59Now, take this with a grain of salt
- 7:00because the amount of examples you need
- 7:02definitely depends on the actual system
- 7:04and the variety of inputs it could
- 7:06receive, but just kind of rough ballpark
- 7:08figures. And then mission critical
- 7:10high-risisk systems, you want to go
- 7:11above a thousand. Get as much data as
- 7:13you can truly. Um, something else to
- 7:15think about is if you were to think
- 7:17about right now I need to source a
- 7:18thousand examples. That would kind of
- 7:20suck. But if you're thinking about
- 7:22getting good data and collecting data
- 7:23over months so that when you're ready to
- 7:25test the system, you have it, that's
- 7:27going to obviously make the workload
- 7:29less. But also when you do that, you're
- 7:31collecting data, like I said, over
- 7:33months. So you're not just grabbing, you
- 7:34know, all the data from the past week or
- 7:36something where that wouldn't be as
- 7:38holistic as when the system is actually
- 7:40going to be in production and facing
- 7:41this type of real stuff. All right. All
- 7:43right, so now we're actually in Nitn and
- 7:44we're going to look at how we do an
- 7:46evaluation flow. So I know this workflow
- 7:48may look intimidating like right off the
- 7:50bat because there's so many different
- 7:51nodes. These are all of the new
- 7:53evaluation nodes in Nitn and I'm going
- 7:54to explain exactly how they work. So if
- 7:56you were to come into here and type
- 7:57evaluation, you can see there's four new
- 7:59nodes. We have the trigger which is over
- 8:01here. We have check if evaluating. We
- 8:04have set metrics and we have set
- 8:06outputs. So what happens is when we do
- 8:09this trigger, it's going to pull in our
- 8:11data set, which in this case, we're
- 8:13going to use this data set of six
- 8:14examples with our expected category and
- 8:16our expected priority. So it's going to
- 8:18pull in those examples. It's going to
- 8:21feed them through the AI model, which is
- 8:22supposed to tag them, you know, the
- 8:24different categories and the priority.
- 8:25It's going to check if we're evaluating
- 8:27or not because you could still have a
- 8:28typical flow. So, if a Gmail came in, it
- 8:31would go down the normal branch and you
- 8:33could set the logic. But if you're
- 8:34evaluating, it'll go up here, set
- 8:36outputs, which just means it's going to
- 8:38write the AI's answers back into the
- 8:40Google sheet and then it will set the
- 8:42category and the priority, which we will
- 8:43be able to check in the evaluations tab.
- 8:45So, just to show you guys how that
- 8:47looks, I'm going to do one run through
- 8:49here and then we're going to actually do
- 8:50the evaluation. So, just to pull in the
- 8:52data set, it's going to pull in the
- 8:54first row. The AI is going to tag it.
- 8:57It's going to go up the evaluation
- 8:58branch and then it's going to write the
- 8:59outputs back to the Google sheet. I'm
- 9:03just going to stop this real quick. And
- 9:04then it would have set the category and
- 9:05priority. So if I go into our data set,
- 9:08you can see that that first run it got
- 9:10the category wrong because it was
- 9:12billing issue rather than billing. And
- 9:14the priority was right. And so obviously
- 9:16this is just a mistake of like wording.
- 9:18And the reason it did that is because
- 9:20this AI agent has no system prompt. So
- 9:23just wanted to show you guys like a very
- 9:24very rough baseline of how this works.
- 9:26I'm going to clear this out. And what
- 9:29we're going to do is check what chat
- 9:31model we're using. We're using 4.1 mini.
- 9:33And then I'm going to go to evaluations
- 9:35and just hit run test. And so this is
- 9:37basically going to send those six
- 9:40different items in our data set through
- 9:42this model. It's going to collect an
- 9:44average of how many tokens were used um
- 9:47prompts total and then also how long it
- 9:50took. And then it's going to give us an
- 9:51average of the priority and category
- 9:54score correctness. So, looks like that
- 9:56already finished up. If I clicked into
- 9:57it, you can see it processed all six.
- 9:59And you can see which ones, you know,
- 10:01were right and which ones weren't. And
- 10:03so, let me just go back to the actual
- 10:04execution. You can see that we got 67%
- 10:08of priority correct, but 0% of category
- 10:11correct. We could also look at different
- 10:13figures over here, of course, like our
- 10:14time and how much it costed us, but this
- 10:16is mainly what I'm focused on right now.
- 10:18And so, you would see this and you'd go
- 10:19into your sheet and you'd see, okay, all
- 10:21of these categories are wrong. What we
- 10:23could do is work in a quick fix in the
- 10:25prompt because it seems like it's just
- 10:27messing up because it doesn't know the
- 10:29actual words. So, what I'm going to do
- 10:30is just copy these words right there.
- 10:33I'm going to go back into our workflow
- 10:34into the editor and I'm just going to
- 10:36add a really quick system prompt into
- 10:37the agent where I am just going to say
- 10:41here are the categories to choose from.
- 10:46And I'm just going to paste those in
- 10:47like that. I think this alone will make
- 10:50it much more accurate. So, we're just
- 10:52going to go to evaluations. I'm going to
- 10:53hit run test once again. It's going to
- 10:55pull in that same data set and it will
- 10:56overwrite whatever already exists in
- 10:58here. And you can see it already got
- 10:59that first category right. It just got
- 11:01the second category right. Got the third
- 11:03one right. It got the fourth one right.
- 11:05And I'm assuming it's going to be 100%
- 11:07accuracy on category. But then we're
- 11:09still messing up on the priority score.
- 11:11So, it just finished up. We can see the
- 11:12evaluation now. We got 100% correctness
- 11:16in the category. We got 67% correctness
- 11:19in the priority. And now we would just
- 11:21be able to keep making one tweak at a
- 11:22time and know exactly why what we're
- 11:25doing is working. And so yes, you have
- 11:27this data here, but what you don't see
- 11:28is you don't see what you changed unless
- 11:30you clicked into it and looked on all
- 11:32the executions. So what I would
- 11:33recommend is when you start running
- 11:35these evaluations, you would maybe in
- 11:37your data set have another tab where you
- 11:39could say run number one, what did I
- 11:42change? And then what were the results?
- 11:44And then you can just basically keep
- 11:45stacking all those runs and evaluations
- 11:47to see which ones gave you the best
- 11:49scores. So, I hope you guys can see how
- 11:50this would be really helpful in creating
- 11:52a workflow and then basically deciding,
- 11:54okay, well, which model do I want to
- 11:55use. You just test like five of them,
- 11:57see which ones have the best accuracy
- 11:58and we're also the cheapest. And boom. I
- 12:01don't want this video to go too long, so
- 12:02I won't really dive into what's actually
- 12:04going on here. But basically, in these
- 12:06metrics, I'm just setting it as what the
- 12:08expected answer is, what the actual
- 12:10answer was, and then that's how it
- 12:12outputs either one or zero if it was
- 12:14correct or incorrect. But what you can
- 12:16see here is that there's lots of other
- 12:18metrics. We just did categorization
- 12:20which means explicitly do these two
- 12:22things match but what we want to do is
- 12:24sometimes we need to use like
- 12:25correctness or similarity or helpfulness
- 12:28and that's where you actually need to
- 12:30use AI to judge the correctness or
- 12:32similarity. So this next example that
- 12:34we're going to look at this one actually
- 12:36uses AI to evaluate. So similar type of
- 12:39scenario we have a agent that's going to
- 12:42read an email. it will look up in its
- 12:44vector database FAQs and policies to
- 12:47answer that email and then it would
- 12:49respond back to them. So what we're
- 12:50going to do is we're going to look at
- 12:51this second data set that has subject
- 12:54and body. It has expected answers and
- 12:56then we're going to get the actual
- 12:58answer evaluated on how close it is to
- 13:01these expected answers. And so before I
- 13:03actually kick this off, I wanted to show
- 13:04you guys one thing real quick because
- 13:06what you can do is use the actual set
- 13:10metrics node to do AI based correctness
- 13:13and it will give you this full prompt
- 13:15about like basically you have your
- 13:16expected answer and you have your actual
- 13:18answer and it will output a score one
- 13:20through five over how correct it is. But
- 13:23right now I'm sure by the time
- 13:25everyone's watching this it'll be fixed.
- 13:26This node is basically broken and it was
- 13:29giving me these errors. Let me just show
- 13:30you guys. it was giving me these errors
- 13:32where it would say the settrics node is
- 13:33not configured properly even though I
- 13:35knew it was. So all I did is I took this
- 13:38system prompt and I basically fed it
- 13:40into this agent where I'm giving it now
- 13:41the expected answer, the actual answer
- 13:43and the exact same system prompt. So
- 13:45it's really the same exact thing going
- 13:47on and then I'm just passing it into a
- 13:49different metric setter. And I know this
- 13:51all may seem a little confusing. Just
- 13:52watch how this plays out. You can
- 13:54download all of these workflows I'm
- 13:55showing you today and my set example
- 13:57data sets from the free school community
- 14:00if you want to play with it yourself.
- 14:01That'll probably be a better way to
- 14:02actually understand what each node's
- 14:03doing. But I just wanted to show you
- 14:05guys this little workaround because this
- 14:07node wasn't actually working. And you
- 14:08know how we talked about keeping things
- 14:09consistent? I know some people may say
- 14:11like, "Hey, but you're using an AI model
- 14:13to evaluate blah blah blah." All you
- 14:15have to make sure is that you keep this
- 14:17AI model the same every single time.
- 14:19That's where you'd run into trouble is
- 14:20if you were changing like the prompt,
- 14:22but you were also changing the model
- 14:23that you use to evaluate. So, as long as
- 14:25you keep this consistent, I'm not going
- 14:27to be concerned at all that we're using
- 14:28AI to evaluate. If you watched my GBT
- 14:31video, you may have seen a preview of me
- 14:33actually doing this. I was testing GBT5
- 14:35and GBT5 mini and stuff like that. So,
- 14:37this first run, we're going to do GBT
- 14:39Mini. I'm just going to go to
- 14:40evaluations, hit run test, and we'll let
- 14:43this finish up real quick, and then I'll
- 14:45show you guys what we're looking at.
- 14:46Okay, so this run just finished up.
- 14:48Looks like we had an accuracy of 3.5 out
- 14:51of five. We can click into the run and
- 14:53we can see individually each of the
- 14:55runs. Like we can see number three was
- 14:56not accurate at all, but the first one
- 14:58was super accurate. And what's nice is
- 15:00we can see like over time if our
- 15:02workflows gotten better or worse. But
- 15:03keep in mind this doesn't really show us
- 15:05what was changed on each one. So it's
- 15:06still very important to track on your
- 15:08own in like a Google sheet or something.
- 15:10But let's say for some reason we were
- 15:12not happy about how long this took. So,
- 15:14we have an hypothesis that if I use
- 15:15Google Flash, it will finish a lot
- 15:17quicker. So, in order to validate that,
- 15:19I would just go into the editor. I'd
- 15:21come in here and I would just want to go
- 15:22to some sort of flash model. So, we'll
- 15:25do 2.5 Flash. We'll save that. Go back
- 15:28into evaluations. And now we're just
- 15:29going to run another test. So, the
- 15:31hypothesis is that flash is going to be
- 15:33cheaper and hopefully more accurate, but
- 15:34we don't actually know. So, now we are
- 15:36going to Oh, and faster. That's the
- 15:38whole reason I said it in the first
- 15:39place. So now I'm going to let this
- 15:41finish up and we'll compare the
- 15:42execution time and the accuracy. Okay,
- 15:44so that just finished up and I'm
- 15:46actually really impressed. It got 4.3 on
- 15:48the accuracy, so much higher than GPD 5
- 15:50Mini and I know for a fact it was
- 15:53cheaper and it was about half the time.
- 15:56So I don't think speed alone in this use
- 15:58case justifies making the switch. But
- 16:01because the accuracy was8
- 16:03higher, which is pretty significant,
- 16:05then that makes this one a no-brainer.
- 16:07But we were able to objectively see that
- 16:09rather than just having a hunch.
- 16:11Anyways, I hope that this video has been
- 16:13helpful and showed you how you can use
- 16:14this evaluation feature for not just
- 16:17like categorization metrics, but also
- 16:19for accuracy metrics and stuff like
- 16:20that. You'll be able to download this
- 16:22workflow, this workflow, as well as the
- 16:24two different sets of test data right
- 16:27here that we saw in the video. You'll be
- 16:29able to make a copy of all of the stuff
- 16:30and download all of it for free, as well
- 16:32as the actual slides that we were
- 16:33looking at earlier, too. All you got to
- 16:34do is go to my free school community.
- 16:36The link for that will be down in the
- 16:37description. And once you get in here,
- 16:39just go to YouTube resources and you'll
- 16:41be able to find this YouTube video or
- 16:43you can search for the title of it.
- 16:44It'll be in here, I promise. And then
- 16:46all of the resources will be pretty much
- 16:48in that post associated with this video.
- 16:50And if you want to dive deeper with
- 16:51Ended, then I definitely recommend to
- 16:53check out my plus community. The link
- 16:54for that will also be down in the
- 16:55description. We've got a great community
- 16:56of members who are always sharing what
- 16:58they're doing and what they're building
- 16:59with Enit, sharing their challenges,
- 17:01sharing helpful resources. We've also
- 17:02got a classroom section with two full
- 17:04courses right now. One is agent zero,
- 17:06the foundations of AI, and then 10 hours
- 17:08and 10 seconds where you learn how to
- 17:10identify, design, and build time-saving
- 17:12automations. So, I'd love to see you
- 17:13guys in these communities, but that's
- 17:15going to do it for today. If you enjoyed
- 17:16the video or you learned something new,
- 17:18please give it a like. It definitely
- 17:18helps me out a ton. And as always, I
- 17:20appreciate you guys making it to the end
- 17:22of the video. I'll see you on the next
- 17:23one. Thanks guys.
About this transcript
This page contains the full transcript of Beginner's Guide to Workflow Evaluation in n8n (Stop Guessing!) by Nate Herk | AI Automation, generated from the public captions YouTube serves with the video. The transcript has 4,016 words across 555 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.