5 - Building a Web UI for Your Madison Agent with Streamlit

This tutorial turns a technical n8n workflow into a Streamlit web app that non-technical brand managers can use, connected through a webhook and deployed publicly for free.

6:49 video4 min readWatch on YouTube

A working n8n workflow is only useful to the people who can operate n8n. For a brand manager or marketer who has no interest in learning a workflow automation tool, that technical backend is invisible and inaccessible. Kriti's tutorial closes that gap by wrapping a Madison agent's n8n workflow in a Streamlit web interface, built entirely in Python, that a non-technical user can just click through.

Why Streamlit

Streamlit lets you build a user interface with nothing but Python, no JavaScript, HTML, or CSS required, which makes it a fit for data-focused applications like a Madison agent. It's also free to host on Streamlit Cloud, which removes the usual friction of standing up your own server just to share a small internal tool. The goal isn't a polished consumer product, it's making the Madison tool something brand managers and marketers can use without getting anywhere near the underlying automation.

Getting Streamlit running locally

Setup starts with a single terminal command, pip install streamlit, which pulls in all the necessary dependencies. From there, the tutorial creates a new Python file, madison_app, in Visual Studio, inside the same repository used in the earlier videos in this series, continuing directly from that prior work. A basic starter version of the app runs with the command streamlit run madison_app, which launches a local web application viewable right in the browser.

Connecting the UI to the workflow

With a bare interface running, the next step is deciding what the app actually needs to input and output. Input can be a text field or a dropdown; output has more room for creativity, whether that's a chart, a table, or something else entirely. The example built here is a brand analysis tool for OpenAI, using Reddit data as the underlying source. On the n8n side, the workflow's original manual trigger gets replaced with a Webhook node configured as a POST HTTP request, which gives the workflow a URL that outside code can call. That webhook URL is what the Streamlit app's Python code hits, using the requests library to send whatever the user typed, a brand name like OpenAI in this case, over to the locally running n8n server. Once n8n finishes gathering the relevant Reddit data, the response coming back from that HTTP node gets unpacked in the Streamlit code, using pandas to turn the raw response into a structured, readable format.

Displaying the results

Once the pieces are wired together, running the app and triggering the n8n workflow produces a live result inside the UI: a table showing Reddit post titles, upvote counts, and the users who posted them, along with a deeper-dive section for more detail. The tutorial is explicit that this display layer is where you get creative freedom, tables, charts, metric cards, or any other visualization that suits the data your Madison agent is producing.

Deploying publicly with Streamlit Cloud

A locally running app only helps the person running it. To make it accessible to anyone, the tutorial moves to Streamlit Cloud, starting with a GitHub repository holding the app code. If dependencies exist beyond Streamlit itself, a requirements.txt file listing them is required for the cloud deployment to work. From there, creating a free account at share.streamlit.io and clicking "Create app" starts the deployment flow: choosing to deploy a public app from GitHub, pasting the GitHub URL for the specific Python file (the Madison app file in this case), and picking a domain name for the project. In the demo, the domain reflects the specific brand analysis project being built, resulting in a public URL on the streamlit.app domain. Clicking deploy finishes the process in a matter of seconds, producing a public URL that anyone on the internet can use to run the tool.

Keep it functional, not beautiful

The tutorial closes on the 80/20 rule: the priority is making the interface functional and clear, not making it beautiful. What matters most for a tool like this is that brand managers and marketers can understand and operate it without any technical background, not that it wins a design award. A future video in the series is noted to cover an alternative UI approach using Gradio.

Key takeaways

  • Streamlit builds a full web UI using only Python, with free hosting available through Streamlit Cloud.
  • Local setup is a single pip install streamlit command followed by streamlit run <filename> to launch the app in a browser.
  • Connecting the UI to an n8n workflow means replacing the manual trigger with a Webhook node configured as a POST request, then calling that webhook URL from Python using the requests library.
  • Pandas turns the raw JSON response from n8n into readable tables and metric cards inside the Streamlit app.
  • Deploying publicly requires a GitHub repository with a requirements.txt file, then a few clicks on share.streamlit.io to get a public URL on the streamlit.app domain.
  • The guiding principle throughout is the 80/20 rule: prioritize functional and clear over beautiful.

Who this is for

This tutorial is for anyone building on the Madison framework who wants non-technical stakeholders, brand managers, marketers, or other team members, to interact with an n8n-based agent without touching the workflow itself. It's part of the Madison agent UI tutorial series from Humanitarians AI.

Full transcript(auto-generated, with timestamps)

