Back to Catalog

Flight data visualization with Chart.js, QuickChart API & Telegram Bot

DataMinexDataMinex
855 views
2/3/2026
Official Page

๐Ÿ“Š Real-Time Flight Data Analytics Bot with Dynamic Chart Generation via Telegram

๐Ÿš€ Template Overview

This advanced n8n workflow creates an intelligent Telegram bot that transforms raw CSV flight data into stunning, interactive visualizations. Users can generate professional charts on-demand through a conversational interface, making data analytics accessible to anyone via messaging.

Key Innovation: Combines real-time data processing, Chart.js visualization engine, and Telegram's messaging platform to deliver instant business intelligence insights.

๐ŸŽฏ What This Template Does

Transform your flight booking data into actionable insights with four powerful visualization types:

  • ๐Ÿ“ˆ Bar Charts: Top 10 busiest airlines by flight volume
  • ๐Ÿฅง Pie Charts: Flight duration distribution (Short/Medium/Long-haul)
  • ๐Ÿฉ Doughnut Charts: Price range segmentation with average pricing
  • ๐Ÿ“Š Line Charts: Price trend analysis across flight durations

Each chart includes auto-generated insights, percentages, and key business metrics delivered instantly to users' phones.

๐Ÿ—๏ธ Technical Architecture

Core Components

  1. Telegram Webhook Trigger: Captures user interactions and button clicks
  2. Smart Routing Engine: Conditional logic for command detection and chart selection
  3. CSV Data Pipeline: File reading โ†’ parsing โ†’ JSON transformation
  4. Chart Generation Engine: JavaScript-powered data processing with Chart.js
  5. Image Rendering Service: QuickChart API for high-quality PNG generation
  6. Response Delivery: Binary image transmission back to Telegram

Data Flow Architecture

User Input โ†’ Command Detection โ†’ CSV Processing โ†’ Data Aggregation โ†’ 
Chart Configuration โ†’ Image Generation โ†’ Telegram Delivery

๐Ÿ› ๏ธ Setup Requirements

Prerequisites

  • n8n instance (self-hosted or cloud)
  • Telegram Bot Token from @BotFather
  • CSV dataset with flight information
  • Internet connectivity for QuickChart API

Dataset Source

This template uses the Airlines Flights Data dataset from GitHub: ๐Ÿ”— Dataset: Airlines Flights Data by Rohit Grewal

Required Data Schema

Your CSV file should contain these columns:

airline,flight,source_city,departure_time,arrival_time,duration,price,class,destination_city,stops

File Structure

/data/
  โ””โ”€โ”€ flights.csv (download from GitHub dataset above)

โš™๏ธ Configuration Steps

1. Telegram Bot Setup

  1. Create a new bot via @BotFather on Telegram
  2. Copy your bot token
  3. Configure the Telegram Trigger node with your token
  4. Set webhook URL in your n8n instance

2. Data Preparation

  1. Download the dataset from Airlines Flights Data
  2. Upload the CSV file to /data/flights.csv in your n8n instance
  3. Ensure UTF-8 encoding
  4. Verify column headers match the dataset schema
  5. Test file accessibility from n8n

3. Workflow Activation

  1. Import the workflow JSON
  2. Configure all Telegram nodes with your bot token
  3. Test the /start command
  4. Activate the workflow

๐Ÿ”ง Technical Implementation Details

Chart Generation Process

Bar Chart Logic:

// Aggregate airline counts
const airlineCounts = {};
flights.forEach(flight => {
  const airline = flight.airline || 'Unknown';
  airlineCounts[airline] = (airlineCounts[airline] || 0) + 1;
});

// Generate Chart.js configuration
const chartConfig = {
  type: 'bar',
  data: { labels, datasets },
  options: { responsive: true, plugins: {...} }
};

Dynamic Color Schemes:

  • Bar Charts: Professional blue gradient palette
  • Pie Charts: Duration-based color coding (lightโ†’dark blue)
  • Doughnut Charts: Price-tier specific colors (greenโ†’purple)
  • Line Charts: Trend-focused red gradient with smooth curves

