How to Make a Sankey Diagram with AI
A Sankey diagram is one of the best ways to visualize how users, revenue, or resources flow through a system. But until recently, creating one meant wrestling with complex charting tools, libraries like D3.js, or spending hours formatting spreadsheets. This article will show you how to skip all that and create powerful Sankey diagrams in seconds using simple AI prompts.
What is a Sankey Diagram, Anyway?
Instead of just showing static numbers, a Sankey diagram illustrates movement and flow. It uses nodes (the "stages") and links (the "flows" connecting them) to tell a visual story. The width of each link is proportional to the quantity of the flow, making it immediately obvious where the largest volumes are coming from and going to.
Think of it like tracing a river and all its tributaries. You can instantly see which tributaries contribute the most water to the main river.
Here are a few common business uses:
- Website Traffic Analysis: See how users move from different sources (Organic Search, Social Media, Paid Ads) to various landing pages, and then on to key conversion events like a sign-up or purchase.
- Marketing Funnel Visualization: Map out the customer journey, from initial ad impression to a final sale, clearly showing drop-off points at each stage.
- Budget Allocation: Track how a total marketing budget is distributed across different channels and campaigns, and how much revenue each one ultimately generates.
- Sales Pipeline Flow: Visualize how leads progress from "New Lead" to "Demo Booked" to "Negotiation" and finally "Closed-Won" or "Closed-Lost," revealing bottlenecks in your process.
Why Use AI to Build Your Sankey Diagram?
Traditionally, making a Sankey diagram was a technical task reserved for data analysts. You either needed to code it using libraries in Python or R, or you had to meticulously structure your data in a spreadsheet and feed it into a specialized, often clunky, BI tool. Both routes involve a steep learning curve and a lot of manual work.
AI changes everything. Instead of fighting with software, you can just describe the chart you want in plain English. This approach offers key benefits:
- Speed: Go from a question to a finished visualization in seconds, not hours. There’s no need to manually wrangle data or configure chart settings.
- Zero Learning Curve: If you can ask a question, you can create a report. You don’t need to become an expert in Looker, Tableau, or Excel pivot tables to get the answers you need.
- Direct Data Connections: Modern AI analytics tools can connect directly to your live data sources like Google Analytics, HubSpot, or Shopify. This means no more downloading stale CSV files every Monday morning to update your reports.
- Iterative Analysis: The real magic happens when you start a conversation with your data. Start with a broad view, and then ask follow-up questions to drill down. The process feels like brainstorming, not building reports.
Free PDF Guide
AI for Data Analysis Crash Course
Learn how to get AI to do data analysis for you — the best tools, prompts, and workflows to go from raw data to insights without writing a single line of code.
Getting Your Data Ready for a Sankey
Even with a powerful AI, the underlying data needs to have the right ingredients. For any Sankey diagram, you essentially need three pieces of information for each flow you want to visualize:
- Source: The starting point of the flow.
- Target: The destination of the flow.
- Value: The quantity or size of that specific flow.
Let's look at a practical example from marketing analytics. Imagine you want to visualize your website traffic flow from Google Analytics. Your data might look something like this in a conceptual table:
- Source: Google Organic → Target: Homepage → Value: 8,000 Users
- Source: Facebook Ads → Target: Landing Page A → Value: 5,000 Users
- Source: Homepage → Target: Pricing Page → Value: 2,000 Users
- Source: Landing Page A → Target: Free Trial Signup → Value: 500 Users
The good news is that when using an AI tool connected directly to your apps, you don't even need to structure your data this way yourself. The AI already understands the structure of platforms like Google Analytics or Salesforce and can translate your simple questions into this format behind the scenes.
How to Create a Sankey Diagram with AI: Step-by-Step
Here’s how you can use natural language prompts to generate an insightful Sankey diagram without touching a single spreadsheet formula.
Step 1: Connect Your Data Sources
Before you can ask questions, the AI needs access to your data. Find an AI analytics tool that offers one-click integrations with the platforms you use every day. Connecting something like Google Analytics, Shopify, or Salesforce should be as simple as logging into your account and granting permission. The system handles all the data cleaning and preparation automatically.
Step 2: Start with a Simple, Broad Prompt
You don't need to be an expert prompter. Start with a simple, high-level question about the flow you want to understand. Think in terms of your actual business goals, not technical data fields.
Here are a few "starter" prompts for common scenarios:
For Marketing Campaign Analysis:
Show a Sankey diagram of website traffic by source flowing to landing pages for last month.The AI will interpret this, connect to your Google Analytics data, and generate a diagram showing how channels like 'Organic Search', 'Direct', and 'Paid Social' are funneling users to your top pages.
For E-commerce Sales Performance:
Create a Sankey chart that shows the customer path from first-touch channel to purchase for the last 90 days.This prompt would pull data from Shopify and your ad platforms to map out which initial marketing channels contribute to eventual sales, visualizing the full journey.
For Sales Team Performance:
Generate a Sankey of our HubSpot pipeline progression this quarter, from deal creation to close.This creates a visual representation of your sales funnel, immediately highlighting where deals are won, lost, or stalled.
Free PDF Guide
AI for Data Analysis Crash Course
Learn how to get AI to do data analysis for you — the best tools, prompts, and workflows to go from raw data to insights without writing a single line of code.
Step 3: Refine and Drill Down Interactively
Your first chart is rarely your last. The initial visualization will likely spark new questions. This is where analysis with AI becomes so powerful. You can simply ask follow-up questions to modify or filter your diagram.
Continuing the website traffic example, you could refine it with prompts like:
Filtering for Deeper Insights:
Okay, now only show traffic from the United States.The chart will instantly update, focusing only on the flow of users from the US.
Expanding a Category:
Break down the 'Paid Social' source into specific campaigns.The AI will now add more detail, replacing the general 'Paid Social' node with individual campaign nodes like 'Facebook-NewLead-Gen' and 'LinkedIn-BrandAwareness'.
Changing the Visualization Itself:
Change the colors. Make marketing sources blue and landing pages green.You can even modify the look and feel of your chart with simple commands, making it easier to present your findings to others.
Through this conversational process, you can explore your data from multiple angles, uncovering insights that would be difficult and time-consuming to find using traditional methods. The result is not just a static chart, but a living report that evolves with your curiosity.
Final Thoughts
Creating a Sankey diagram is no longer a complex task that requires technical skills. By leveraging AI-powered analytics, you can turn a simple question into a rich, interactive data story that clearly shows the flow of performance across your marketing and sales funnels.
We built Graphed to remove the drudgery from reporting so teams can focus on action. Instead of spending your day exporting CSVs and fighting with chart builders, you can connect your data sources in minutes, ask questions in plain English, and get live, interactive dashboards - Sankey diagrams included. It makes powerful analysis accessible to everyone on your team, from junior marketers to seasoned founders.
Related Articles
Facebook Ads for Gyms: The Complete 2026 Strategy Guide
Master Facebook advertising for your gym in 2026. Learn the proven 6-section framework, targeting strategies, and ad formats that drive memberships.
Facebook Ads for Home Cleaners: The Complete 2026 Strategy Guide
Learn how to run Facebook ads for home cleaners in 2026. Discover the best ad formats, targeting strategies, and budgeting tips to generate more leads.
Facebook Ads for Pet Grooming: The Complete 2026 Strategy Guide
Learn how to run Facebook ads for pet grooming businesses in 2025. Discover AI-powered creative scaling, pain point discovery strategies, and the new customer offer that works.