[0:00]Welcome to our Madison framework UI tutorial series. I'm Kriti and today we are learning how to create a simple user interface for your Madison agent using Streamlit. Here you will transform your technical NLU and workflow into something non-technical users can interact with. And before we dive in, let's talk about why we are using Streamlit. With Streamlit you can create user interface with just Python. No prior knowledge of JavaScript or HTML CSS required. So this is perfect for data-focused applications like your Madison agent. Streamlit is also free free to host with Streamlit Cloud. All these points make Streamlit perfect for your Madison agent. The goal here is

[0:44]To make your Madison tool accessible to non-technical users like marketeers or brand managers. And Streamlit lets you do this quickly without getting bogged down in web development. Let's get Streamlit installed and set up. Open your terminal and type this command pip install Streamlit. And let me also give a demonstration on how to do it. So I have my terminal open and pip install Streamlit. Yes. So you can see all the dependencies are installed and the Streamlit is now installed. Next I'm opening my Visual Studio and creating a Python file called madison_app. Here I'm using the same repository that I used in my previous video. This is the

[1:24]Continuation of it as I'm creating a user interface to my project. And in my Python file I'm adding a basic starter code. This is my code and let me run it. Now I'm going to run this Python file with this command streamlit run and my file name madison_app. And run. So now my application is running locally and yeah, I can see a basic web application in my browser. Now let's connect this simple UI to your medicine agents functionality. And these are the steps that you need to do or keep in mind. So first, for your project, identify your core input and output. And for input UI, you can use

[2:08]Either a text input or drop-downs. And for output, you can actually be creative. You can be innovative and use a chart or tables to visualize your data. You have your complete creative freedom here. And let me just implement a simple brand analysis and give a demo. So my project that I was I'm continuing from the previous video is a brand analysis for OpenAI using Reddit data. So this is my N8N. So it is very similar from my previous video, but I had a manual trigger. I have replaced that with webhook web this webhook node. It's a post HTTP method request, and this is my URL.

[2:45]And I'm using this webhook or this webhook URL in my Python file. So I just updated this Madison app Python file, and this is my URL, which I have pasted here. So in this code, I'm using this request library to create a bridge between my UI and N8N. And when a user enters a brand name, which is OpenAI in my case, so Python sends that data to um our local N8N server using this webhook URL. Okay? And once N8N finds the all the Reddit data, the response from that HTTP node in N8N, this code further unpacks that result into a structured format. And for that, we are using Pandas Pandas

[3:24]Library to instantly transform all that raw data into interactive table and metrics metric cards that you can see in the UI. Let me just run run this, and I'm running it with the same command, streamlit run. Let's go to my N8N and execute this workflow. Now going to my UI, here I'm just going to Now on this run analysis. And yes, this is my output. I have a table format. All my response which is that I'm collecting some of the Reddit post. So I have the structure has my post title, the number of upvotes, posted by which user, and there's also a deep dive section that I've added. You

[4:11]Can be creative with your UI. You can, you know, arrange it. You can have a chart or you can use the visualizations however you want. Next, you need to deploy your UI so others can access it. For that, let's use Streamlit Cloud. These are the steps to achieve it and let's do it one by one. Create a GitHub repository with your app code. And if you already have a repository, update your repo with your updated Python code or the all the back end or the Streamlit code. And if you have any dependencies, don't forget to add a requirements.txt file where you are listing all your

[4:52]Dependencies. Next step is let's go to this URL share.streamlit.io and create your free account. You can log in, you can sign up. Create your free account. You can sign up for a free account and this is how it's going to look once you're logged in. And to host or deploy your Madison project, click on the create app button on the top right corner. Yes, click on this deploy a public app from GitHub. I'm going to be choosing a paste GitHub URL. Go to your updated GitHub. Click on this Python file, Madison Python file, and copy the URL. Come back to this Streamlit UI and paste

[5:36]The same Python file link. And yes, this is the important part. You need to choose a domain for your project. Mine is going to be my project name, uh the brand analysis that I'm doing for Open AI. So, the URL is going to be this, domain name.streamlit.app. Yes, this will be my project's public URL. And this domain is available, and yes, click on deploy. Yes, my UI is ready. It barely took few seconds, and now I have a public URL anybody on the internet can use. That's it. This is how you deploy your app. You have now created a simple user interface for your medicine agent using Streamlit.

[6:19]This transforms your technical anything workflow into a tool that non-technical users can actually use. Remember the 80/20 rule. Focus on making your interface functional and clear rather than beautiful. What matters most is that brand managers and marketers can understand and use your tool without technical knowledge. In our next video, we will explore an alternative approach using Gradio. That's it for this video. Thank you so much for watching. I hope this was helpful.

More from INFO7375 Branding & AI

Humanitarians AI Lyrical Literacy Project