Performance Optimizations

  1. Efficient Data Processing: Single-pass aggregations with O(n) complexity
  2. Smart Caching: QuickChart handles image caching automatically
  3. Minimal Memory Usage: Stream processing for large datasets
  4. Error Handling: Graceful fallbacks for missing data fields

Advanced Features

Auto-Generated Insights:

  • Statistical calculations (percentages, averages, totals)
  • Trend analysis and pattern detection
  • Business intelligence summaries
  • Contextual recommendations

User Experience Enhancements:

  • Reply keyboards for easy navigation
  • Visual progress indicators
  • Error recovery mechanisms
  • Mobile-optimized chart dimensions (800x600px)

๐Ÿ“ˆ Use Cases & Business Applications

Airlines & Travel Companies

  • Fleet Analysis: Monitor airline performance and market share
  • Pricing Strategy: Analyze competitor pricing across routes
  • Operational Insights: Track duration patterns and efficiency

Data Analytics Teams

  • Self-Service BI: Enable non-technical users to generate reports
  • Mobile Dashboards: Access insights anywhere via Telegram
  • Rapid Prototyping: Quick data exploration without complex tools

Business Intelligence

  • Executive Reporting: Instant charts for presentations
  • Market Research: Compare industry trends and benchmarks
  • Performance Monitoring: Track KPIs in real-time

๐ŸŽจ Customization Options

Adding New Chart Types

  1. Create new Switch condition
  2. Add corresponding data processing node
  3. Configure Chart.js options
  4. Update user interface menu

Data Source Extensions

  • Replace CSV with database connections
  • Add real-time API integrations
  • Implement data refresh mechanisms
  • Support multiple file formats

Visual Customizations

// Custom color palette
backgroundColor: ['#your-colors'],
// Advanced styling
borderRadius: 8,
borderSkipped: false,
// Animation effects
animation: { duration: 2000, easing: 'easeInOutQuart' }

๐Ÿ”’ Security & Best Practices

Data Protection

  • Validate CSV input format
  • Sanitize user inputs
  • Implement rate limiting
  • Secure file access permissions

Error Handling

  • Graceful degradation for API failures
  • User-friendly error messages
  • Automatic retry mechanisms
  • Comprehensive logging

๐Ÿ“Š Expected Outputs

Sample Generated Insights

  • "โœˆ๏ธ Vistara leads with 350+ flights, capturing 23.4% market share"
  • "๐Ÿ“ˆ Long-haul flights dominate at 61.1% of total bookings"
  • "๐Ÿ’ฐ Budget category (โ‚น0-10K) represents 47.5% of all bookings"
  • "๐Ÿ“Š Average prices peak at โ‚น14K for 6-8 hour duration flights"

Performance Metrics

  • Response Time: <3 seconds for chart generation
  • Image Quality: 800x600px high-resolution PNG
  • Data Capacity: Handles 10K+ records efficiently
  • Concurrent Users: Scales with n8n instance capacity

๐Ÿš€ Getting Started

  1. Download the workflow JSON
  2. Import into your n8n instance
  3. Configure Telegram bot credentials
  4. Upload your flight data CSV
  5. Test with /start command
  6. Deploy and share with your team

๐Ÿ’ก Pro Tips

  • Data Quality: Clean data produces better insights
  • Mobile First: Charts are optimized for mobile viewing
  • Batch Processing: Handles large datasets efficiently
  • Extensible Design: Easy to add new visualization types

Ready to transform your data into actionable insights? Import this template and start generating professional charts in minutes! ๐Ÿš€

n8n Flight Data Visualization with Chart.js, QuickChart.io, and Telegram Bot

This n8n workflow demonstrates how to retrieve flight data, generate a chart visualization using QuickChart.io, and then send the generated image to a Telegram bot. This allows for quick and easy sharing of data visualizations.

What it does

