Quick Flow: AI-powered conversation analytics for work chat

Written By Team ASCN.AI

Last updated 2 months ago

This workflow is designed to automate the analysis of team communication in Telegram. It provides daily chat summaries with key topics, decisions made, participants involved, and overall team dynamics, without manually reading every message. This saves time, improves process tracking, and enhances transparency in team communication.

Step 1: Call the AI agent in the Telegram chat

What is a trigger and why is it needed? You can find out Part 2: Nodes, Trigger, Logic, AI Agent

  1. Log in to ASCN.AI and create a new WorkFlow.

  2. Add Trigger → Telegram → Trigger Telegram Polling

Trigger Telegram Polling is a node that receives data from Telegram and launches a workflow, passing on the data from messages sent by the user.

  1. Configure data:

BotToken: Here you need to insert your bot's token, you can get it in @BotFather

  1. Add Tools → Storage → Storage Put

Storage Put is a node that stores values by key within the ASCN.AI system (the data itself is stored only on your profile and is not accessible to anyone except you).

  1. Configure data:

Key: summarychatbot (The key can be anything, the main thing is to use the same one everywhere for correct data processing.)

Value: here we transfer the value we want to save

= {{ {{ JSON.stringify({
  text: "User Message: " + ($json.update.message.text ?? "—"),
  user_id: $json.update.message.from.id ?? null,
  username: $json.update.message.from.username ? "@" + $json.update.message.from.username : ($json.update.message.from.first_name ?? "Noname user"),
  created_at: new Date().toISOString()
}) }}
  1. Add another node in parallel (from the Trigger Telegram Polling block) Logic → JavaScript → JavaScript Run

What is a Logic and JavaScript Run and why is it needed? You can find out Part 2: Nodes, Trigger, Logic, AI Agent and Part 4: Universal Http Request and JavaScript Run Nodes

JavaScript Run is a node that runs JavaScript code and passes the result further along the workflow

  1. Configure data:

Code: Here we write the code that will be executed when the node is activated

IMPORTANT! Replace “const containsBotTag = /@summascnbot/i.test(text);”
summascnbot with the name of your bot in the code, otherwise the workflow will not work.

=// Get text from Telegram Polling
const update = $json.update ?? {};
const message = update.message ?? {};
const text = (message.text ?? '').trim();

// Checking for the presence of the phrase “@summascnbot”
const containsBotTag = /@summascnbot/i.test(text);

if (containsBotTag) {
  return { text, status: 'allowed' };
}

throw new Error('Сообщение не содержит упоминания @summascnbot');      

Expose Context: True, When activated, content (variables from the workflow) can be added to the code

  1. Add (after the JavaScript Run node) Tools → Storage → Storage Get

Storage Get is a node that allows you to retrieve data from the ASCN.AI system using a key (the data itself is stored only in your profile and is not accessible to anyone except you).

  1. Configure data:

Key: summarychatbot (The key must match the one entered in the second node)

Step 2: Configuring the AI agent for chat analysis

What is a AI Agent and why is it needed? You can find out Part 2: Nodes, Trigger, Logic, AI Agent

  1. Add AI Agents → Agents Prompt

Agents Prompt - is an AI agent node that helps you set your prompt and AI model and then get the result

  1. Configure data:

UserPrompt: This is your prompt, which you send to the AI model, and you can also send the necessary data here

={{$node['Storage.Get_1'].json}}

System: Here we specify the system data for the AI model (its role, limitations, formats, etc.)

You are an AI analyst at a company. Your task is to summarize the daily communication in the work chat. Analyze all messages and compile a structured summary of the day. Be sure to highlight: 1. Main topics and discussions. 2. Key decisions or tasks that have been agreed upon. 3. Mention the names or usernames of participants if it helps to understand who raised the topic or made the decision. 4. Describe the overall dynamics and mood of the team. Write concisely, without introductory phrases or evaluations. Do not mention technical messages, greetings, stickers, or one-word responses such as “ok” or “got it.” The style should be businesslike, neutral, and readable as a finished report. DO NOT USE MarkDown FORMAT!

Provider: Openrouter (for Deepseek R1) select API Token provider for AI model

Model: openrouter/deepseek/deepseek-r1 (select the model itself)

API Token: Insert your AI token here. You can get it on the official website

Temperature: 1 (from 0 to 1; the higher the value, the more creative and imaginative the AI model will be)

Step 3: Displaying information in the chat

  1. Add Tools → Telegram → Telegram sendMessage

Telegram sendMessage is a node that sends a message to a user on behalf of a bot. In this case, it will always be sent to the designated user (potentially you yourself)

  1. Configure data:

BotToken: Your token bot, which was in the first node

ChatID: Your Telegram chatID (or chatID group/channel) where summary reports about the chat will be sent. We recommend choosing either a group (where you will initially add the bot) or your own idUser

Text: Here we write what exactly will be sent to the user. In our case, the result of the AI agent's analysis

={{$json.text}}
  1. Add Tools → Storage → Storage Remove

Storage Remove is a node that clears the memory in the ASCN.AI system according to the assigned key

  1. Configure data:

Key: summarychatbot (the key is the same as in Step 1)