[EXPLAINED🍄] AI Agents vs. Workflows

Brief Summary

This video explains the significant difference between traditional workflow automations and AI agents, particularly in customer support. It uses a real-world example from the speaker's business, Blot, to visually demonstrate how AI agents offer more flexibility and power compared to hard-coded workflows. The video also addresses the challenges in adopting AI agents, including the probabilistic nature of LLMs, cost, security, and interoperability.

  • AI agents dynamically plan and execute tasks, adapting to various scenarios without manual hard-coding.
  • Traditional workflow automations require predefined paths and manual handling of edge cases, making them less flexible and more time-consuming.
  • Challenges in AI agent adoption include the probabilistic nature of LLMs, cost, security concerns, and interoperability issues.

Introduction: AI Agents vs. Workflow Automations

The video introduces the concept of AI agents and compares them to traditional workflow automations. It highlights that while workflow automations have been the norm for decades, AI agents offer a more powerful and flexible approach. The speaker aims to explain the difference using a real-life example from their business, Blot, focusing on customer support. The video will visually demonstrate the contrast between building workflow automations and AI agents, emphasizing the advantages of AI agents and discussing the challenges of their broader adoption.

Traditional Workflow Automations

Traditional workflow automations involve creating multi-step workflows to stitch together APIs and automate tasks. These are known as robotic process automation (RPA) in enterprise settings and workflow automation in SMBs, utilizing tools like Zapier, Make, Naden, and Pipere. However, building and maintaining these hard-coded workflows is slow, brittle, and requires repetitive code to handle numerous possibilities and edge cases. The speaker illustrates this with an example showing multiple branches of logic depending on the use case.

AI Agents: A New Approach

AI agents offer a contrasting approach by allowing users to connect tools once and then instruct the agent in plain English. The agent dynamically plans actions, determines the order, and recovers from errors without manual hard-coding. The speaker uses their Stripe AI agent in N8N as an example. This shift from hard-coded branches to AI agents is crucial for achieving faster, more flexible, and more powerful AI automation.

Real-World Example: Customer Support in Blot

The speaker uses their AI app, Blot, to illustrate the difference between workflow automations and AI agents in customer support. They use Intercom, a support tool with a workflow builder, to handle billing-related questions. The example focuses on a refund workflow where customers who accidentally upgrade during a free trial might request a refund. The workflow includes messages explaining the free trial terms and options for the customer, such as requesting a refund, applying a promo code, messaging the founder, or acknowledging the information.

Refund Flow: Workflow Automation vs. AI Agent

The refund flow begins when a customer selects "I still want a refund." The system processes the request and calls the Stripe AI agent in N8N. The key point is that canceling a subscription and refunding the last charge requires only one step with the AI agent. In contrast, traditional workflow automation would involve multiple steps, such as retrieving customer information, making custom API calls to Stripe, getting a list of customer charges, calling the refund endpoint, summarizing changes with ChatGPT, and sending the summary back to the support tool.

Additional Use Cases and Limitations of Workflow Automations

The speaker explains that handling additional use cases, such as applying a promotion code or canceling an expired subscription, requires building separate workflow automations or adding branching logic to the existing workflow. The Stripe API is extensive, and there are numerous combinations of actions that can be taken. The weakness of traditional workflow automations is that each workflow path must be hard-coded, and edge cases must be handled manually by the developer team.

AI Agent Implementation: Stripe AI Agent

The speaker demonstrates how their AI agent handles the same use cases. The AI agent has a web hook and a prompt that defines its task: to analyze requests using a set of tools. The AI agent formulates a plan, follows it, and summarizes its actions. To set up the AI agent, the speaker attaches the necessary tools, such as API calls to get customer information, retrieve charges, cancel subscriptions, refund charges, and apply promo codes. With access to these tools, the AI agent can perform any combination of actions without hard-coding each path.

AI Agent in Action: Canceling Subscriptions and Applying Discounts

The speaker illustrates how the AI agent simplifies tasks in the Intercom workflow builder. For canceling a subscription and refunding a charge, the instruction to the AI agent is simply "cancel subscription and refund last charge." For applying a discount, the instruction is "apply this particular promotion code to their active subscription." The AI agent understands these natural language instructions and performs the actions accordingly. The speaker also shows how to view previous runs of the AI agent in N8N, including the exact steps taken to handle each request.

AI Agent Decision-Making and Execution

After setting up the tools, the AI agent dynamically analyzes the task, plans the next steps, and decides which tools (API calls) to use. It orchestrates everything in a logical sequence to accomplish the task. Once the planning is complete, the AI agent executes each action and reflects on the result. If something fails, it tries again or attempts a different approach. The AI agent uses only the relevant tools for each task, avoiding unnecessary API calls. The key advantage is that the speaker does not have to hard-code these steps; the AI agent dynamically decides what to do based on the task and available tools.

