πŸ“Š Send date-range Threads insights reports with Threads API and Telegram

⚑ 2 views Β· πŸ“Š Market Research & Insights

Description

Quick overview

This workflow pulls Threads Insights for a specified date range via the Threads Graph API, generates a self-contained HTML performance report (metrics, trend chart, and follower demographics), and delivers the report as a document to a Telegram chat.

How it works

  1. Starts manually when you run the workflow.
  2. Reads the configured date range, Threads access token, Threads user ID, and target Telegram chat ID.
  3. Validates the inputs, converts the date range to Unix timestamps (GMT+6), and builds Threads Graph API request URLs for metrics, followers, demographics, and profile data.
  4. Calls the Threads Graph API for each request and collects the JSON responses.
  5. Consolidates all request/response pairs into one structured dataset for the reporting period.
  6. Generates a styled HTML report with summary totals, a daily views line chart, and top follower demographics (country, city, gender), and attaches it as an HTML file.
  7. Sends the HTML report file to the configured Telegram chat as a document with an auto-generated caption.

Setup

  1. Create or obtain a Threads long-lived access token and set the token plus your numeric Threads user ID in the input fields.
  2. Add a Telegram Bot credential in n8n, ensure the bot can message the target chat, and set the Telegram chat ID.
  3. Update the from/to dates (YYYY-MM-DD) to the reporting period you want, and adjust the timezone handling in the request builder if you don’t want GMT+6.

Requirements

Customization

πŸ”— Nodes Used

HTTP Request, Telegram

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup