Transcript for:
AI Agent Workflow Design

Whenever I see a complex AI agent or workflow like this, I get a headache. Yes, they look super impressive on the screen, but in reality, the more complex your workflow is often less effective. They're harder to maintain, debug or test or just make it harder to scale and even more, it makes you think that AI agents have to be very technical, look complicated in order to be considered high value. So in this video, let's change this mindset. I'll share a much simple and easy way to build not just a single AI agent, but eventually building your AI work team with scalability. Even if you are non-technical like me, let's go. Don't let AI agents scare you. What makes AI agents different is they make decision with reasoning. It has access to tools, memory, so it can analyze a situations and choose what to do next. While a workflow or automation just execute the same sequence every time. I cover this in details in my previous video, so go watch it. And what makes an AI agent truly effective is not about how many nodes it has, but with these clearly defined elements. First role and responsibility, what exactly this agent does. Second tools, what tools or external data it can access and use, and then input what is the required input from the user. Workflow details. This is super important as it will make the agent's behavior much more reliable. Important guardrails. What are the boundaries and must-follow rules? Output format, what is the output look like or success criteria? You can even include things like error handling, how it will handle different unexpected situations. So the more details you define, the better will be the agent quality. Another important note is that you'll need an API key from those AI models or service provider in order to connect your agents to these systems. So take some time to set up all those API keys before you start building. For example, like perplexity, you need to create a separate new API key for your agent's access. So here is my simple three step framework to build your AI work team using what I call a building block approach. First, map your workflow. Identify two to three repetitive or key tasks in your daily work process. Is it research, copywriting, data analysis, or anything else. The key is to keep them distinct enough. Next design your AI agents or specialized AI assistant. We'll be using an AI agent designer to design whatever AI agents we want, which I'll show you in a minute. And finally we'll add a manager agent. So this is like your ultimate work assistant that helps you to delegate and coordinate different tasks between different AI assistant. So each AI assistant is like a block or specialized module where you can plug to this manager at any time to ensure scalability. For this video, I'll be using the no-code platform n8n. It's good for non-technicals, but the same concept applies to other no-code AI agents building platforms. Now if you are also thinking about building AI agents for your organization, I want to share this free ebook, Master AI Agents from HubSpot. I've put the download link in the description. This eBook focus on the strategic side of AI agents. It's designed for anyone looking to deploy AI agents at scale in their business. It covers the current state of AI agents, high impact use cases across marketing, sales, and operations with real world examples. So you get more AI agents ideas you can build. You'll also learn how to identify some proven low risk starting point to deploy AI agents, common pitfalls, and even a practical checklist to guide your organization through each stage of the implementation. What I like is that it comes with a step-by-step execution roadmap so you have a clear directions on the important areas to focus on at each stage. I recommend you download this in a description below for free. And thank you hotspot for sponsoring this video. Alright. Now we'll use this framework to build a three agent work team in this work team demo we'll have a manager, and underneath we have a competitive research agent and a data visualization agent. What kind of agent doesn't really matter. What's more important is you know, the concept behind, so you can use the same method to build your AI work team. ******** Let's start with the research agent first. So we will have this AI designer to help us to design the AI agent prompt. So you can use whatever AI models like ChatGPT, Gemini, but make sure it is a reasoning model for more thoughtful outputs. And we will use this project instructions to generate a set of ready to use system prompt for whatever agents we're going to build. So I would just describe what I want this agent to do. For example, it will use perplexity to do research and create a Google Doc and then return the document link to me. So you can see the agent prompt output is really detailed and it will give you the proposed list of tool access as well. But make sure to review and make adjustment and never just accept what it gives you. Now we are ready to create this agent on n8n, create a new workflow. Let's just call it competitive research agent, then add an AI agent. Now you can see clearly the structure of an AI agent. We have model, memory and tools, and let's do it one by one. For AI models, I'll just pick Claude Sonnet 4. But you can pick whatever model that you want, but note that for every model service, you must set up the credential first. And then add the memory. So memory is not mandatory, but it's super beneficial since it allows the agent to retrieve or update knowledge and learning into your own database. But for the sake of demo, we will just keep it simple and use the simple memory tool. So keep the default context window length to five, and that means the agent will only retain the last five messages at maximum. Now according to the system prompt, we will add three tools, the perplexity search, Google Doc read function, and the write function. First let's add the perplexity node. For the sake of demo, I'll just pick the sonar mode it is most cost effective, but you may want to use Sonar Deep research if you want more in-depth research. As for the message, we'll let the AI model to decide. So once done, you can test it just to make sure everything is connecting properly with a testing query so you can see it's working fine. And next we'll add the Google Doc node for reading company information. Under the operations we will need the get function. So let's say I have this company information about my brand Miro and I want the agent to always access this information as part of the research. So just copy this document link and then paste it back on n8n. Again, test it quickly and you can see the content is retrieved successfully. Now add another Google Doc. Create function. So keep all the same settings, but this time pick "Create" under operation, pick the right folder name. So this will be the folder that this research agent will save the report. For the title, we will leave to the AI model to the decide. So let test it by creating a testing document so it will return the document id, that means it's working. And then also add one more Google doc node for the update function. For the document ID and the actual body content, we will let the AI model to decide. Also, rename them to keep it organized. Now the final step is to add the system prompt for this AI agent. So whenever we trigger the workflow, it knows what to do. So click on the AI agent, under option pick system message. So here you can define the system prompt for this AI agents and then we can paste back the system prompt we just generated. Note I have simplified it and to keep the final report length, no more than 800 words just to showcase the demo. Now the agent is ready. Let's try this prompt to ask it to research about Figma, including the business model, key products and market position, and how it impacts our strategy at Miro. So you can see it would trigger all the nodes starting from perplexity, and you can always click the log to see the details or in case any errors occurred, it is super helpful to debug. Then immediately the insights is ready with recommendations and the report link where you can open, and this is amazing with the title and key sections. And you can always adjust the report length, formatting, beautify it using the system prompt. The only complaint I have is it didn't went through the Miro document. So this is the good chance for you to review the system prompt and to make improvement. And the best thing is the whole process just took me less than 15 minutes. So don't think AI agents have to be super complicated. Now we are not done yet to make an AI work team that should be more than one AI assistant. So this time we are going to build another data visualization agent and it is easier than you think. ****** So we will first ask the AI agent designer to generate a set of system prompt for this visualization agent. For this agent. It will turn any Google Doc report link into a visualization dashboard and send an email to me. And you can see the generated system prompt is super detailed, but always make changes using your own judgment to see if that makes sense. Now create a new workflow on n8n and call it visualization agent. So I will keep using the Claude Sonnet 4 model, but this time also set the maximum number of tokens to at least 8,000. As for visualization generation types of tasks, it usually requires more tokens to avoid message output cutoff. And then also add the memory tool. For the tools according to the system prompt, we'll need the Google Doc for retrieving the report content and Gmail to send the email. So first, add the Google document nodes for reading reports and let AI to decide the document ID and always test it. And then also add the Gmail node for sending emails. Pick the send function, and set recipient, subjects and body message to be decided by the AI model. And in case you're building an agent that needs to get email, reply email, you must add them one by one again, test it by sending a testing email. And then finally paste back the system instructions for these AI agents we just So everything is ready now. We can try to ask it to prepare the dashboard for this Figma research report we just generated. And then you can see it is executing the nodes from Google Documents and then back to Claude for generating the visualization. And then finally sending the email. And then within a minute it says the email has been sent with the actions it took for the visuals. I also received the email and I like the email subject line, and the email is exactly what I want with the typical visual style from Claude. And you can always adjust the dashboard format, like color, style, width, or adding additional message using the agent system prompt. So with no more than 10 minutes, we have built this simple agent to do all kinds of visualization and communication tasks for you. You can adapt this for any recurring data visualization or stakeholder communication needs. You can even connect to your Google Sheets or Google Drive folder, so there's so many possibilities. Okay, we are ready to build our AI work team. So we will have a manager agent about these two AI assistant, and it will help to delegate and coordinate the work tasks. So this manager is just like your ultimate work assistant managing your team. ****** First, let's quickly create a system prompt for this manager and describe its major role to delegate the tasks, then make adjustment as needed and save it for later use. Now before adding the manager agent, we will first need to make some small tweaks to the two AI assistant as we going to connect these two assistant to the AI manager. So on the research agent first remove the memory as the memory is going to be maintained at the manager level, and also just to make things easier to manage. And second remove the chat message trigger. So that is because we no longer directly work with this assistant, but to delegate it to the upper manager. So we will pick the node "When executed by another workflow", and that means this research agent will now receive command from the manager agent we are going to create. And then we'll define a field, just give it a name called query, and the name is totally up to you. And then connect it to this agent. And finally click this AI Agents. We'll change the prompt message field for this AI Agent as we no longer use the chat input trigger. So under the source for prompts, select define below, click expressions and type {{$json.query}}, which is the query field we just defined, and then save it. And then repeat the same and make the same changes for the visualization agent. Once you are done, we are going to create a manager agent. Again, add a new AI agent. Repeat the same process to add the AI models and simple memory. For the tools, this will be connected to the two AI assistant we just created. So this manager will supervise these two assistant and route the tasks when needed. So in the tool list, search for Call n8n Workflow Tool. So these node allow us to trigger any existing agent workflow we have created. So under the list, let's first select the research agent, and then you will see there is a field called query under the workflow input. So that is the field we just defined. And then also rename it as research agents, just to make things clear and organized. And then also do the same for the visualization agent by adding another trigger workflow tool. Now we are almost done. The last thing is to add back the system prompt for this manager agent. So paste back the system prompt we just created and then click save. Okay. This is so exciting. Let's try this prompt to ask it to research about the brand FigJam, and at the same time to visualize the report insights and send it to me. So you can see it would immediately call the research agent and then to the visualization agent, it is all handled by this manager and after around four minutes , it returned output for me and it looks great. You can see the manager specified how each of the tasks are handled and with the report link, which is nice, and it ensures everything has been delivered at the end of the message. and we can just click the link to open the report. And it looks the same as if we are directly working with this research agent and also the email with the dashboard. It looks amazing with all the report details, the charts, the visual storytelling elements. And so now you already have this small AI work team, and the best thing is using this method is much more scalable in case you want to add a new assistant or AI workflow to this team, you can just add it to the manager. And remember, each assistant should be simple, so it's much more easy to manage and maintain. And you can even enable the public chat with the authentication. So you really like having a dedicated manager to manage your work process. So don't think you need to make AI agents super complex to start generating values for your work. A simple system is always the most reliable and scalable. If you want more inspiration, join my community. You'll get access to all my tested prompt I share on my channel and other featured content. You can find the link in the description to join. And before you go, I highly recommend you check out this video about MCP and you will know why this is the next big thing for AI agents. I'll see you next time.