Transcription
Feeling completely overwhelmed by NAN? It looks complex with hundreds of nodes. What if I told you that these 19 nodes are all you need to build 90% of all workflows? Forget the rest. Master these and you will master an A10.
So the first set of nodes that we're going to take a look at are responsible for starting a workflow. And if we take a look at this web hook, it provides us with this test and production URL that can be used by external application and services to send some data in. And once the data is received, this will automatically start the workflow. Here is an example of one of my WhatsApp social media chatbots. You will receive a message through a web hook. You will extract the message, pass it to AI agent so it can be understood and processed. And then we're going to generate response and send it back to WhatsApp. And even though this workflow is active, it will only get triggered once you receive the message.
So next is the schedule trigger. This is like an alarm clock for your workflow. It can run at very specific time or maybe at repeatable schedule, for example, every 15 minutes or maybe on Monday at 9:00 a.m. And if we look at the schedule trigger rules, the interval is very flexible. It can be set to anywhere from months to seconds. It can trigger in between the days at specific hour, specific minute, and you can add multiple rules.
The time form trigger, it's not native to NA10. It is specifically designed to work with the time form account. So in order to use it, you have to connect yours and then it's designed to specifically listen for specific events like form submission. So imagine if user is trying to fill in the contact details account on submission. This will trigger this node. This node will grab all the information from that form and pass it onto the workflow.
The manual trigger, it's like a play button for your workflow. It's the most basic trigger and it does absolutely nothing until you inside the NA10 editor and you click execute workflow. It's the number one null that you will most likely use to build and test your workflow. Before you set them to run automatically, you will use this trigger to run it just once and check that the message has correct format. And if we look at inside this node, it doesn't have any parameters. So there is certain limitation to what you can do.
Think of the error trigger as your workflow supervisor. It does nothing on its own. Its only job is to watch all the workflows when they fail or break. And if we take a look at the sample response from that trigger, it has all the information about the workflow and the reason why it has failed. So just to help you understand this better, I have this AI voice assistant appointmentuler that has four different NAN workflows. Now each of these workflows have their own error handling. However, that doesn't mean they can handle everything. Imagine if we try to schedule an appointment. That would include creating a consultation in the calendar and storing the entry inside the database. Now, imagine if this database is down and the record could not be stored. That would result in a failure which would have been captured by this global error handling workflow that would take the message from the failing workflow, pass it onto appropriate channel like Slack. So I could see the message and take an action.
Lastly is the response to the web hook. Now, do you remember when I said the web hook is like a digital doorbell for your workflow? Well, this is the answer to the ring. Once your application finished processing all the information, this will grab that message and send it back to the application that has requested that data. This step is absolutely critical if you need to respond with information. And if we take a look back at my AI voice assistant, we have a web hook that triggers the appointment schedule. It will then set personal details, create a consultation inside Google calendar, and if that has created successfully, it will store an entry in the database. Then this will be prepared in the response and that response will be sent back using the response to the web hook node to the application that has requested to schedule an appointment. And what's important to remember is that respond to the web hook is optional and it's only required if you need to respond back with information.
All right, so we've covered the triggers that start your automation. Now let's talk about the most powerful part, call logic and flow control. These are the brains of your automation. They act like a traffic cop looking at your data, making decisions. They tell your workflow where to go, when to wait, what to do if something happens, and how many times to repeat an action.
Let's start with the if node. It is the most basic decision maker in your workflow. The if node allows you to set conditions based on the incoming message and then route the message down one of two paths. True if there is a match on this condition, false otherwise. The if node is also very flexible. In this case, we're using true and false. However, we could literally disconnect this and this workflow would still be correct.
Now you could say a switch statement is a bit more powerful because instead of simple yes and no, it can look at a piece of data and can route your workflow down many different paths. And if we look at the example I have created for the social media, it can receive a request from WhatsApp, Instagram and messenger. That message is then passed to AI to generate the response and then we're using a switch statement to respond to the correct channel based on the message type. The most crucial thing to remember about the switch, if there is no match on any of the rules, the incoming message will simply get ignored.
The merge node is actually a little bit different than if and switch. It is designed to bring separate branches together into a single stream. Now imagine if this was an order processing service. Here we would have orders over $50 with free shipping. For anything below, we would add $5. And at the end, we want to send an email confirmation regardless of the choice. So, I would need to connect both of the free shipping and the $5 shipping choices to a single merge node. Now, it doesn't matter which path the order has took. It gets fumeled back into a single stream. So, then I can connect it to a different node and send my email confirmation.
The loop over items. This is your assembly line worker. When you have a batch of items that you need to process in a specific order like maybe a list of emails or maybe a records from spreadsheet, this node will take that batch and process them according to this batch size. And the replace me node here is the action that you want to take for each element that you're processing. So here I have an example where I process files from a Google drive. The file gets downloaded, converted into a file and then we process individual records one by one. And this is then inserted onto this Postgress database. And the reason we processing one by one is because if we get an error, we want to count that error because later we consolidating all the errors to be sent as a status email.
Finally, there is also another node that I forgot to add, the weight node. And the wait node does exactly what. It will wait for a configurable amount of time before continuing with the workflow execution. Now imagine if you have a user that has signed to your website and you want to send a welcome email. Let's say after one day, you would configure the wait node to wait for exactly one day before continue with execution and sending the email.
Next up, we have the data manipulation nodes. If triggers are the front door and logic nodes are the brains, then these nodes are the factory floor. Their job is to do the actual work. They take the raw data you've received. They clean it, reformat it, change it, combine it, and build a new data from it. You will use this in almost any workflow.
The edit field node is probably one of the most used nodes in the NA10. Its job is to rename, change, create, or delete data fields. Let me show you an example here from the delete appointment request. The request that we get back is pretty large and it has a lot of information that we don't really need. So we can use this node to set only the information that we require. And from now on we only pass in the JSON with the data that we need inside our workflow. It's much easier to understand and modify.
The split out node allows you to take a single element which is a collection of item and take an action on each one. So imagine if we're trying to process this XML file with 13 records. We would receive this file as a whole and once it gets to this node, it would still be a single collection with all the records. But this would allows to split those record individually and take an action on each one.
The aggregate is totally opposite to split out. If we take our records file as an example again after we've done some processing on each individual file, let's say we want to aggregate this back into a single file for efficiency. So then we can take the whole file and send it just once to a different application outside our workflow. So here is a quick example of both of these fields in action. I have created this aggregate split example where we have extracted an XML file that has 12 items. And if you want to aggregate those 12 items into a single list called data, all we have to do is specify the name. Click execute step. And now we have a single item called data that has 12 elements inside. And let's say if we're only interested individual field, let's say an order number, all we have to do is drag it here. Click execute step and now we are tracking just all the numbers. So imagine we have done some processing on that collection and let's say we need to now store them individually. So we would add this split out step again. Specify the name of the data which is the name of the list that we want to split out. Some options if you want to include any other fields or maybe any specific fields. Assuming that's not the case, we just click execute steps and now we have 12 individual elements.
Again, the code node is the most flexible of them all. When no other node can do exactly what you want, you can use the code node to write some JavaScript and transform your data any way you want. And all you have to do is just select the language. Currently is JavaScript. The Python is in beta and write some code to transfer your data.
Okay, so your workflow has started, the logic has run and your data is perfectly clean. What now? You need to do something with it. This section connectivity and storage is all about input and output. These are the nodes that let your workflow talk to the outside world. They fetch the data from other services, deliver your final process data to its destination. Whenever that's a database or any other application on the internet.
The HTTP request is very flexible. If NAN doesn't have a dedicated node for the application that you're trying to use, you can use the HTTP node. It's super flexible and it allows you to talk to almost any API by sending and receiving data. And if we look at my social media example, I'm using here HTTP node to respond to WhatsApp, Instagram, and Messenger. And if we look inside the HTTP request, we all we have to do is supply the URL of where we want to send the message authentication for the security reasons as well as the message content which in this case is to reply to my WhatsApp chatbot.
Next is the super basease. It's very flexible and can be used either as a data source or data destination inside your workload. You can store and retrieve AI memory for the conversation or vector embeddings to retrieve information. You can also build realtime automation using the superbase events. It's very flexible and can be used either as a data source or data destination inside your workload. You can store and retrieve AI memory for the conversation or vector embeddings to retrieve information. You can also build realtime automation using the superbase events. Finally, it can manage authentication and user data using their superbase API and it can be combined with any large language model for AI powered automations.
Next, we have the NA10 data tables which is their native storage solution for information and those are perfect if you just want to store some information inside your NAN workflow and you want to avoid the configuration of an actual database. And if I look at one of my existing automations, I could have probably used data tables here because I was only trying to store very basic information that didn't have to be exposed to any external systems. So the data tables would make perfect sense here.
The AI agent isn't a simple node. It's the brain that you can give it a task, a set of tools, and it can then reason, make decisions, and use those tools autonomously to achieve the task. There are three core components of an AI agent. A model which is the connection to your LLM like OpenAI. A memory that allows the agent to remember the conversation and the tools that allows an agent to take an actual action. The configuration of the agent is also pretty straightforward. To add Open AI, all you have to do is generate API key, add it to your account, select the model from the list, and you're good to go. For the chat memory, you have to configure the database, give the table a name, and specify the context window, which is basically the number of messages the agent will remember when having conversation. Finally, we have the list of tools that you can choose from. The list is very big, so their agent has a lot of capabilities to do things on its own.
So just to give you a quick example, if you go back to my example of the social media request, here we have the generic AI agent that helps us define incoming messages using the specific format. So we're using the tool to pass the output to ensure that we have consistency throughout our messages because we have different channels where the messages are coming from. What we're trying to do here is set unified format. There is no limitation on the number of tools that you can add. Let's say you would like to add calendar appointments based on the conversation that you're having. Um, it's possible. All you have to do is just add Google calendar tool and the AI agent will be able to book appointments. Same with the extra information from the database. Let's say you wanted to add an extra data storage to store and retrieve information to support the user queries. That's also possible. You can add the Postgress tool additionally to the calendar and provide the extra information. You could even add HTTP request tool if you wanted to look up information about the orders from third party APIs. Let's say a user has a query the order has been late. You could use HTTP request, ask for relevant information, send the request to a third party and update the user with the other information. So, what I'm trying to say here, the options are endless and there is a lot of different tools that you can use.
That's it for today. Hope you have enjoyed the video and if you did, please consider leaving a like. Until the next time.