This workflow automates the following steps:

  1. Triggers on Telegram Message: The workflow starts when a message is received by a configured Telegram bot.
  2. Checks for Specific Command: It uses a Switch node to check if the received Telegram message contains a specific command (e.g., /flightdata).
  3. Fetches Flight Data: If the command is recognized, an HTTP Request node is used to fetch flight data from an external API.
  4. Processes Data for Chart: A Code node processes the raw flight data into a format suitable for Chart.js. This likely involves extracting relevant fields and structuring them for a chart.
  5. Generates Chart Image: Another HTTP Request node sends the Chart.js configuration (generated in the previous step) to the QuickChart.io API to generate a static chart image.
  6. Saves Chart Image Temporarily: The generated chart image (binary data) is saved to a temporary file on disk using the "Read/Write Files from Disk" node.
  7. Extracts Binary Data: The "Extract from File" node then extracts the binary data of the image from the temporary file.
  8. Sends Chart to Telegram: Finally, a Telegram node sends the generated chart image as a photo to the chat where the command originated.
  9. Handles Unknown Commands: If the received Telegram message does not match the expected command, the workflow sends a predefined message back to the user via Telegram, indicating an unknown command.

Prerequisites/Requirements

To use this workflow, you will need:

  • n8n Instance: A running n8n instance.
  • Telegram Bot Token: A Telegram Bot Token from BotFather.
  • Telegram Chat ID: The chat ID where the bot will send messages.
  • QuickChart.io Account (Optional): While QuickChart.io has a free tier, you might need an API key for higher usage limits or specific features. The workflow likely uses the public API endpoint.
  • Flight Data API Endpoint: An API endpoint that provides flight data in a consumable format. You will need to configure the HTTP Request node with the correct URL and any necessary authentication.

Setup/Usage

  1. Import the Workflow:

    • Download the provided JSON file.
    • In your n8n instance, go to "Workflows" and click "New".
    • Click the three dots menu (โ‹ฎ) in the top right and select "Import from JSON".
    • Paste the workflow JSON or upload the file.
  2. Configure Credentials:

    • Telegram:
      • Click on the "Telegram Trigger" node and the "Telegram" node.
      • Click "Create New Credential" and enter your Telegram Bot Token.
    • QuickChart.io (if applicable): If QuickChart.io requires an API key for your use case, you'll need to configure it in the HTTP Request node that interacts with QuickChart.io.
  3. Configure Nodes:

    • Telegram Trigger: Ensure the "Allowed Updates" are configured to receive messages.
    • Switch: Verify the condition for the Telegram message command (e.g., {{ $json.message.text }} equals /flightdata).
    • HTTP Request (Flight Data): Update the URL, headers, and any parameters to match your chosen flight data API.
    • Code: Review and adjust the JavaScript code to correctly parse the flight data from your API and format it for Chart.js.
    • HTTP Request (QuickChart.io): Ensure the Chart.js configuration in the body of this request is correct and matches the data processed by the Code node.
    • Telegram (Send Photo): Ensure the "Chat ID" is correctly set to the target Telegram chat.
    • Telegram (Send Message - Unknown Command): Adjust the message text as needed.
  4. Activate the Workflow: Once configured, activate the workflow by toggling the "Active" switch in the top right corner of the workflow editor.

Now, when you send the configured command (e.g., /flightdata) to your Telegram bot, it should respond with a visualization of the flight data.

Related Templates

Track meal nutrition from meal photos with LINE, Google Gemini and Google Sheets

AI Meal Nutrition Tracker with LINE and Google Sheets Who's it for This workflow is designed for health-conscious individuals, fitness enthusiasts, and anyone who wants to track their daily food intake without manual calorie counting. It is best suited for users who want a simple, AI-powered meal logging system that analyzes food photos one at a time and provides instant nutritional feedback via LINE. What it does This workflow processes a single meal photo sent via LINE, analyzes it using Google Gemini AI to identify foods and estimate nutritional content, and stores the data in Google Sheets for tracking. The workflow focuses on simplicity and encouragement: it receives a meal image, performs AI-based food recognition, estimates calories and macronutrients, calculates a health score, provides personalized advice, and replies with a detailed nutritional breakdown on LINE. How it works A single meal photo is sent to the LINE bot. The workflow is triggered via a LINE webhook. The image file is downloaded and sent to Google Gemini AI for food analysis. The AI identifies foods and estimates nutritional values (calories, protein, carbs, fat, fiber). A health score (1-10) is calculated with personalized improvement tips. The data is appended to Google Sheets for meal history tracking. The image is uploaded to Google Drive for reference. A formatted nutritional report with advice is sent back as a LINE reply. This workflow is intentionally designed to handle one image per execution. Requirements To use this workflow, you will need: A LINE Messaging API account A Google Gemini API key A Google account with access to Google Sheets and Google Drive A Google Sheets document with the following column names: Date Time Meal Type Food Items Calories Protein (g) Carbs (g) Fat (g) Fiber (g) Health Score Advice Image URL Important limitations This workflow does not support multiple images sent in a single message. Sending images in quick succession may trigger multiple executions and lead to unexpected results. Only the first image in an event payload is processed. Nutritional values are AI estimates based on visual analysis and typical serving sizes. Accuracy depends on image quality, lighting, and food visibility. This tool should not replace professional dietary advice. These limitations are intentional to keep the workflow simple and easy to understand. How to set up Create a LINE Messaging API channel and obtain a Channel Access Token. Generate a Google Gemini API key. Update the Config node with your LINE token, Google Sheets ID, Google Drive folder ID, and daily calorie goal. Configure credentials for LINE, Google Gemini, Google Sheets, and Google Drive. Register the n8n webhook URL in your LINE channel settings. Activate the workflow in n8n and test it with a single meal photo. How to customize Modify the AI prompt in the "Analyze Meal with AI" node to support different languages or dietary frameworks (keto, vegan, etc.). Adjust the daily calorie goal in the Config node to match individual needs. Add additional nutritional fields such as sodium, sugar, or vitamins. Replace Google Sheets with a fitness app API or database. Integrate with other services to send daily/weekly nutrition summaries. --- Note: This workflow was tested using real meal photos sent individually via the LINE Messaging API. Nutritional estimates are approximations and may vary from actual values. For accurate dietary tracking, consult a registered dietitian.

Oka HironobuBy Oka Hironobu
89

Track free Udemy courses automatically with RapidAPI and Google Sheets

This workflow fetches free Udemy courses hourly via the Udemy Coupons and Courses API on RapidAPI, filters them, and updates a Google Sheet. It sends alerts on errors for smooth monitoring. --- Node-by-Node Explanation Schedule Trigger: Runs the workflow every hour automatically. Fetch Udemy Coupons: Sends POST request to the Udemy Coupons and Courses API on RapidAPI to get featured courses. Check API Success: Verifies if the API response is successful; routes accordingly. Filter Free Courses: Selects only courses with sale_price of zero (free courses). Send Error Notification: Emails admin if API fetch fails for quick action. Sync Courses to Google Sheet: Appends or updates the filtered free courses into Google Sheets. --- Google Sheets Columns id name price sale_price image lectures views rating language category subcategory slug store sale_start --- Google Sheets Setup & Configuration Steps Create Google Sheet: Create or open a Google Sheet where you want to sync courses. Set Headers: Add columns headers matching the fields synced (id, name, price, etc.). Enable Google Sheets API: Go to Google Cloud Console, enable Google Sheets API for your project. Create Service Account: In Google Cloud Console, create a Service Account with editor access. Download Credentials: Download the JSON credentials file from the service account. Share Sheet: Share your Google Sheet with the Service Account email (found in JSON file). Configure n8n Google Sheets Node: Use the service account credentials, set operation to โ€œAppend or Updateโ€, provide Sheet URL and sheet name or gid. Match Columns: Map the course fields to your sheet columns and set id as the unique key for updates. --- How to Obtain RapidAPI Key & Setup API Request Sign up/Login: Visit RapidAPI Udemy Coupons and Courses API and create an account or log in. Subscribe to API: Subscribe to the Udemy Coupons and Courses API plan (free or paid). Get API Key: Navigate to your dashboard and copy your x-rapidapi-key. Configure HTTP Request: In your workflowโ€™s HTTP Request node: Set method to POST. URL: https://udemy-coupons-and-courses.p.rapidapi.com/featured.php Add headers: x-rapidapi-host: udemy-coupons-and-courses.p.rapidapi.com x-rapidapi-key: your copied API key Set content type to multipart/form-data. Add body parameter: page=1 (or as needed). Test API: Run the node to ensure the API responds with data successfully before continuing workflow setup. --- Use Cases & Benefits Automates daily updates of free Udemy courses in your sheet using the Udemy Coupons and Courses API on RapidAPI. Saves manual effort in tracking coupons and deals. Enables quick error alerts to maintain data accuracy. Ideal for course aggregators, affiliate marketers, or learning platforms needing fresh course data. --- Who This Workflow Is For Content curators and edtech platforms tracking free courses. Affiliate marketers promoting Udemy deals. Anyone needing real-time access to updated free Udemy coupons.

Sk developer By Sk developer
365

Daily Magento 2 customer sync to Google Contacts & Sheets without duplicates

Automatically sync newly registered Magento 2 customers to Google Contacts and Google Sheets every 24 hours โ€” with full duplication control and seamless automation. This workflow is a plug-and-play customer contact automation system designed for Magento 2 store owners, marketers, and CRM teams. It fetches customer records registered within the last 24 hours (from 00:00:00 to 23:59:59), checks against an existing Google Sheet to avoid reprocessing, and syncs only the new ones into Google Contacts. This ensures your contact list is always fresh and up to date โ€” without clutter or duplicates. โœ… What This Workflow Does: Automates Customer Syncing Every day, it fetches newly registered Magento 2 customers via API based on the exact date range (midnight to midnight). Deduplicates Using Google Sheets A master Google Sheet tracks already-synced emails. Before adding a customer, the workflow checks this list and skips if already present. Creates Google Contacts Automatically For each unique customer, it creates a new contact in your Google Contacts, saving fields like first name, last name, and email. Logs New Entries to Google Sheets In Google Sheets, it even records magento 2 customer group, createdat, websiteid & store_id After syncing, it adds each new email to the tracking sheet, building a cumulative record of synced contacts. Fully Scheduled & Automated Can be scheduled with the Cron node to run daily (e.g., 12:05 AM) with no manual intervention required. ๐Ÿ”ง Modules Used: HTTP Request (Magento 2 API) Date & Time (for filtering registrations) Google Sheets (for reading/writing synced emails) Google Contacts (for contact creation) Set, IF, and Merge nodes (for control logic) Cron (for scheduling the automation) ๐Ÿ’ผ Use Cases: Keep your email marketing tools synced with Magento 2 customer data. Build a CRM-friendly contact base in Google Contacts without duplicates. Share customer data with sales or support teams through synced Google Sheets. Reduce manual work and human error in data transfer processes. ๐Ÿ”’ Credentials Required Magento 2 Bearer Auth: Set up as a credential in n8n using your Magento 2 API access token. Google API ๐Ÿ“‚ Category E-commerce โ†’ Magento 2 (Adobe Commerce) ๐Ÿ’ฌ Need Help? ๐Ÿ’ก Having trouble setting it up or want to customize this workflow further? Feel free to reach out โ€” Iโ€™m happy to help with setup, customization, or Magento 2 API integration issues. Contact: Author ๐Ÿ‘ค Author Kanaka Kishore Kandregula Certified Magento 2 Developer https://gravatar.com/kmyprojects https://www.linkedin.com/in/kanakakishore

Kanaka Kishore KandregulaBy Kanaka Kishore Kandregula
163