Notion Workers – Full Tutorial 2026

#Notion Workers #AI-powered Automation #No-Code Development #Data Synchronization #Notion AI Agents #Workflow Automation #Programming
💬 Chat with this Video
Ask anything about this video…
Learn the revolutionary potential of notion workers. This course provides a comprehensive guide on how to leverage this powerful feature to automate tasks, connect external data, and build complex business logic within your workspace. By the end, you'll have successfully deployed your own custom workers, regardless of your programming background. Notion recently released one of its biggest updates ever, but very few people can actually use it. I am talking about workers. Basically, workers are the missing puzzle piece in notion. They allow you to do practically anything. Bring data from external applications into notion. Sure. Build complex business logic and codify kind of any workflow that you need. No problem. But there's one issue. You need code. Now, in 2026, that of course doesn't mean you can't use them if you're not an engineer. That's exactly what this video is for. Over the next few minutes, we will go over everything you need from why workers matter to how to set up your notion for workers all the way to of course building your actual first worker. And I'll promise you, even if you've never touched a line of code and also haven't used AI to create code, by the end of this video, you will have not one but three workers shipped. It's an interactive one, right? So, we have also a workbook to go along and exercises so you can follow along and yeah, just do the thing. Since this is a bit of a longer one, we've separated into five big chapters to make it easier to follow along. First, why workers matter, right? bit of a look behind the scenes and where in your business you might want to use them. Second, the general setup that you need to do both in notion and on your machine to be ready to build your first workers. And then number three, worker walk. So let's start with chapter one why. In terms of the why, it's basically giving notion superpowers, right? If you wanted to do it in one sentence. And with superpowers, I mean that while notion is an amazing tool, right, to build custom systems for your team, there are kind of like three typical use cases where you will run into, you know, limitations with notion. The first one is you need to get external data into notion. Say you have an external CRM and need to pull it in or Google calendar in your meetings should show up in notion or it's a personal use case, right? and you want to get the data from your ring, right? Or like any kind of health metrics into it. No matter what, you have data outside of notion, you get it need to get it into it. If you're lucky, notion has a pre-built connector, but even if they have it, like for example for Jira, right, it might not do what you need it to do. So that's kind of area one where you run into limits. Area two is the opposite one, right? And so like here, the third one, it's sort of pushing data out, right? Maybe you have your information in notion, but it needs to be elsewhere, right? You want to publish a page to WordPress. You want to sync something to your newsletter tool, right? Or you want to push updates to Slack. Again, the idea very often is, right, that notion is this central hub in your workflow. There's a bunch of tools still around. It means you have data flow in and data flow out. And then the third aspect is within notion or within notion the hub and that means running complex workflows where the business logic of notion's default setup is just not there. Sure, we have built and automations, we have buttons, we have things to do like simple logic steps. But when it comes to complex stuff, for example, let's say, hey, whenever I create this type of a project, check our processes, figure out what's the current list of tasks for this type of project, create them and assign them to the right responsible person. Right? This kind of complex business logic can't be, you know, easily done within notion. And up until basically workers, the answer to all of this was well, we need an external system. We need external often no code tools to close the gap. That's why we need workers, right? They fill this same need. Getting external data in, getting data out of notion and creating complex business logic. Now, to be fully honest, when notion workers first came out in early alpha, um now months ago, um I looked at it and I was like, "Okay, this is super cool, but I don't quite know where I would use it yet." And the problem was this old story, right? If that if you have a hammer, everything looks like an A. So, I was looking at this and I was like, well, okay, all these three areas, right, where workers are great. I have no code tools to do this, right? Why do I need a worker? And it's true, right? the ven diagram of worker can do something notion uh sort of no code true can something right that's pretty much a perfect overlap to a to a certain degree but the actual question is around right it's like why would you ever bother with no code tools if you can create a worker for it to be honest I think no code tools are dead there's no reason for them anymore with few exceptions that I just wrote a LinkedIn p like a newsletter and blog post on that link below But the TLDDR is like why do we have no code tools? It's so we can very fast deliver solutions. Um it's much cheaper than traditional software to develop and um you kind of like have this like way for like non-engineers to do it. All three of these statements are no longer true uh due to AI, right? With the right AI workflows, it's very much possible to create code faster than you could manually click together a make or n word flow. It's also because of that, right, much cheaper to do it that way. And if you particularly use notion, right, to host it, you can execute much more complex logic where it would be really expensive to do this with like a hosted solution with make or with nad. And then of course, right, this like accessibility, that's what this tutorial is for, right? I promise you, even if you have no idea of coding, by the end of it, you're going to have your first workers deployed, showing, right, that you don't need to learn a no code tool anymore. You're simply going to need the learn the principles of, you know, building these systems and you can go ahead and do it with the help of AI. Now, in order to get started, we basically need two things. You need either the clawed app or codeex installed. And I'm going to link to both of those below. Uh you can also use cloud code of course in your terminal, but if you're a beginner, right, I highly recommend you either start with um one or you start with one of these two apps because they just make it a bit easier and more accessible. So download that. Step number two, go into your uh finder, right, or your your general folder and on the top level of that folder, right? So in your user, uh create a new top level folder that you can call either claude or codeex, right? depending on which of those two tools you use. That's it for now, right? That's where inside of it, we're then going to go and build like our different workers. But just like top level folder, app downloaded. And then we want to install the notion developer tools. Now, we're going to go in and this is also linked below in the description and the companion post for this, but basically there's one specific command that you want to run in order to install um the notion CLI. And the notion CLI is just a way for you to authorize and connect to notion because when we're building workers, right, we're not doing this in the notion interface. We're doing this through code and through our code. Why do we need to tell notion, hey, we're actually allowed to do this. So that's basically what we're preparing here, right? Installing these developer tools. You can do this in two ways, and I'm going to show you in a second. You can either go and open the terminal on your machine, right? And simply type in this command, right? copy that command in and hit enter or you can just ask right cla or codeex in the app and that's what we're going to do in a moment to install this for you right super easy so yeah just like as a quick heads up now make sure you install this and then let's jump right in and take a look at it after publishing the initial version of this tutorial I got some feedback that we forgot some helper setup steps so just a quick insertion here if this is the very very first time that you use your machine for any kind of you know code work. There might be two additional setup steps that you need to take and they depend a bit on which machine you're on. I'm always on Mac OS so apologies that Windows part is a bit shorter but basically on Mac OS you probably want to uh add the command line tools um again you can simply ask claw code or codeex and we go through that in a moment right to do that for you but you also see the command here on screen and for windows it's a little bit more involved because a lot of the notion tools most notably the command line that we're going to install in a moment they are currently as of the release of this video only available for Mac OS and Linux. So you can directly run them in Windows. Luckily there is a workaround. It's called WSL. Uh basically creates a small Linux environment inside your Windows where you can run all these things in. Again, right, you can simply ask uh your AI tool of choice uh and you know tell it, hey, we need this also to run it. It's probably going to figure it out on its own to be honest, but still better if you can give it a bit of guidance here. And then we also need NodeJS which is a way for your machine to run JavaScript which is very relevant because a lot of the stuff that we are going to use is built on top of that. Again happening all behind the scenes. Uh and you can simply ask your AI tool of choice uh to install it. Right? We're going back to the regular tutorial in a moment there. You'll see then you know just how to interact with um either claude code or codeex to ask it to do these things. Just remember right before we dive into it um ask it on uh on Apple right to get you um the command line tools and NOJS and if you're on Windows ask it to get you know WSL and then NodeJS so that everything runs smoothly starting with claw code if you have the claw app installed and open it you can in the settings right switch away from chat or co you want to move all the way over to code. Uh this is one of my many Mac subscriptions that are running in parallel. And then here, right, just to talk quickly about the interface. Basically, here's where you're going to like just chat with the tool. Then here you can add a folder. So you want to make sure that you click on plus to add another folder and pick this top level folder, right, that you just created in the previous step. On the on this side, right, you can see what model are you using, right? So in general, you want to use Opus 4.7. Depending on how quickly you burn through your usage, right? You want might want to like reduce it from extra high to high. But let's assume you're not working too much. So, I like to keep it on extra high if we can. Don't enable fast mode. It burns through credits a lot faster. So, you you want to avoid that. Uh and then um here on the bottom left, right, is another thing to know about is sort of like auto, right? So when it comes to clawed code since it has control over your machine and can store things right it's the question of like you know like do you want it to do that automatically or should it ask for permissions now to be honest nine out of 10 times I run mine in bypass permissions which basically means it's not going to ask anything the reason for that being is that um I am still learning coding concepts right so Claude will know a lot better so the chances of me catching a problematic uh thing right are quite low. So a lot of the work comes into our planning and making sure we explain C cloud exactly what we want it to do. Um on auto mode, right, it's not going to uh do as much. It's going to ask you for permissions more often. So it's a good idea to start on sort of ask permission, get a feeling for what kind of things it typically wants from you. And if you feel like, hey, I can never, you know, review this anyway. I just keep pressing accept, except accept, then you can move on. For now, we're going to stay on auto mode, which is sort of like a compromise here. Um that being said, right, this is AI. it runs on your machine, right? So if you give it access to your folders, you need to be aware of that it can make changes to it, right? So we want to always be very precise with what we do and most importantly always run it on the smartest models because those are the ones that have the highest chance of interpreting the things that we ask them the right way. All right, so with all that out of the way, let's start by asking it to install the notion CLI. This is my simple promp for this, right? Can you please install the notion CLI on this machine? Here's the documentation. And this is the general pattern that you will follow for all of these things where you're going to go to the place where the documentation is and you simply going to give it to it and it will interpret that. And again all these links are in the companion blog post down below. And then I'm simply going to hit enter. Now while this is running here let's quickly take a look at how this would look like in codeex. Now codeex is basically the companion or the equivalent to claude from openai. And at the time of the recording of this video, right, both of these interfaces might look a bit different, but the principles still hold true, right? You kind of want to look for the area where you can put this in. Now, with claw, right, at the time of recording, you have these three different options of chat, co-work, and code, and you need to go to code. With codeex, it's just one interface, right? So, there's no differentiation between. So, you just go to the default interface. I've also selected my folder, right? So, same principle here. It's called Codex. Uh, permissions, right? Same here. can sort of like give it full access or default permissions or auto review. Um, and then the model, right, which in this case, right, 5.5. Again, I like to switch it to sort of like high just so we have a bit more confidence in what it does. Apart from that, same principle here, right? We're going to simply run our command asking it to install this. I've actually already installed uh the CLI on my machine. So, this is what I get back from CL, right? It tells me, well, everything is ready. Uh, one good practice when you install a new app, right, is kind of asking, hey, what are the things that I can do and what are some of the commands that we could run just to get a bit of an idea of it. Um, and then it kind of lists these things, right? And all of these commands are commands that you would type into your terminal, right? So on a Mac, you would open your terminal, right? And you would now type, for example, ntn write doctor, right? That's what was one of the the commands that we that we saw here, right? That to check the health on all configuration and so on. Um you can always do that right and the easiest way is simply to ask broad to walk you through this because some of it it can just do for you right so this was another example right we could simply have typed the the cur command right uh into our uh machine notion cloud was able to do this for us the things where we have to do something ourselves are stuff where we need to com on top of that we need to sort of like complete like an action on our machine so n login would be an example right so again you can simply ask claude or co-work you uh can you help me um use ntn login and uh authorize authorize this machine right and we kind of tell you hey here's what you should do and sometime it's going to tell you hey I'm going to run this for you sometime it's going to tell you hey open your terminal paste this in can basically just follow the steps what will happen is you will take ntn login right you will go to probably to your terminal ntn login you will hit enter and it's going to open a popup right that says hey you know like please select your notion workspace is where you want to authorize it. So if you're in multiple notion workspaces, you'll have to pick the one where you want to install workers to and then you simply confirm and then you authorize. There is one more step that you need to take before you can then actually start building your workers and that is you need to activate them in notion. So for this we actually need to go into the notion UI. We need to go to our settings and then under features you want to look for workers. Now in order to use a worker first you need to be on at least a business plan, right? business or enterprise and you need to be a workspace owner to enable it. Otherwise, you need to ask a workspace owner to do this. Once the owner has enabled this, then you can choose, hey, can all workspace member do this or only admins or only certain groups? That's kind of the prep step. But once you're done with that, you're good to go, right? CL or codeex installed, folder set up, um installed the notion CLI, logged in to the notion CLI, and activated workers. That's all the prep. So now let's actually start building. As of the time of this recording, notion basically gives us three different types of workers that we need to know about. And even if we get more types, right, these will probably be the most important archetypes. We'll always expand, write a blog post with the latest information on them. But basically, we'll have sort of like eventdriven workers, right? Which means, hey, something happens. Let's trigger this flow. Then we have sort of like a scheduled data sync or a sync worker. This is a worker that runs regularly and regularly pulls information from a third place. Right? Sort of when it comes to one of our problems, right? This very clearly solves the problem of hey we need to get information from an outside tool into notion. This is a very special type of worker because this worker as we will see later actually creates and manages its own database. So it's very unique because it creates this immutable database in notion right where like some of the entity properties cannot be changed right so you you can safely sync data in and don't need to worry about it someone modifies it and then last but not least we have workers that extend the abilities of your AI where you can give a custom agent literally a tool right and say hey custom agent now you can talk to my newsletter page right or now you can publish to WordPress and it's sort of an on the agent to call on them. We'll go over all of them in a bit more detail, right? But I wanted to sort of like explain, hey, these are the three types of workers. We're going to build one example for each and then you understand exactly how to use them in what situation and what the peculiar things about them are because they are of course in some overlaps, right? So like the sync one, that one runs on the schedule, but you can also hack your your web hook one, right? to run on a schedule if you kind of want scheduling but you don't want a worker that manages its own database. But, you know, no need to, you know, figure that out just yet. Just want to give you an idea. Hey, this is the map, right, of what we're going to look at in this course. And now, let's start with the first one, right? Because it's the simplest to understand one. Something happens in notion. We want to automate some cool business logic before we continue with building the specific worker. Um, a quick kind of thought on general setup, right? This is a beginner tutorial for workers. So I'm not going to go deep into like the exact development workflow, right, for our AI enabled um uh development, right? And we are using to build our internal tools or like more complex client um scripts and uh software. Basically, if you're interested in seeing that uh let me know down below in the comments. Here we kind of want to focus on the 8020, you know, like just building your first thing, but having a bit of structure, right, will help later down the line. So we know that we've already in our folder right set up claude or codeex and one of the first things that we need to get used to right when as non-developers we start creating these is this is just a folder structure with files on your local machine of course you can back it up to GitHub right but for now it lives here on your local machine and that means we want to within that right create folders um for every single project that we're developing right so in our case we're going to create three workers so every single worker right would be one top level folder for example project tasks the hacker news sync that we're going to build in a moment and the wiki enricher and within every single um uh project I like to start with a selection of four files right so this is basically sort of part of my setup prompt um and uh you can see like a simplified version of that down here right uh you can either you know screenshot that from here you can check out the link in the in the description right for the blog post or in the setup template there you have in full. But basically, we want to tell um Claude or Codex, right, to always set these up and make sure, hey, we want a readme, which sort of explains the what and why of what's going on here. We want learnings, so as this goes through and you know, your AI figures out, ooh, actually the notion API works differently, right? So, it writes it down so next time it doesn't have to figure this out again. And the change log, so of what changed now, none of these will be actually filled out by us, right? All of these will be maintained by the AI but it sort of automatically builds the context so that it gets better next time because the same principles right that you have elsewhere for AI still apply here create context make sure that for every single session that you work with it you manage your context window and you don't balloon it and then if you go to your next session you have still that information externalized right so you don't have to explain yourself every single time always again so this is the structure that we'll use so basically after you've created you know, your main project, you can ask um, you know, Claude or Codex to uh, set up the structure like this. And then with all of that out of the way, we're ready to actually start building. Now, if you've been watching this so far and think, well, this is great, but I don't have time to build workers or I need my whole team to be able to build workers. Well, then let's have a chat. As you might know, I'm on a mission to build Europe's number one notion consultancy. And that means also helping you both with AI flows in and around notion and of course with workers. Whether you're looking for a full-scale transformation of your existing setup, right, where we go in and help you bring your notion and the automations and business logic to the next level or rather a targeted workshop, we have something for you. Just check out our link in the description or send me an email and we can figure out the details. But for now, let's take a look at how to actually build that first worker. And here is that cool business logic. Our first worker will be triggered on a web hook. That means something happens in Ocean and then it will spring to life. The specific example that we're going to choose for this is we're going to have a project and we're going to have a project of a specific type. For example, a new marketing campaign. Whenever that happens, what we want to happen in the background, right, is we want to say, "Hey, new marketing campaign, let's create these default tasks." This has been basically been an issue, right, with notion ever since Notion came around. We need to create these default task entries. And there's a bunch of workarounds, but none of them are really like scalable, right? We always told clients, hey, the the ROS raw is the best solution. Is this where you have a dedicated process database? We'll take a look at it in a second. uh and then basically you have a no code automation that does this. Now we can finally use a worker right so all within notion and the flow is simple right new project is created of a specific type we're going to look up what is our SOP for that situation and then we're going to create a set of tasks specifically for that right and we can level this up like you know populate specific due dates right we can level it up by assigning the right person to these tasks where the world is your oyster once you have this basic flow ready just before we dive in right what are some other examples where you could use these web hook workers, right? One could be for recurring tasks, right? It could be so, hey, whenever I check off a recurring task, right, make sure that you create an next one. It allows you to do much more advanced logic than our previous workaround which relies on notion custom automations. But yeah, this is a great one. So, let's take a look first of how the setup is in notion, what we need there because we have a little bit of prep and then we're going to look at how to build a workout. Also, quick side note, since this is meant to be an interactive uh tutorial, right? We have sort of a workbook with all of these elements linked down below, right? So, make sure to go there. Uh you need to subscribe to the newsletter. You can unsubscribe immediately if you don't want our tips, but then you get uh a list sent with all our templates and resources and also right this one here specifically so you can follow along and don't have to build the, you know, the preset yourself. But yeah, so let's go and check out notion. fairly simple setup in notion, right? This is not for like pretty uh notion setups. If you want to see that, right, we have a full tutorial both on how to manage your projects in notion, how to build your business setup in notion, how to build a CRM, and we have a bunch of follow alongs. For this one, we just want to focus on having the backbones here. So, basically what we need is we have our project database, right? And this project database has tasks linked, right? So, I can see, hey, here's my project, right? And here are my tasks. And currently, we don't have tasks linked to it. Ideally what I want to have is like whenever I create a new project with a type new marketing campaign right or marketing campaign I want to make sure that it prefills tasks and so for this setup to work I need actually a dedicated process database right this is separate from tasks I have one global task database that contains all the actual action items and then I have this process database which lists out hey these are the ideal steps that needs to be taken and in there right we have a type so that means we can have multiple processes for like you know any number of projects in here and we can say hey these are sort of like the seven standard steps right that need to happen. You can think of this like living documentation. It's one of the big benefits of notion because it means hey your documentation always influences the execution because every time right we create a new project it will look at these seven tasks and create them and if we update our documentation right because we say hey actually now we should make have nine steps for the immediate next campaign that gets launched right these nine tasks get created so you don't have this problem that you often have in documentation right where you update your documentation and no one follows it because in the actual daily execution it you know doesn't really carry over or the other way right that you have now your list of tasks always in your system but you never update the documentation right it's inevitably linked so uh that being said right just more as a side note um we have here our database for processes we have the name of the task right the project type I like to order them so we know in which order they should be loaded into the system um and then we already have like sort of like two properties for some more advanced elements right we have a due date offset So we can say hey based on when the start date of this campaign is right after 3 days this task should be due right after 7 days this should be due. So you can sort of like set dynamic milestones and we also have already roles assigned to this right. So you'll notice on projects we'll have different roles across the board. Currently it's all me but basically we can do then some cool things like having the worker go in and be like okay um who is the project manager on this one? It's Matias. Let's assign that task to Matias, right? So you can see you can build really elaborate systems. Again, the world is your oyster, but this is kind of our base information, right? Now we want to create a worker that says, hey, okay, whenever we have a new campaign here, right? Or let's say whenever we set a campaign to in progress, maybe let's do that. Whenever we set a project to in progress, we want to make sure that it checks what's the project type, gets these tasks, and assigns them. all these setup steps, right? Just make sure that later down our life is easier. So, here I have my I'm back in Codex, right? I actually already have uh created my my main folder, right, for this specific one, right? Auto task creation. And now I'm going to ask it, hey, can you please set up the um files, right, that I want here um and keep them updated throughout our session. And then once done, please also load the skills, right? If you've watched some of my previous video, you know how important skills are for AI because skills are basically just small instructions that teach UI a specific thing. And I always like to think of it like, you know, my AI as a poke, right? I can teach it something new. And we always want to teach it the right set of skills for a project. When it comes to building notion workers, that's of course, you know, how do you entangle them? And luckily, notion is creating these skills for us. So, all we need to do is point it at the right address. Again, link for that down below in the description. and it's going to set itself up. Now even though skills are a concept that comes initially from anthropic and so from the company behind claude works exactly the same way in codeex right also there you would tell codex hey please set this up codex won't have a clot in defile right but sort of in general instructions um but same for the other types right read me learnings change log and of course um the worker skills so while this is working we can already talk about the next part and that is then explaining the actual thing you're trying to When it comes to that, I highly, highly recommend that you are going to get yourself um a dictation tool. It's so much better talking to AI rather than having to type this all out. My two favorites are Monologue if you are on a Mac or Whisper Flow if you are not. Um link to them uh down below in description. Both amazing, really, really cool tools. Um work also on mobile, right? And they will level up your AI skills so much. We just ran our first ever live workshop, right, with a small group of people and it was so cool to see everyone talk to AI and the feedback throughout was that hey, now that I talk to it, it's so much better than before. So, take the serious, right? Get yourself that it's really worth it. So, uh, with that out of the way, right, AI was working in the background. So, now I'm just going to start dictating and tell, hey, this is what we're now actually trying to do. Hey, Claude, awesome. Thanks a lot for the setup. Now I need your help and want to just describe what I'm trying to build and then I need you to go over this and ask any kind of clarifying questions that you, you know, need to have solved before we actually dive into building this. Um, here's what we're trying to do in Notion. We going to have a database with our projects. And um whenever there's a project with a certain type and that is set to the status in progress, I want to uh have the worker check a process database that lists out a sample list of skills uh sorry of tasks and those tasks uh should then be created for that specific project. Um there will be some um a bit of advanced logic right. So tasks uh in the the process list they have a they have a due date offset. So we want to make sure that hey based on the project start date you know plus 3 days for the due date plus 7 days for the due date and we also have a role um and on the project we have a notion person property with that role. So we want to make sure we assign the task that we create in the task database to that role. So overall three databases projects, processes and tasks. When project hits certain condition, check in processes and create entries in tasks related to that um project. And you see like if I had to type this all out, that would take forever. It's also totally fine that I had to correct myself in there, right? Like AI is very very smart. So absolutely no problem about that. Now before we're going to send this off, uh I'm going to actually quickly go to notion. I'm going to grab the links to um my uh notion entries and paste them in here. That's going to make it so that Claude can look at them. In order for that to work, you need to of course make sure that your Claude is connected to notion uh ideally through the MCP. That's the easiest way. So, if you haven't done that yet, here's how you can set this up. You want to navigate to the settings for your claw. Showing you codeex in a moment. uh and then uh find currently it's called customize and then connectors otherwise you can just ask claud hey where do I add an MCP and we'll tell you where the current version is because sometimes they shuffle the UI around but basically under connectors right you have notion here and then um if you have it connected already if not right you're going to click on plus um browse connectors you're going to select notion you're going to select the workspace that you want to connect to and then you'll see this now I have pretty much on most of these uh always allow so it simply does the job right particular for like all the read own tools. I don't want it to ask me before it reads a page in notion. You can of course change this also to always confirm. Um if you want to in codeex uh you would do this in settings and then MCP servers and then fill out the values here. Basically, you could also ask, of course, as always, AI, invite, hey, how do I set up the notion MCP? Um, but as I was navigating here, every less we don't even need this because remember previously, we already logged into our notion workspace through the CLI, right? When we typed in ntn login. So, the tool is already connected. We don't actually need the MCP. So, you can ignore that part. Actually, still the database links, those we definitely want in there. So sending this all off for it to work on it again. And the key thing here is that we ask it to ask us questions. If you want, you could actually switch um into plan mode, right? So Claude has this uh built in where um if you basically switch it to plan mode, there's some, you know, prompting in the background going on from Antropic that says, "Hey, you know, don't do anything yet. Just figure out what how you can best achieve this and ask user questions." It's a great sort of like start and entry point, right? So there's nothing wrong with switching from auto to plan mode. Uh going through that for a bit. Um I personally right for our proper development flow I have a set of skills and most notably the grill me skill right not for me from an amazing dude called PCO. Link into that also down below which just forces the AI to ask you really a ton of questions. Great for more complex builds. But for this here right we it's a very this is a very straightforward simple process. we'd probably be fine even without the AI asking us anything and just having it, you know, oneshot this. But still, it's good practice uh to whenever you build something to explain what you're trying to do to the AI and then have some way or shape whether that's plan mode, a specific skill or what we did here, simply typing in ask me any kind of clarifying questions so you know exactly how this is supposed to work. Um to make sure you align, right? Because hidden assumptions is the single biggest reason why AI things fail. So here we see our questions come back. Okay, how should a worker get triggered when a project is in progress? That's great, right? So I didn't even actually tell it that. So we will do the web hook on status change, right? That's the whole point. Remember three types um of uh systems and you see also you could do a sync but that's M does it own managed database. It's again it's awkward because we're writing to something existing. So the AI is pretty good at that and we don't want um a tool on um because then we would need to run an agent every time we want that and that costs agent tokens, right? Which are very expensive. So we want to do the web hook. Uh which project types should it trigger works for all types. Yes. And then in the process row it can simply check um whatever is in there. That means what we're building here will work also if the team adds 10 more types and 10 more processes which is one of the reasons these automations are so powerful. Right? You need to set it up once, but then everything else happens in the UI, right? You can create three more project types, um, three more processes, and it will work just without having to touch this. All right? If it already has tasks on the process process, don't recreate them. Yeah. Um, so this is generally a great idea, but it requires us to have sort of like an some logic of how to match tasks, right, based on the name or based on an ID. So, we can see how we want this. For this one, we're actually going to do it simpler. We're going to say, hey, if we set this to in progress, we want it to create it every time, even if it creates duplicates for your production, right? You probably want to want to do this. Uh um if you do this actually for your team and, you know, have some sort of ID on your tasks. But here, um actually, let's go with this. Let's see what it comes up with as a solution. And still create task just leave the owner empty. Yes, that makes sense. or actually um now here um always uh assign this then to the owner of the project or as a fallback to the person who created the project right I never want to have empty tasks or unassigned tasks in my system there should always be someone who's responsible so now same game right going to wait for this a bit and come back building with AI is a lot of answering questions you know bursts of focus and then waiting for a moment, right? Usually I would go now and do a sort of like cycle through a few projects, making sure that there's always the next questions ready when I come back, but it also is fairly fairly quick here, right? So, let's see whether it has any other things. And we see as we're doing this, right, it's going to write these details into the docs into the pages that we've set up, which is why it's so useful because as soon as you give AI a bit of structure, like in this case, the decisions, the change log, right, it's going to make have a lot easier time, right, to keep track of this. And then if we have to restart the session at some point, right, because the more we do, the more the context will app, the worse the performance of the AI will get. Um, we don't have to run through all the questions again. here. For now, our context uh should still be fine because we didn't have now a lot of conversation with it. But if you feel yourself, you know, getting back and forth with it for a while until you align on the kind of workout you want to build, um then it's best to wrap up. We'll do like an example of sort of like a wrap-up uh later. But for now here, I'm going to tell yes, uh please go ahead and start um building the um the worker. Let me know if you need anything from me. Right. And again for all of this we're in auto mode. So for the most part it will just execute but some uh commands will have to um still approve manually. If we were to switch to bypass permission it would now simply like run until it thinks hey I need some some input from my TS or some UI actions right for example if it starts doing this and it checks hey are workers active in the workspace right the setup set before and you haven't done that yet it will tell you hey you know can you please go in the UI and do that because it can't take all exceptions. Same with the NTN logger. So, just going to pause here quickly and then come back when Tino tells us again it's ready for our input. So, here we are again. It needs some input. It needs to it wants to check, right? Whether it to uh see whether um web hooks actually enabled it, right? We always tell you in the chat what it sort of like uh wants to figure out. Um it tells me, hey, auto mode um doesn't allow me to do this without you approving it. So, you know, you need to click once. Um, and basically what it's doing here, uh, so we're going to say yes, deploy in the documentation from GitHub, right? The workers, uh, notion still has some alpha flags in there. So, for example, hey, you know, workers might not be enabled or the web hook capability might not be enabled, but these like everything from this tutorial should be uh in your workspace as of today. Um, again, as long as you're at least on the business plan. So we still going to go ahead and test this but for our next worker uh this is one of the things where we could tell it ahead of time right um by the way we have workers in here um web hook books work yada yada so it doesn't have to go through this again this is what the learnings are also for right so that it remembers this and doesn't have to to worry so it worked for quite a while right more than eight minutes in a go now it's pretty much ready it tells me it's currently blocked on task number three it needs an integration token right so even So we have of course um logged in here right to do actions in notion. So that in order for the worker to do something that sometimes still needs a proper integration. So it also gives us already the URL where we can uh do this right. So this is one way although notion just updated this. Notion just has now a new developer portal and link for that also down below. So we want to go there create an API token right um name it accordingly and then granted access to these. So let's go ahead do that and then I also show you what the best way is to give it this token because of course you could now paste you know your API token in here. It always recommends you not to do it, right? It's not a good security practice to sort of expose your API tokens here in the chat. So it's going to talk about something called an EMD file. Again, even if you never heard of that, I'll just show you like how it works and you can follow along. So no worries there. In the notion developer portal, you want to go to connections and then here create click on new connection. Then you can choose which workspace this should be installed. And that's perfect. We're going to call this YouTube um workers uh demo, right? Going to create an access token. Uh create a connection. And now we have it here. And we can copy it and add it. We can also change the permissions here. Right? So if we say, hey, we have a worker that doesn't need to make actual changes, right? We could give it only read uh permissions or if it needs to interact with comments, right? So you see there's a few extra settings, but for like the default ones, this is totally fine. And you can click on copy here. In order to create your ENV file, we need one more sort of engineering tool or code related tool. And that is a way to actually you know edit these files. Now the one that I would recommend is that you go with VS code. It's sort of like uh that's a great starting default like very broadly used um developer tool. If we were to write code, right, this is actually where we would do this, right? So when I did my web development like very basic crash course a few years ago this is where you would go and would create your HTML and CSS files. Um now we're basically just using it as a glorified file browser here. So after you install it, you basically open a folder, right? So you'd go to the file folders and you then um select the one that you created, right? So this is the autotask creation folder in our claw project and you see all the different files it created here. And among others, right, the read me, right? Um that we told it to set up with uh it stuff. And this is also by the way the easiest way to check out well what is actually the readme, right? What did the AI decide to to document here, right? So here um we say part of the YouTube demo workers project live build on screen no secrets or tokens on screen right I told it to hey please when when I share my screen avoid printing out any any secrets right that we should not have in there um we can also check what the learnings are right so this is what it what it learned um when when doing this right so choose a web hook trigger um gate result right is enabled so this is how we can just see what happens and follow a bit along um now in order to give it now the secret what we're going to do is we're going to click on create a new file that and we're going to uh type in env. Um that's sort of our environment variables. Uh it's like how we hand uh our code usually things that we don't want to expose anywhere. And then we're simply going to call this notion. I'm going to just type it, right? It's just a text editor. So we're going to call this notion API token equal to and I'm going to paste in my token. Now in this case, right, I'm exposing my integration token on the screen. That's a bad idea. You don't want to do this. So before this video goes live, I'm going to go back to the integration. I'm going to rotate this key so it no longer works. But this is basically the secure way, right, to hand that to your AI rather than just pasting it in the chat. So that being done, we can now go back to our cler and tell, hey, you now have an env token. So back here, I'm going to just tell it, all right, I set up a token for you in an env file. Uh there's also one project in the demo task in the demo projects database that has a type set. You can basically use that for testing. All these entries are demo entries and then set up have a look again. Now you also need to make sure that your integration token can actually access the databases right that it needs to interact with. In order to do so, you want to open the database, click on the three dots on top right corner, connections, and then add connection. And here, look in this case, right, for uh YouTube workers demo, right? That's the one that I created. And add this to the page. And it needs to have access to all the data sources, right? That's supposed to access. So if you have also like a top level page that contains all of them, you can also give it access to that. And then with notions waterfall permissions, right, they all will be shared. So we are nearly ready to test our first worker. uh cloud is going to ask us, hey, should we push this, right? Are we ready? So, yes, we want to push and deploy, which means it's going to give the worker that is installed on our workspace the integration token so it actually can do what it's supposed to do. Quick note, you can also confirm that your worker is now uh in the workspace by going to your settings, then to workers, and then here, right, where we initially turned them on, we now see we have our here auto task creation, right? The one that we just enabled. You can also then disable it from here or delete it from here, right? if for whatever reason uh you forget how to to access through clot but yeah that's where you'll see that it exists. All right, our automation is ready which means we need to now just make sure that it's properly wired up because remember we triggered via a web hook. So we need to still set up that web hook part and cloud actually is going to explain to us what we should do here right we should create a new automation on our database um make sure that when the trigger is set to status right we want to ping a URL and it gives us this URL um in a text file right so we can ask it to print it out here or we can go now back to VS code right and sort of inspect this file the reason why it typically prefers to give it to us in a file and not print it out is that of course anyone with that URL can ping your worker right a book can also come from outside of notion. One way to increase the security here is to simply um add a secret, right? So we can ask um Claude here in a moment if we wanted to, hey, can you make sure that there's also like a header secret to authorize. So just when we ping this web hook, just in case someone else comes across this URL, they can, you know, just keep triggering tasks, right? It needs a password as well. So that's generally a good practice. So I'm going to uh I would recommend, right, that you go ahead and try this for yourself, right? If it goes to that and doesn't suggest it proactively, ask it to give you um you know a secret that you can put in a header. Very important. We'll talk about that in a second. But in this case, right, let's quickly go to VS Code, right? And here, let's look for the file that it said it created right here. Web hook URL text. Perfect. So, here's the web hook URL that we need. So, I'm going to copy that and then I'm going to head back over to Notion to set up the actual trigger. So in notion now for the automation right let's click here you know um trigger uh auto tasks uh basically just follow what claw told us right but here in the automation we say okay whenever the status is set to um in progress then we want to trigger this by the way if you want a full tutorial on how notion automations work right I have a full guide for that also down below it's even with workers it's still well worth learning those because kind of they're they're the pre-step right often times a simple automation will be enough and And so you want to know, hey, when do I use a worker? When do I use this? And as you can see, you very often will need normal automations to trigger your workers. So send a web hook and we're going to send this web hook to the URL. Now, in case what I highly recommend, right, you set up a secret, right? What you would do is you would say add a custom header and then whatever it tells you to put in as the key, right? So like X header secret, something like this. And then here in value, that's where the password would go. And that would then allow you right to make sure that hey no one outside of your workspace can trigger your worker if they randomly happen to figure this out right which is still it's very unlikely but as a security best practice a good idea. Um you don't need to send anything else right that's enough. Um this is also one thing to keep in mind sometimes when you work with claude or codecs um and set up one of these webbook triggers it's going to ask you to hey and set this in the body right or have these values sent through. If that happens to you, you need to just tell uh Claude or Codeex and that actually with a notion automation, you can't set any values except for the header, right? The only thing you can send is um the actual, you know, header uh elements and then the content is like predefined by notion, right? So, we can't write something custom in there. So, the easiest way is to simply just tell it to like, you know, have a look otherwise at the ID or have a look at the payload once uh and digest this and then figure out how to use that. So yeah, in this case, we're just going to click on enable and then we can uh test this. Another way to of course send these web hooks, right, is through button actions, right? Just so you've seen it. Um, right. So if you want to sort of like trigger this manually, you could also uh look for like the the button here. Where is it? Yep. Let's call this and let's call this create tasks. The nice thing is this will work regardless of whether you know the uh status change triggers it or this triggers it, but it's both the same. So here we say okay, also send web hook right. Same idea. Um, all right. And save. Now we are wired up here. Now what I'm going to do is I'm going to go back to claude before I click or trigger this. Tell it everything is ready and that it should please start watching the first run just so we see whether everything works or whether something needs to be, you know, troubleshooted because again sometimes it might miss something in the first run and having it watch this first run just makes sure we get any kind of debugging that's necessary immediately done. So, and doing so again super simple just asking it can you please watch the worker and we see yes um it's going to watch this for the next 5 minutes. So I can go back here now and either you know use this to set it to in progress or the other one and then we will go back to our claude and see whether that catches us and whe something happens. And of course here in notion we can also investigate you know are these tasks being added and that looks pretty good right so here we have our entries right uh we have them all set the status is set the due date is set based on the offset right that we created of course they're all assigned to me because I'm filling all the roles in our demo project but still pretty neat so let's go back to demo projects and actually let's create another one sort of like second campaign campaign second test let's just do that right let's keep it simple uh here Again, uh what we would we can test this one sort of like what happens if we don't have something set, right? Let's sort of like test this as well, right? So here I'm going to set this to in progress. This one shouldn't get any tasks because it doesn't have a type, right? And on third test, that's the event and let's just make sure we get all our properties here that we need. Right? So like I want to see the status and I just want to see the project type. Yeah, perfect. So here, right, this one is not uh in progress, but this one will get now new marketing campaign and here I'm going to set it in progress. So if I investigate this, I should not see any tasks. Yes, perfect. Zero tasks. If I investigate this one, right, this in a moment should get the tasks uh from the worker. Let's see whether it runs all through. And then we can have a look right at our um um plot and see whether it investigated anything from those runs. All right, tasks did not come through in our third test, which is even better because now we can troubleshoot. Right, this might always happen, right? You might set it up and okay, it doesn't do what it's supposed to do. What do we do? Well, we ask AI. Now, at this point, right, our context window is getting quite happy. I'm still going to do this for now in here, but this is at some point, right, you might want to take the decision to, hey, okay, let's actually document everything and then do troubleshooting in another window. But for now, I'm just going to ask it um um okay, the background watcher just ran again, right? So, that's good. Um so, I'm going to ask it now here um again with dictation. Actually, I tried to do another few tests. I created one project without a type and set it to in progress and I created another project that is has the type and I set it to in progress. It didn't get any tasks after that. I clicked the button that I created that triggers the same web hook another two times and also it didn't get any tasks. Can you check the logs and see what might have gone wrong there? Um and then yeah identify whether there's any specific fixes that we need to do or what the cause is for that. Uh once we have this kind of bug resolved and fixed then we can document everything here in the project. So we have a complete handoff for next session and wrap this up for now. And then this is sort of like otherwise right if you wanted to wrap this up now or like you know like um started in a new session debug hunting you would simply ask it to hey you know um we actually want to do a few more steps but the context is getting quite heavy. and you just write yourself sort of like a handoff document and drop it into the project and then kind of just print out for me a prompt that you want me to use to start in the new window. So yeah, we see four new web program runs all exit zero and now it's going to read the logs and that's the great thing right notion workers automatically log um what they do uh so you can see okay where is something going wrong for now right uh you always need to use cler codeex to access that what you could of course also do if you wanted to see those runs in notion you could create a database for worker runs and then as part of your setup right you could tell cloud always hey and make sure that whenever you know a worker runs it logs sort of those details there if it makes it easier for you to see that. All right, so let's see what it found. Um, all four runs quite correctly. Perfect. Second test, no type, has no project type. That is correct. Um, third test. Ah, it has no start date. That's the one that surprised you. Um, if it has a project type but no start date, it treats it as mandatory. So that's good to know, right? Um, that's sort of like a behavior where we didn't quite know what to do yet. So now we want to say okay yes we want to have a fallback even if there's no date we want to sort of like fall back um to today cuz maybe someone didn't fill it out correctly. But of course that's sort of the strength of building this in code in a no code tool. You can also have all that logic but the more edge cases you have the more complicated it gets. And at some point you're then like hey team okay we can't handle all these edge cases I need you to you know put the data in correctly or it will fail. with code of course you also will have an issue at some point but it's much easier to do this for example you could simply say hey okay if that's the case actually also please set that right if you know for example based on other documentation in your system you know this type of project should always run 8 weeks and if the person hasn't you know set that yet just take today and that or you know ping somewhere write update a status add a task to someone in the system to do this right any kind of business logic you can codify here in your worker to make sure that goes through. So, uh, fixed it, right? And now we can kind of, uh, check this again to see whether it works. By the way, one quick trick here. If you go down below, you see how we're currently running. And you see if I hover over this, I can see my usage. I can also just hover over it. Same idea. Uh, so I see like, okay, on my plan, I currently have sort of like 30 um% right of my uh, 5 hour limit here use because I have a few queries running in parallel on the side on top of this one. and we see the context window of this specific query. Currently sits at 135,000 tokens. Now, in theory, we have 1 million to 2 million uh of context window with um OPUS, but um based on uh my own experience and what I've seen uh other people do that, particular ones that like do proper engineering with it, um 120 to 150 seems to be the kind of sweet spot um where you want to think about handing it off, right? So 135K, that's still good, right? We just need to create the documentation now. We don't need to do hard work. But if you were at this point now and say, hey, okay, there's a whole new logic step that we need to build. We need to do a few more questions back and forth. That would definitely be a signal for me to say, okay, let's hand off to a new session. Um because while it can process more, right, you're diluting this right now. There's all this information that floats with it. You're using up your limits much quicker. Um your response quality will go down. So it's best to have it externalize what happened so far and do that. But yeah, for now it deployed everything. So we can go back and test it. Here is our fourth test. Right, we can set this to in progress. I'm going to uh investigate. Right, this also doesn't have a a start date set. So let's see whether that runs through correctly. It also doesn't have an owner set. I don't think that should be an issue because we told it, hey, if there's no owner, fall back to the person who created it. And yeah, indeed, it's running through correctly. But you see already, right? Like there might be depending on your system a few things that you might need to keep in mind. So that's why it's important to test to iterate and then work together with claude and the logs to figure out okay where does something go wrong. But this is perfect. So now let's go back simply to claude and tell to you know like great job. Please document everything. Wrap this up and we can start a fresh session. Amazing work. This uh works now flawlessly. So at this point I would say let's make sure we document everything thoroughly in this project so that next time when we come back to it we know exactly what the state is, what our decisions were and if you want to expand on it like how we can do that. Once you've done that we can then uh wrap up this session here. All right and then we're going to send this. Now one of the things that it keeps asking me right is whether it wants me to commit this because that's because I'm using Git and GitHub to kind of back up everything and do version control. But again, this is something for more like the proper engineering flow also like the the vibe coding engineering flow that we are following internally again right if you would like to see like a more detailed tutorial like a more advanced one on that let me now know down below in the comments we might also run a workshop on this actually at some point um but yeah so um it's going to go ahead and do that and that means our first chapter is wrapped up at this point you should have your first working worker right that gets triggered by web hook that does something in your workspace, you can codify any kind of complex business logic into it. And yeah, then we're ready for the next one. Onto our second project, sync workers. As a reminder, a sync worker is one that that you set up and say, "Hey, on a cadence every 10 minutes, once a day, once a week, go to this external data source and pull the data into notion." The specialty about this one is that this creates this this kind of work. If you call it a sync work, right? If you define that uh it means it needs to manage its own database. So rather than creating a database like we had already right with our tasks and etc right it will create a new one. There's currently no way to tell it hey I actually have this already please just update that. Hopefully that comes in the future. For now this will create a new one. So you might have to migrate other data in there or like you know shuffle things around a bit. The cool thing about this one is that the database that it creates is managed by the worker which means every property that is managed by it cannot be changed in notion. You can't change the values of the entries. You can't change the property types etc. it's sort of protected in the UI which means right for this oneway sync you're always guaranteeing that this data looks exactly like in the external data source and you're not risking that hey you know there's something wrong with the with the setup um you can of course add your own properties to it so for example uh I have a database that syncs my new setup from convertkit in there and I have all the you know properties from the worker for the details and analytics and then I can relate it to my actual content and can add additional properties if I wanted to. We'll see in a second how this works. The important thing to know, right, is that this is creates this oneway sync with a manage database. Now, just as a side note, as of filming this tutorial, this is the only way to inside of the worker declare a timer, right? A so-called chron job. That's basically whenever you say, "Hey, every 15 minutes, every 30 minutes, run this." In a normal worker, right? one that doesn't manage its own database, you can't do this. But there might be plenty of situations where you want that. For example, maybe you want to create a worker to build actually a two-way sync, right? This is nothing that we're going to look at here. This is a lot more complex, but you might want to say, hey, I want to update be able to update also data in notion and then it should update that in the external source, right? We want it in both ways. Then you can't use a sync worker right now because remember you can't change values in in your system. The workaround for this just so you further ones would be to take the first type the web hook worker and then in notion you can fire a web hook on a schedule right so you can say hey every 15 minutes fire this web hook so through that you can basically you know build a chron job sort of like a chrome job at home um to make sure that your worker does that so basically if you say hey I want something a worker that runs on a schedule but I don't want this oneway sync database and managed stuff um go with approach number and simply trigger a web hook on a SC cadence. But for this example, what we're going to build is a system where we're going to pull an external data source. I think Hacker News should have a good one. We'll check that out in a second. And basically, you want to have always the updated list of top hacker news stories in our system. But this could you be your external CRM, right? So if you um manage deals in something like HubSpot or so, you could pull it in. If you have a product and want to pull from your product usage data into notion that would be a great use case or again pretty much any external data source for personal ones a lot of people think Spotify or like you know like the health data from Uring wherever you have data externally and want to make it accessible this is the way so fresh window in clawed uh code here again right just going through the flow now and I'm describing how this works so I'm putting on dictation and I explain what I wanted to do this is a new folder in right separate worker, separate folder, data sync. Um, and it doesn't have the data structure yet. So, I'm going to ask it to do that. All right, cloud ready for another project. Uh, this time we want to build uh another notion worker, a sync worker. In order to set this up, I would first like you to create um besides the readme which is already in this project, our learnings MD and our um change log. So, just so we can keep track of everything that we're doing as we go through this project, right? Please keep this always up to date. Once that's done, then uh I'd like you to ask me questions about the project that I'm planning to implement here. Right. What we basically want to do is we want to use notion's sync worker option to pull an external data source. I'm thinking of pulling in hacker news. I think they have an open API that we can pull. We could pull that once a day to create a database to update uh that database in notion. um the worker will have to have its own managed database. If I recall correctly, I've already set up a sort of like parent page uh where you can drop that. But yeah, that's so far what I have in mind. Again, please ask me clarifying questions so that we know exactly what we're working on. And then once we're ready with everything, we can go to implementation. You should have already um access and log into um notion via the CLI. It should already be confirmed. But you can check that if you want, right? Again, it's like you hand off a project uh to a human on your team. You just give them some context. And if you do this often enough, you then wrap this in skills, right? So you don't have to repeat yourself all the time. So just going to fire this off, right? And see what it comes back with. So the usual game, it's come back comes back with a few questions for us. Which hacker newsfeed should the worker hold in roughly how many stories? U let's do the top front page. 30 sounds totally fine. Although let's actually just do the top 10. And this is where like other comes in, right? Sometimes these options are very short and they don't really describe what you want. Um so it's a good idea to then use other than just dictation. In this case um let's do uh front and only the top 10. Right? How should notion database behave from one daily run to the next? It will yeah we want to mirror the current list. Right? So this is now the question right? Your sync worker can either just replace things right. So it just shows the latest 10 or if you always want to copy them, right? Um it can uh do that as well, right? And uh accumulate. But here we want to replace. So I just want to see always the latest top 10 stories. I basically want to have hacker news in notion. How cool would that be? Where should we fetch the data from? Um I don't know, right? Like this is a question. I I I don't know which one is more efficient. This will happen quite often, right? where um sometimes when you build something more complex, uh Claude is going to ask you engineering questions. And in my proper engineering setup, I have kind of like a a long list of or like a thorough context document that kind of walks it through the decision tree where I spell out very clearly, hey, um you are the senior engineer. I'm kind of product, right? If you look at it in a traditional company structure where it's always like there's someone, right, who figures out, hey, this is what we should build and this is what the users are asking for. And then there's the engineering side which actually makes it happen. The relation here if you as a non-engineer build with claude or codeex is very similar right you are stepping into the role of product. And so sometimes you need to remind claw that hey when it comes to engineering questions you probably can't answer them. So it's also important that you shape your you know sharpen and train your own perception and muscle here that you don't give input on things that you can't right. If you want to, you need to get the context, right? You might open a new window and ask, you know, Claude, hey, what are the trade-offs between the these so that you can make a judgment call or in something like this, right? I'm basically just going to tell it um you are the expert on this, right? It's your call. I don't really care. Whatever you think is more efficient. And then beyond title source and the hacker link, hacker news discussion link, what else do we want? Um, sure. Let's do the the the count. Let's do the author. Um, post the time. Let's get it all. Right. Let's get it all. Uh, and then I don't actually have no idea how this API looks like. Is there also a summary also uh or the actual uh content? No worries. Uh, yeah. Not but just curious, right? So, like how that uh how that looks like. And then we're going to submit. Oops. Did manage to submit without clicking the button there. We want to submit our answers. Apologies for just flashing big on your screen. So yeah, and then again wait a bit, right? As you see, this took it five minutes for the first one. So again, you might uh not need to do some other things in between like circle between a few workers that you're building. Uh it's a kind of new way of working where you invest a lot of time into the planning and the execution is taken care of by the system. Similar to actually what we did uh in our development guide, right? If you're curious on how to build notion workspaces with a similar AI first approach, check out our CRM guide down below. All right, that was quick. After answering these questions, it decided it has everything it needs. I simply went ahead and built this. So perfect. Um asking again whether I should deploy it. So yes, I want to deploy it and run it. Uh and then see how this looks like in the workspace. And you see right like this 10 minutes that was just popping up there, right? So it's been working basically on this now for for consecutive time of 10 minutes. If we check our context window where we're at um blah blah blah, right? 86k. And that shows you right you can basically for these simple workers you can oneshot them in one session. If you do more complex integrations you might want to do a few rounds and then go into proper development. But again for something like this it's so accessible now to create these even as a non-engineer. It's actually crazy right um and this is not 10 minutes of active time right this is sort of like 10 minutes of clots time and then a few minutes here and there for us to answer questions. All right so it's deployed now let's check in notion how it looks. All right, and here we go. Our database with the top 10 from hackernews of the day. And you see, right, this is what I meant. This work database is synced. So while I can click into this and open it and then of course I could sort of like oops create a template or I can also of course type in the page body because that is not synced. I can't change any of the values, right? I can't say actually this is rank one, right? Like I can't click I can only copy it. Same for this. And this is sort of the power of these databases, right? Where you protect them from accidental changes in the system. I can then go ahead, right? And I can now add new properties to this. So I can say, okay, you know, let's, you know, move this a bit. If for whatever reason, right, we wanted to link this to our own internal database, right? For like some insights, we could do that. Or we could add a, you know, a tax property, right? And then if we weren't resetting this every day, right, we could now create tax here. And we could, for example, create a notion agent that actually goes in and reads the blog post, right? Um, and then adds the text to this to make sure like we have the context from it. Or we could create a worker, right, that actually now as a follow-up, right, goes in, takes the content from this post and drops it into the page body, right? There's so many extensions to this, but that's the basic premise of a sync worker. We can then tell it like how often it should refresh it, right? In this case, it's every uh every day, but you could run this, of course, right? If it's a sync for like data that changes often, every 15 minutes uh much more frequently and have everything in here in motion in basically more or less real time. On to worker number three, giving AI tools. This is all about upgrading and upskilling your notion custom agents. Because while they're great at doing the natural things within notion, there's basically two areas where giving them tools can be really impactful. One is expanding their capabilities. So kind of the things that we talked about before, right? Pulling data in, pushing data out. If you want to interact with an agent while doing that, right? This is what you need. For example, let's say you have a data warehouse. somewhere, right, for your company with tons of information and you want you have a custom notion agent where that people can ask any kind of data query so they don't have to, you know, go to a data analyst so they can focus on actually, you know, cleaning the data and prepping it properly. Well, you can give your notion agent a tool that allows it to call your data warehouse and do that. Or you could give it a tool that helps you automatically, you know, like create a newsletter, update a blog post on the web, etc., right? all things where otherwise you would have to first interact with AI in your workspace and then still manually take those actions. That's kind of one of the big blocks. The other big block where tools for your notion agents are very relevant is to optimize for cost, right? Because when an agent runs, it will consume tokens and the more information it needs to consume to do something, the more expensive it gets. Often times though, parts of what it does can be outsourced to deterministic code. For example, let's take dduplication. If you want to dduplicate uh your notion database, you could of course say, "Hey, agent, you know, query this, check for similar names, etc. But then it needs to go through all of that, right? That would be immensely expensive. It would be a lot more efficient to give your agent a tool, a bit of code, right, that basically runs through database and based on code, deterministic logic, right, determines, hey, you know, these are people with the same name, these are people with the same email, right? These are duplicates." And then the agent just sees the analyzed duplicates and then can use its reasoning step to say okay how are we going to merge that together right then you kind of get the best of both worlds code to do the heavy lifting and then agent reasoning to do the actual thinking job of it. So in this case, we're going to do like a very simple um um example, right? Just so you have built your first tool for a worker. We're going to create a custom agent. And this custom agent um will be able to fetch the Wikipedia API, right? So to just make it a bit easier to get some structured data back and then populate that in our notion database. So same idea as before, right? We're going to clot, we're going to describe what we wanted to build and then we see like what is this the unique element, right? If we need to, you know, give this to a worker in notion, you know the drill for these prompts right now, right? Basically going to tell it, hey, I want to set up a custom agent tool as a worker. Um, this is what it wants to do. What I just also described here, right, here's a database that these things should be pushed in. And if you have any questions for me, right, again, please ask me. So you also one thing that you see is um since we are working in a folder, right, where there are other folders already with workers, uh, the AI is smart, right? So it's going to check out what it did before there. So some of the learnings even though they're kind of like constrained to an individual project will carry over and if you build more and more workers you can of course start to abstract learnings right. So you might create a big learning stock and then occasionally ask you know claude to go through the individual projects that you created and sort of figure out hey what of this knowledge should we abstract away so that it's just easier when we build new things. Again, for these simple ones, that doesn't really matter. But let's say, for example, you integrate this with custom tooling from your company and your internal API has some quirks, right? Very helpful that you don't have to reexplain this every single time. So, what should the tool actually do when the agent calls with a topic? Um, tool fetches Wikipedia detail, creates a row in a glossy, yep, and returns a confirmation. Exactly. Right. The agent also doesn't need to do the right step. That's why we want to optimize the tokens as much as possible. So, I can just tell the agent, hey, can you fetch me details on this? and it does it as efficiently as possible. Which Wikipedia endpoint? Um yeah, that sounds good. Um let's do queen structure data ID for glossery, right? Let's follow the recommendations. And how should we target the glossery database? Um we want to write to an existing database, right? So important. So basically asking, hey, should this be a worker managed one? So like the sync one, no, we don't want the sync um manage one. We have a database, right? It should use the existing one. Um that's why it's so important right to go through these questions so that the AI actually ends up building what we want um rather than something else which also right as a general principle the more complex the thing that you're trying to build the more time you want to spend on this plan so we're rushing through this here right because it's a demo it's a tutorial it's meant to give you a bit of exposure to your first workers when we build more complex flows right for client projects or internal ones it might well take half an hour an hour two hours right and to go through this grilling session and figure out hey what is it exactly that we need what are the rules what is version one right that we want to do in the beginning what are things and features that we you know um you know will ship later so yeah uh let's let this run through see whether it has any other questions and otherwise it's probably going to go ahead and build this directly while we're waiting for a moment and sort of like 7 minutes later we see it's basically done right it's sort of like updating its documentation as always and it tells me hey the the deploy right this block because that's why we we're still on auto. It can't do everything without our our input. So, it's going to finish writing this up and it's going to ask me, hey, should I should I execute this? And again, let's just check just check like how much context it used, right? Uh still well below our 120 to 150k uh cut off for this oneot setup. So, pretty perfect. Uh one option of course right is you can always if you run into context limits and usage issues you can go down from you know extra high to high or medium but in particular right if you don't have too much experience with guiding AI I recommend to like you know increase the setting there to make sure you have sort of guidance from the system on what you're doing. A good 15 minute later, the deploy and everything came through uh and all the updates. And now I'm simply asking it to, hey, can you give me a prompt that I can paste into notion AI to set up the agent for that? Now, this is sort of like a trick that sometimes comes in very handy because we just gave this session here a lot of context, right, on what we're trying to build. And now on the notion end, I don't have a custom agent for it yet, right? Many times you might already have a custom agent that is set up with prompts and skills and has everything it needs to know and you just need to give it a tool and expand it. But in a situation here where you sort of first create a worker and then say who okay now I need an an agent to handle it. One of the easiest way to do this right is basically ask the AI here to give you sort of like a prompt, right? So we can just copy what it gave us here and because it wrote the code uh instructions and knows exactly like what it's supposed to explain. So, I'm going to copy that. I head back over to Notion where we have our demo research base. And I'm going to ask Notion AI here, hey, you know, can you help me set this up? So, never run this on auto, right? Always on the max model. Um, I'm just going to explain this. All right. I need your help to create a notion custom agent for me for this YouTube demo purpose. Basically, we've created a worker that is a tool for an agent to call Wikipedia and enrich these research topics. I've also asked Claude to just build this worker to give us a little bit of context, right? So you know exactly what to build. Basically, I only ever want to chat with this custom agent um to do this, right? Because you just want to demo uh what is possible uh here. So nothing too fancy. I will wire up the actual tool, but if you could create the agent for me with all the instructions, that would be amazing. And yeah, just leave it and uh have it run cuz that's the easiest way to set this up. Of course, we could go in the UI. We could do this on our own. Also, a quick side note, um, this alone, right, this is a demo use case. You probably wouldn't create this as an actual custom agent in your space, right, to just call Wikipedia and pull this out. So, you know, think bigger here. Think about like other external data sources that it might want to pull from, right? Maybe you need to make some sales decision. Maybe you're not syncing a external data source into notion with a worker type two. you just want sometimes your agent to be able to to access that data or to push somewhere. So no, don't treat this as a best best use case to actually create a notion agent. So let's wait for this one to run through and then come back and wire everything up. So our agent is ready. Right here are all the details. Now again, right, this typically wouldn't be an agent. Just as a side note, I hope Notion changes this in the future, but right now you can only attach tools to a custom agent, not to your personal one. Otherwise, an interaction type where you say, "Hey, I'm only going always going to open this in chat, right?" This should not be a custom agent. Usually, this should just be a skill for your personal one. So, you don't have to pay for tokens. But there's one exception right now, and that is if you need to attach workers because they're only available here for now. Um, in order to do that, right, um, we can go down here now and click on add connection. and the connection will show up down here, right? As a tool. One little quirk here. Um, when you go here and try to look for workers and you don't see it, it might be because you're not a person who deployed the worker. Right now, only the person deploying the worker can also attach it to agents, which means you can't yet build sort of tools for your team and then they attach it to whatever agent they want. They would always have to share that with you and do it. There's no way to sort of like add permissions yet. Hopefully, it comes in the future. Also just a side note why we didn't do a good job naming this here but you know that's for the future. Let's connect this and then when we connect it we see okay there's a worker and there's one tool. So one worker can contain a whole section of tools which is relevant. For example let's say we go back to our data warehouse example and we say okay this agent should have you know like 15 different SQL queries that it can run against our data warehouse. In that case you wouldn't need 15 different workers. You create one worker and then that worker would have 15 different tools and then you can also like on a one-off basis decide hey should this agent have access to all these tools only to some and if we update this uh worker in the future right should it automatically get new tools or do we want to have to opt them in so yeah connections basically work just the same way as custom MCPS here. Um one more setup step right I always start running my agents on Opus 4.6 just to make sure that you know if we test this on a or 4.7 because if the smartest model can't you know handle your instructions and your tools then you have a problem then you need to go back to a drawing board but once it works we can then go back and make some simpler changes to it. All right, let's save this and then let's test it. Can we test your new tool with a fun query on Wikipedia? You pick whatever you like and then we have it run and now right we'll see like how this works and how it goes and what it decides to call from. One interesting aspect notion yeah we need to like confirm two calls if we run them like this. If they run on a schedule right it will run without confirmation. Um we can then also see like what tool it called right in the moment. So it sees okay runs that via the tool. Okay tested on kabibara awesome. Um, let's see the glossery entry, right, that we have created for that. Let's see. Is that the link that goes to it? No, that's the Wikipedia link. Let's go back to it and figure out where that is in notion. Ah, there we are. Right. So, our copy driver is in there, right? We see the summary I've got from Wikipedia, the URL, um, the thumbnail, right? And the last enrich step. So, ran through perfectly. Right. Now you could again expand on this, have it do more, but if you follow along so far, you've successfully deployed your third worker. So now you have a worker that runs with a web hook. You have a worker that runs on a schedule, and you have a worker that can be invoked by an agent. So much for our big notion workers beginner tutorial. Congratulations, right? Even if you've never touched a line of code before, you now have three shipped workers that can actually do things in Notion. From here on the world is really your oyster and the only limit is your imagination. What do you need to happen when you know business processes run through notion? What is something that you wish could be pulled in or pushed out of notion? Whatever it is, you now have the tools to build it. As always, if you have any questions around this, let me know down below. If you want our help as notion consultants, you know where to reach us. And other than that, I highly, highly recommend that you check out this video. In this video, we explore how you can teach AI hard things, most notably things that you are not really good at yet. It's one of the most complicated things to do, but also if you figure it out, right? If you can use AI to cover up your weaknesses, then you have a new superpower. So check this one out and I will see you in a few

Generated algorithmically for Search Engine Indexing.

Summarize Another Video