{"id":2664,"date":"2025-03-27T07:02:23","date_gmt":"2025-03-27T07:02:23","guid":{"rendered":"https:\/\/mailitics.com\/index.php\/2025\/03\/27\/automate-supply-chain-analytics-workflows-with-ai-agents-using-n8n\/"},"modified":"2025-03-27T07:02:23","modified_gmt":"2025-03-27T07:02:23","slug":"automate-supply-chain-analytics-workflows-with-ai-agents-using-n8n","status":"publish","type":"post","link":"https:\/\/mailitics.com\/index.php\/2025\/03\/27\/automate-supply-chain-analytics-workflows-with-ai-agents-using-n8n\/","title":{"rendered":"Automate Supply Chain Analytics Workflows with AI Agents using\u00a0n8n"},"content":{"rendered":"<p>    Automate Supply Chain Analytics Workflows with AI Agents using\u00a0n8n<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n    <!-- no image --><br \/>\n \t<BR><br \/>\n<BR><\/BR><\/p>\n<div>\n<p class=\"wp-block-paragraph\">Why build things the hard way when you can design them the smart way?<\/p>\n<p class=\"wp-block-paragraph\">As a Supply Chain Data Scientist, I\u2019ve explored various frameworks like LangChain and LangGraph to build AI agents using Python.<\/p>\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/1200\/0%2AMIkUGSpK9uWT1-Q2.png?ssl=1\" alt=\"\"><figcaption class=\"wp-element-caption\">Leveraging LLMs with LangChain for Supply Chain Analytics\u200a\u2014\u200aA Control Tower Powered by GPT\u200a\u2014\u200a(Image by Samir\u00a0Saci)<\/figcaption><\/figure>\n<p class=\"wp-block-paragraph\">The illustration above is from an article I wrote at the end of 2023, titled \u201cLeveraging LLMs with LangChain for Supply Chain Analytics\u200a\u2014\u200aA Control Tower Powered by GPT.\u201d<\/p>\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-towards-data-science wp-block-embed-towards-data-science\">\n<div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"X64nqfBLOu\"><p><a href=\"https:\/\/towardsdatascience.com\/leveraging-llms-with-langchain-for-supply-chain-analytics-a-control-tower-powered-by-gpt-21e19b33b5f0\/\">Leveraging LLMs with LangChain for Supply Chain Analytics \u2013 A Control Tower Powered by GPT<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" title=\"\u201cLeveraging LLMs with LangChain for Supply Chain Analytics \u2013 A Control Tower Powered by GPT\u201d \u2014 Towards Data Science\" src=\"https:\/\/towardsdatascience.com\/leveraging-llms-with-langchain-for-supply-chain-analytics-a-control-tower-powered-by-gpt-21e19b33b5f0\/embed\/#?secret=mlNAA1NFUM#?secret=X64nqfBLOu\" data-secret=\"X64nqfBLOu\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div>\n<\/figure>\n<p class=\"wp-block-paragraph\">At the time, I was exploring how to use LangChain to build an agent acting as a Supply Chain Control Tower.<\/p>\n<p class=\"wp-block-paragraph\">A year later, I discovered the power of the low-code platform n8n to build the same kind of solution in just a few clicks.<\/p>\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/1200\/1%2AHvC_kbdCo0iX0l_8U8AvSg.png?ssl=1\" alt=\"\"><figcaption class=\"wp-element-caption\">AI-Powered Email Parser used for the processing of Warehouse Orders received by Email\u200a\u2014\u200a(Image by Samir\u00a0Saci)<\/figcaption><\/figure>\n<p class=\"wp-block-paragraph\">In this article, we\u2019ll explore how to easily build AI agents to automate supply chain analytics workflows using n8n.<\/p>\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/1200\/0%2A7ghKyGodxZNAQA9v.png?ssl=1\" alt=\"\"><figcaption class=\"wp-element-caption\">AI Agent for Supply Chain Control Tower\u200a\u2014\u200a(Image by Samir\u00a0Saci)<\/figcaption><\/figure>\n<p class=\"wp-block-paragraph\">We\u2019ll also see how to deploy the same AI-powered Control Tower agent I originally built with LangChain 18 months ago\u200a\u2014\u200anow using only low-code.<\/p>\n<h3 class=\"wp-block-heading\">AI Agent for Supply Chain Control Towers using LangChain<\/h3>\n<p class=\"wp-block-paragraph\">My first project of AI <a href=\"https:\/\/towardsdatascience.com\/tag\/automation\/\" title=\"Automation\">Automation<\/a> project using n8n was for a customer who wanted a Supply Chain Control Tower equipped with a chat interface.<\/p>\n<p class=\"wp-block-paragraph\"><span style=\"margin: 0px; padding: 0px;\"><strong>A Supply Chain Control Tower<\/strong>\u00a0is a set of dashbo<\/span>ards and reports\u00a0connected to Warehouse and Transport Management Systems\u00a0that use data to monitor critical events across the supply chain.<\/p>\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/1200\/0%2A0rZy2i7B6eeiWpe1.png?ssl=1\" alt=\"\"><figcaption class=\"wp-element-caption\">Example of a\u00a0control<\/figcaption><\/figure>\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/towardsdatascience.com\/leveraging-llms-with-langchain-for-supply-chain-analytics-a-control-tower-powered-by-gpt-21e19b33b5f0\/\" rel=\"noreferrer noopener\" target=\"_blank\">In an earlier article published on Towards Data Science<\/a>, I experimented with LangChain to connect a control tower to an AI agent.<\/p>\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/1200\/0%2AJyU2h0ld-eNVqwnw.png?ssl=1\" alt=\"\"><figcaption class=\"wp-element-caption\">High-Level Overview of the Solution presented in the article\u200a\u2014\u200a(Image by Samir\u00a0Saci)<\/figcaption><\/figure>\n<p class=\"wp-block-paragraph\">The idea was to build a plan-and-execute agent that would<\/p>\n<ul class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">Process the user\u2019s request written in plain English<\/li>\n<li class=\"wp-block-list-item\">Generate the appropriate SQL query<\/li>\n<li class=\"wp-block-list-item\">Query the database and store the results<\/li>\n<li class=\"wp-block-list-item\">Formulate a clear response in plain English<\/li>\n<\/ul>\n<p class=\"wp-block-paragraph\">After several iterations, I found the right chain structure and prompts to deliver accurate results.<\/p>\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/1200\/0%2AADI-F_N_rQIvdrK8.png?ssl=1\" alt=\"\"><figcaption class=\"wp-element-caption\">Example of iterations that you can find in the article\u200a\u2014\u200a(Image by Samir\u00a0Saci)<\/figcaption><\/figure>\n<p class=\"wp-block-paragraph\">The solution worked well because I had already gained experience using LangChain and other frameworks to build AI agents.<\/p>\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><em>How are we supposed to maintain this complex\u00a0setup?<\/em><\/p>\n<\/blockquote>\n<p class=\"wp-block-paragraph\">However, to offer this as a service, I needed tools that would make the solution easier to deploy, maintain, and improve\u200a\u2014\u200aeven with limited Python knowledge.<\/p>\n<p class=\"wp-block-paragraph\">That\u2019s when I discovered n8n.<\/p>\n<p class=\"wp-block-paragraph\">Let\u2019s dive into that in the next section.<\/p>\n<h3 class=\"wp-block-heading\">AI Agent for Supply Chain Control Towers\u200a\u2014\u200aBuilt with\u00a0n8n<\/h3>\n<h4 class=\"wp-block-heading\">What is\u00a0n8n?<\/h4>\n<p class=\"wp-block-paragraph\">n8n is an open-source workflow automation tool that lets you easily connect apps (email, CRMs, messaging systems), APIs, and AI model frameworks like LangChain.<\/p>\n<p class=\"wp-block-paragraph\">You build workflows by connecting pre-built nodes.<\/p>\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/1200\/1%2AHvC_kbdCo0iX0l_8U8AvSg.png?ssl=1\" alt=\"\"><figcaption class=\"wp-element-caption\">AI-Powered Email Parser using 4 nodes\u200a\u2014\u200a(Image by Samir\u00a0Saci)<\/figcaption><\/figure>\n<p class=\"wp-block-paragraph\">For instance, the workflow above <strong>processes emails<\/strong><\/p>\n<ul class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">The first node collects emails from a Gmail account.<\/li>\n<li class=\"wp-block-list-item\">The email content and metadata are sent to the AI Agent node, which extracts the relevant information.<\/li>\n<li class=\"wp-block-list-item\">The third node processes the output using JavaScript.<\/li>\n<li class=\"wp-block-list-item\">The final node loads the results into a Google Sheet.<\/li>\n<\/ul>\n<p class=\"wp-block-paragraph\">No code was needed to build this workflow\u200a\u2014\u200aexcept for the third node, which uses just two lines of JavaScript.<\/p>\n<p class=\"wp-block-paragraph\">Since I work with a team of Supply Chain consultants who have limited Python skills, this was a game-changer for me as I looked to develop my service offering.<\/p>\n<p class=\"wp-block-paragraph\">They can easily use, adapt, and maintain this workflow after a short training session on n8n.<\/p>\n<h4 class=\"wp-block-heading\">AI Supply Chain Control Tower n8n\u00a0workflow<\/h4>\n<p class=\"wp-block-paragraph\">The AI Supply Chain Control Tower workflow is a bit more complex\u200a\u2014\u200abut still far simpler than its Python version.<\/p>\n<p class=\"wp-block-paragraph\">It includes two sub-workflows.<\/p>\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/1200\/1%2AU7hfaV3h9qlWgTDvcnpQKA.png?ssl=1\" alt=\"\"><figcaption class=\"wp-element-caption\">Main sub-workflow including the AI agent\u200a\u2014\u200a(Image by Samir\u00a0Saci)<\/figcaption><\/figure>\n<p class=\"wp-block-paragraph\">The main sub-workflow includes both a chat interface and the AI agent.<\/p>\n<p class=\"wp-block-paragraph\">For the AI Agent node, you need to<\/p>\n<ul class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">Connect an LLM (chat model) using a node where you enter your API credentials<\/li>\n<li class=\"wp-block-list-item\">Add a memory node to manage the conversation<\/li>\n<li class=\"wp-block-list-item\">Add a tool node for SQL querying, linked to the second sub-workflow<\/li>\n<\/ul>\n<p class=\"wp-block-paragraph\">The AI agent generates an SQL query and sends it to the \u201cCall Query Tool\u201d node, which executes the query.<\/p>\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/1200\/1%2ADasarnK7y60TxiT2pCP5YA.png?ssl=1\" alt=\"\"><figcaption class=\"wp-element-caption\">Second sub-workflow connected via the \u201cCall Query Tool\u201d\u200a\u2014\u200a(Image by Samir\u00a0Saci)<\/figcaption><\/figure>\n<p class=\"wp-block-paragraph\">The sub-workflow includes a code node that cleans the query (removing extra spaces and blocking risky commands like DELETE).<\/p>\n<p class=\"wp-block-paragraph\">The output is sent to a <strong>BigQuery node<\/strong>, which runs the query and returns the results.<\/p>\n<p class=\"wp-block-paragraph\">The process is very smooth and requires limited configuration:<\/p>\n<ul class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">System Prompt (in the AI Agent node)<\/li>\n<li class=\"wp-block-list-item\">User Prompt (in the AI Agent Node)<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/1200\/1%2ADcS14LjrSxVGqfqIQnwgyQ.png?ssl=1\" alt=\"\"><figcaption class=\"wp-element-caption\">System Prompt Window of the AI Agent Node\u200a\u2014\u200a(Image by Samir\u00a0Saci)<\/figcaption><\/figure>\n<p class=\"wp-block-paragraph\">This setup requires no Python skills and can be handled directly by my consultants.<\/p>\n<figure class=\"wp-block-image is-resized\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/1200\/1%2ALtlC0jL5K6bi-Qd83I5eSg.png?ssl=1\" alt=\"\" style=\"width:506px;height:auto\"><figcaption class=\"wp-element-caption\">Chat Window showing an interraction with the AI Agent\u200a\u2014\u200a(Image by Samir\u00a0Saci)<\/figcaption><\/figure>\n<p class=\"wp-block-paragraph\">The results are comparable to those of the Python version.<\/p>\n<p class=\"wp-block-paragraph\">For step-by-step setup instructions, check out my YouTube tutorial <img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/s.w.org\/images\/core\/emoji\/15.0.3\/72x72\/1f447.png?ssl=1\" alt=\"\ud83d\udc47\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\"><\/p>\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\">\n<div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Automate Supply Chain Analytics Workflows with N8N\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/Zx67gfUGIO0?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div>\n<\/figure>\n<h3 class=\"wp-block-heading\">Conclusion<\/h3>\n<p class=\"wp-block-paragraph\">This example shows how easy it is to replicate an AI agent built with Python\u200a\u2014\u200ausing n8n and minimal code.<\/p>\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Does that mean Python is no longer needed for Supply Chain Analytics? Definitely not!<\/strong><\/p>\n<\/blockquote>\n<p class=\"wp-block-paragraph\">Like many low-code platforms, the features are limited to what is available within the framework.<\/p>\n<p class=\"wp-block-paragraph\">That\u2019s why I use it as a complement to my analytics products.<\/p>\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/1200\/1%2AsMIDOK9FIFrs6EHwtDn0Sg.png?ssl=1\" alt=\"\"><figcaption class=\"wp-element-caption\">Connect an AI Agent with one of my analytics products\u2019 backend using an HTTP node\u200a\u2014\u200a(Image by Samir\u00a0Saci)<\/figcaption><\/figure>\n<p class=\"wp-block-paragraph\">To do that, you can use the HTTP Request node to connect your workflow to your analytics backend.<\/p>\n<h4 class=\"wp-block-heading\">What else? Easy connectivity to many services.<\/h4>\n<p class=\"wp-block-paragraph\">Another reason I chose n8n to enrich my analytics products is how easy it is to add additional connections.<\/p>\n<p class=\"wp-block-paragraph\">For example, if you want to add a Slack interface or log conversations to a Google Sheet, just add a new node to your workflow.<\/p>\n<p class=\"wp-block-paragraph\">If you\u2019re starting your n8n journey and need inspiration, <a href=\"https:\/\/n8n.io\/creators\/samirsaci\/\" rel=\"noreferrer noopener\" target=\"_blank\">feel free to explore my templates.<\/a><\/p>\n<h3 class=\"wp-block-heading\">About Me<\/h3>\n<p class=\"wp-block-paragraph\">Let\u2019s connect on <a href=\"https:\/\/www.linkedin.com\/in\/samir-saci\/\" rel=\"noreferrer noopener\" target=\"_blank\">Linkedin<\/a> and <a href=\"https:\/\/twitter.com\/Samir_Saci_\" rel=\"noreferrer noopener\" target=\"_blank\">Twitter<\/a>; I am a Supply Chain Engineer using data analytics to improve <a href=\"https:\/\/towardsdatascience.com\/tag\/logistics\/\" title=\"Logistics\">Logistics<\/a> operations and reduce costs.<\/p>\n<p class=\"wp-block-paragraph\">For consulting or advice on analytics and sustainable <a href=\"https:\/\/towardsdatascience.com\/tag\/supply-chain\/\" title=\"Supply Chain\">Supply Chain<\/a> transformation, feel free to contact me via <a href=\"https:\/\/www.logi-green.com\/\" rel=\"noreferrer noopener\" target=\"_blank\">Logigreen Consulting<\/a>.<\/p>\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/samirsaci.com\/\"><strong>Samir Saci | Data Science &amp; Productivity<\/strong><br \/><em>A technical blog focusing on Data Science, Personal Productivity, Automation, Operations Research and Sustainable\u2026<\/em>samirsaci.com<\/a><a href=\"https:\/\/samirsaci.com\/\"><\/a><\/p>\n<p>The post <a href=\"https:\/\/towardsdatascience.com\/automate-supply-chain-analytics-workflows-with-ai-agents-using-n8n\/\">Automate Supply Chain Analytics Workflows with AI Agents using\u00a0n8n<\/a> appeared first on <a href=\"https:\/\/towardsdatascience.com\/\">Towards Data Science<\/a>.<\/p>\n<\/div>\n<p> \t<BR><br \/>\n <BR><\/BR><br \/>\n    Samir Saci<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n<a href=\"https:\/\/towardsdatascience.com\/automate-supply-chain-analytics-workflows-with-ai-agents-using-n8n\/\">Go to original source<\/a><br \/>\n \t<BR><br \/>\n <BR><\/BR><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Automate Supply Chain Analytics Workflows with AI Agents using\u00a0n8n Why build things the hard way when you can design them the smart way? As a Supply Chain Data Scientist, I\u2019ve explored various frameworks like LangChain and LangGraph to build AI agents using Python. Leveraging LLMs with LangChain for Supply Chain Analytics\u200a\u2014\u200aA Control Tower Powered by [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[799,62,69,247,83,1218,1220],"tags":[2138,742,2137],"class_list":["post-2664","post","type-post","status-publish","format-standard","hentry","category-ai-agent","category-aimldsaimlds","category-artificial-intelligence","category-automation","category-data-science","category-logistics","category-supply-chain","tag-chain","tag-control","tag-supply"],"_links":{"self":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/posts\/2664"}],"collection":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/comments?post=2664"}],"version-history":[{"count":0,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/posts\/2664\/revisions"}],"wp:attachment":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/media?parent=2664"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/categories?post=2664"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/tags?post=2664"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}