Customer Summary and AI Agent Prompt

The final step involves outputting a summary of the AI agent's actions, which is returned to Intercom and forwarded to the customer. This summary is not hard-coded; the AI agent generates it using ChatGPT based on the actions it took. The AI agent's prompt includes the task to summarize the actions, and the summary varies depending on the request, such as applying a promotion code, handling an incomplete subscription, or canceling and refunding an active subscription.

Best Practices: Guard Rails for AI Agents

The speaker discusses best practices for building AI agents, emphasizing the importance of guard rails due to the probabilistic nature of LLMs. Guard rails tell the AI agent to only perform specific actions or to seek human approval before making high-risk decisions. In the speaker's setup, they control the message passed to the AI agent, preventing customers from directly interacting with it for sensitive use cases like billing and subscriptions.

Challenges in Production and Future of AI Agents

The speaker addresses the challenges in deploying AI agents in production, noting that it is still early days for widespread adoption. Key challenges include the probabilistic nature of LLMs, cost and performance issues, security concerns, and interoperability. The probabilistic nature of LLMs requires guard rails and LLM operations. Cost and performance are affected by the latency of each API call. Security is a major concern, requiring secure credentials and the enforcement of least privilege. Interoperability can be improved through model context protocol (MCP), which enables AI agents to connect securely and efficiently to various services. Despite these challenges, the speaker is optimistic about the future of AI agents, highlighting their power to dynamically decide actions and handle edge cases.

Summarize any YouTube video in seconds

Get summaries like this one for any video, in your language, with the free Summ app.

Download on the App Store
Get it on Google Play

Transcript

Full transcript of “[EXPLAINED🍄] AI Agents vs. Workflows”. Click a timestamp to open the video at that moment. Need another video? Use the YouTube transcript generator.

0:00 Why are AI agents so much more powerful than workflow automations? In this video, I'm going to explain the difference with a reallive example that I use for customer support in my business, Blot. You're going to visually see the difference between building workflow automations to handle the same set of use cases versus building an AI agent that can handle multiple flexible use cases. You're going to learn the power of AI agents, why everybody's super excited about them, and then I'm going to close the video with a discussion of the challenges to broader adoption of AI agents. For decades, the norm has been creating multi-step workflows to stitch together APIs and automate tasks like this in make.com. In enterprise, this is called robotic process automation or RPA. In SMB, this

0:45 is called workflow automation with popular tools like Zapier, Make, Naden, and Pipere. But building and maintaining hard-coded workflows, it's slow, brittle, and involves a lot of repetitive code and logic to handle dozens of possibilities and edge cases. In this example here, I'm going to walk through in more detail. You can already see three different branches of logic depending on the use case. AI agents, in contrast, let me show you in N8N. This is my Stripe AI agent we're going to be diving to in a bit. AI agents let you hook up tools once and then simply tell your agent what you wanted to do in plain English. And then the agent dynamically plans which actions to take in what order and even recovers from

1:31 errors without manually hard- coding every single edge case. So understanding that leap from the old way of doing things over here with hardcoded branches for every single scenario to the new way of doing things with AI agents is really important if you want faster, more flexible, more powerful AI automation. So let's dive into a real example. For my AI app, Blot, I use a support tool called Intercom, which also has a workflow builder, which I hate, by the way. It's very clunky and ends up looking like a mess like this. So this is a workflow to handle questions related to billing. So the flow I'm going to talk about today is the refund workflow here in orange. So what happens though is a customer is like oh I have questions with billing. Okay. Then they

2:16 see these options. Let's say they select I accidentally upgraded during my free trial. So now this will go to this path over here. This explains what's included in the free trial. people like don't read sometimes and they don't realize there's explanations like certain features are just not included in the free trial which is totally normal um but they'll click things anyway there's a confirmation popup they'll click it anyway and then they'll email me like oh why was I charged okay so I want an automated way to handle that so here the customer sees this message just explaining like what's included not included and then they have the option I still want a refund I want to stay but it's expensive which will actually just apply a promo code to their account. They have the option to message me, the founder, and they have the option to

3:02 say, "Oh, okay, cool. All good. Thanks." So, now let's talk about the refund flow. So, let's say they choose, "I still want a refund." Then it goes up here to this refund request. And this looks complicated, but most of it is just like messages. So, first the AI agent says, "Okay, give me a moment. I'm processing your request." And then we call my Stripe AI agent in N8N. And the neat thing about this, if you open it up here, is all I have to do is type what I want in natural language and the AI agent will figure out how to use its set of tools to accomplish this task. The key takeaway here when I open my Stripe AI agent node is that to cancel a subscription in Stripe and refund a last charge, all it took was this one step, one call to my N8N Stripe AI agent. But

3:48 in the old way of doing things, just this piece of logic, cancelling a subscription and refunding the last charge would involve multiple steps in your workflow automation. So here's how it would really look. For example, if you were building this out in make or some other workflow builder. So to cancel a customer subscription, that's this middle row over here. First, we get information about the customer. Our support tool intercom would call this web hook and pass the customer ID. Then for all possible branches, we likely need to retrieve that customer's information. So this calls the get customer endpoint in Stripe. And then depending on what you want to do next, you'll have like different filters and rules depending on which path to take. So to cancel the subscription and refund the charge, that would be this flow here

4:34 in the middle. First, you'd grab the customer subscription ID, which you get from this step. Then you would make a custom HTTP call to the Stripe API to cancel the subscription because it's not a pre-built action. Then to refund the last charge, you would get a list of the customers charges. Then you would call the refund endpoint. Then you would call chatgpt to summarize the changes made. And then you would send that summary back to the web hook in my support tool. And that's just one possible workflow. Now let's say you want to handle the case where a user wants to apply a promotion code. you need to build another workflow automation or add branching logic to this current workflow. So this top row over here is to apply promotion code. We take the stripe subscription ID from the get customer step. Then we apply promotion

5:20 code to their subscription. Then chatbt again summarizes the changes and sends the summary back to the web hook. And then a third use case is to cancel a customer's expired or incomplete subscription in Stripe, then restart their free trial. This happens sometimes when like somebody cancelled but then they restart later and Stripe treats it as incomplete or expired. So the first thing to do is to find that incomplete or expired subscription. Here I'd just have a code step to do it otherwise it's it's kind of painful to do it in make.com. And then I'd cancel the subscription. I'd recreate their new subscription and then again an AI summary and send the summary back to the web hook. And again, you could build these three distinct workflows within one mega workflow like I'm showing here with branching logic or keep each item

6:07 in a separate workflow. But the Stripe API is extensive. These are just three things you can do with it. But there are so many more combinations of actions you can take. What if you want to cancel a subscription, refund them, put them on a higher tier subscription, and apply a promo code? So, one of the weaknesses of traditional workflow automations is that you or your developer team, they have to hardcode each workflow path and handle edge cases manually. Now, here's how it looks in my AI agent that handles all three of these use cases. Okay, this is my Stripe AI agent. It has a web hook just like my previous one. And the cool thing here is you build this AI agent has the prompt here for what it's supposed to do. Your helpful AI agent, you have access to the following tools.

6:52 Here are some sample stripe object IDs just so it knows like the formats and then its task is to analyze the request. So it can be any request that uses any combination of these tools and then the AI agent formulates a plan to complete the request and then here is the request that I'm passing in. It follows the plan and summarizes its actions and final changes in second person voice. All you have to do to set this up is attach the tools that you want the AI agent to have access to. So here I'm going to give it access to 04 mini because I want a reasoning model for important use cases like this. This is the API call to get a customer. This is the API call to get customers last stripe charges. This is the API call to cancel a subscription.

7:38 API call to get a subscription. API call to refund the charge. And API call to apply the promo. Once your AI agent has access to these tools, it can perform any combination of actions that use these tools. So instead of having to like hardcode each path like this, apply promo, cancel and refund, find the incomplete subscription, cancel it, and then recreate the subscription. In contrast, the AI agent, you just hook up the tools once, and it can handle all three of those use cases, plus additional use cases that can be done with this set of tools. So now if you go back to our workflow builder in intercom, what that looks like is this. So for cancelling the subscription and refund, all I have to tell my AI agent is cancel subscription and refund last charge. Like that's it. That's the only

8:25 instruction that we're giving the AI agent. Now let's say we want to apply discount. So here this is the message sent to the customer and then this is a call to our AI agent. So let's open it up. And this is the only instruction I give it. apply this particular promotion code to their active subscription. So in natural language, it's able to just understand what that means and perform the action. And here in N8, if you open up executions, you can actually see previous runs of your AI agent. So I opened up one from yesterday, May 9th, and then I'm going to zoom into the Stripe AI agent over here. Click go ahead and click on that to open it up. Click logs on the right hand side and you can see the exact steps that the AI agent took to handle this request. You can see over here the requested action

9:11 was to cancel the subscription and refund the last charge. So first the AI agent retrieved that customer subscription. Then you know it thought about it. This is the AI and tool log so you can debug things. Then it decided to cancel the subscription by calling this endpoint. Then it got the charges for the customer and then it refunded the charge. But basically after hooking up the tools for the AI agent, each distinct API call is now a tool and the AI agent can dynamically analyze the task at hand, plan what to do next, decide which tools to use, for example, which API calls to make and how to orchestrate everything together in a reasonable sequence to accomplish the task. Once it's done planning, it goes ahead and executes each action and then reflects on the result of each action.

9:58 Like, did something fail? Should I try again with the same thing or try something different? And then it moves on to the next action until it completes the task. For example, if you give the AI agent instruction to apply the promo code, it's going to use only the tools that are relevant for that task. It won't call the API to refund the charge since it's irrelevant to that task. And the key point here is that I did not have to hardcode all of these steps, right? If you look at our make scenario corresponds to this middle row like each step is pretty much laid out for that path. But in NAN the AI agent just figured out what to do like it decided these are the steps that makes the most sense to take. And that's the key point. The AI agent dynamically decides what to

10:44 do given a task and a set of tools. I didn't have to manually stitch together all those multi-step workflows and branching paths and edge cases. Now, here's what the last step looks like to the customer. Output a summary of what it's done. Here's the summary. It's returned to my support tool intercom, which then forwards it to the customer. This is the actual message that is seen by the customer after the AI agent is done processing their request. And again, this is not hard-coded at all. Like the AI agent just using chat wrote this summary based on reflecting on the actions it took. So if we go back to our AI agent, let's open up the prompt again. You can see the third task assigned is simply to summarize the actions. And you can easily imagine that

11:29 that summary will look a little bit different depending on what the request is. Whether it's applying a promotion code an incomplete subscription or cancelling and refunding an active subscription. In terms of best practices for building AI agents, you'll hear the term guard rails often in relation to LLMs. This is due to the probabilistic nature of LLMs, which means that running the same prompt or agentic flow a 100 times can yield different results. And the purpose of guard rails is to tell your AI agent like only do these actions or always ask a human before proceeding with a high-risisk decision. That way, your agent won't run wild or make very expensive mistakes. One way I kind of have guard rails is that I'm still

12:14 controlling what message is passed to the AI agent. It's not like the customer can just type anything and then it's passed to the AI agent. I just type it here. Cancel, expired, or incomplete subscription. And that's because this is a really highsensitive use case that deals with billing and subscription. You can imagine a less sensitive use case where the customer just interacts with the AI agent and can say whatever they want, make any requests they want. your guardrails will look a little bit different there. To wrap up, I'm going to talk about the challenges in production. So, overall, I believe it's still very early days for AI agents in production. There really aren't many companies outside of Fang and big tech and the top startups that have deployed AI agents successfully in production at scale. Some of the key challenges slowing down broader adoption of AI

13:01 agents is number one, the probabilistic nature of LLMs is very different from the software we've been writing for decades and decades. All of our systems are built around deterministic software, meaning software that produces the same result every time. Whereas with LLMs, you can have wildly different results when you run the same prompt or a gentic flow 100 times. And so guard rails are really important. test cases and what's called LLM operations is really important and an emerging field. Another issue in production is cost and performance. So every single API call adds latency. So it slows down the time until the customer, for example, gets an answer and it increases the cost. So traditional workflows can be much more

13:46 predictable from a cost perspective at scale. probably the biggest issue. We're talking about an AI agent that has access to critical tools in your business. And so, how do you ensure that the AI agent doesn't do something it's not supposed to do? Make sure your AI agent has secure credentials. Enforce the concept of least privilege. If it doesn't need access to certain endpoints, for example, writing or updating data, then make sure it doesn't have it. And the last challenge is around interoperability. And this is where MCP or model context protocol comes in. You can think of MCP like a universal interface that enables AI agents to connect securely and efficiently to many many many different services without writing custom connectors for each service. Overall, I'm quite bullish on AI agents, but

14:33 there are very real world challenges that are kind of slowing down its broader adoption. But I hope with the example we walk through today, it's much clearer now the power of AI agents. And you hook up tools once and then simply tell your agent what to do in natural language. And then the AI agent dynamically decides what actions to take in what sequence and can even handle edge cases and recover from errors. In the Stripe example we talked about, we only hooked up tools related to Stripe, but imagine you have other systems, other business systems. You need the AI agent to interact with, for example, Stripe and HubSpot and some other marketing platform and your newsletter platform. You can imagine an AI agent equipped with a variety of tools from

15:21 different service and then deciding, okay, I'm going to update HubSpot right now. I'm going to update Stripe over here instead of having to build like all of those paths manually. The more services you have, the more API endpoints there are, the higher the number of combinations of actions there. Hope this video is helpful. Hit like, hit subscribe, and drop a comment below. would love to hear from you.

Share

More video summaries