DigitalBPM Guides

How to Integrate ChatGPT with Telegram and Google Docs for Marketing Text Review

About This Guide

This guide helps marketing teams — from copywriters to CMOs — automate the process of analysing marketing texts via Telegram, ChatGPT, and Google Docs integrations.
By connecting your tools with DigitalBPM, you can turn repetitive reviews into a fast, AI-assisted workflow that improves text quality, eliminates manual checks, and integrates with Google Docs for seamless document analysis.

New to DigitalBPM?
It’s a workflow automation platform that helps you focus on results — not routine. You can sign up for free and explore the functionality.

Who Is This Guide For?

This guide helps SEO experts, digital marketers, content teams, and marketing executives such as CMOs simplify daily work and automate marketing text review. If you often review articles, optimize pages, or audit content, this workflow saves time, reduces manual effort, and improves accuracy.

Why this workflow is a Game-Changer?

  1. No more switching between tools – integrate Telegram with ChatGPT and analyze content instantly.
  2. Get clear, AI-based feedback in seconds.
  3. Save CMO and editor time by automating manual checks.
  4. Boost productivity and maintain consistency across large volumes of content.
  5. Integrate Google Docs to pull article content directly from shared documents.
  6. Easily expand with more Chat GPT integrations to fit other business workflows.

Before you start creating an assistant, make sure you have everything you need:

  1. A DigitalBPM account.
  2. A Telegram account and bot are required. If you haven’t created a bot yet, follow our guide — How to Register a Chatbot in Telegram — a perfect starting point if you’re searching how to make a Telegram bot.
  3. You’ll need a ChatGPT account with API access — this lets you integrate ChatGPT into your workflow for automated decision-making and marketing text analysis.
  4. You’ll need a Google account to enable Google Docs integration and automate document handling in your workflow.

If you’re ready, let’s get started!

Step 1: Create a new workflow in DigitalBPM

  • Sign in to your DigitalBPM account and navigate to the “Automation” section.
  • Click “+ Workflow” to create a new automation.
  • In the pop-up window, enter a clear and descriptive name for your workflow — for example, “AI Assistant for Marketing Texts Analysis” — and click “OK” to confirm creation. 

This workflow will serve as the foundation for automating copywriter-related tasks using Telegram and AI tools.

Step 2: Add the first block to your workflow

  • Once your workflow is created, the Workflow Builder will open automatically.
  • To begin setting up your automation logic, click the “+ Add first block” button.

This block will act as the starting point for your automation, using Telegram integrations to get input.

Step 3: Set up the first block to initiate the workflow based on a Telegram trigger

  • Click the first block to open the “Block Configuration” panel, then select “Webhook” as the block type.
  • Under “2. Select trigger app”, search for and select Telegram. To integrate Telegram with DigitalBPM, connect your Telegram bot by selecting an existing authorization or clicking “Sign in” to add a new one.
  • Next, under “4. Select an event”, choose “Webhook create”. This event allows the workflow to instantly track new incoming Telegram messages using your bot’s token.

Step 4: Name the block to clearly indicate its purpose

  • Name the block (e.g., “Get Input”) so you can easily recognize its function later.
  • Don’t forget to click “Save” to apply the block settings.

Step 5: Add a “Case of” block to create conditional branches in your workflow

  • To insert a new block, click the “+” button to the right of the existing one. In the “Block Configuration” panel, click on “1. Select block type” and choose “Case of” from the list.
  • Now configure the first condition — for example, to handle a welcome message when the bot is started. Click on “2. Compare with variable”, then in the variables panel, select “message.text” from the Telegram service configured in the “Get Input” block.

Step 6: Add a condition to the “Case of” block to check for the “/start” command

  • Inside the “Case of” block, add a new condition. In the “Type of condition” field, select “equals”, and in the “Value” field, enter “/start”. This condition checks whether the bot has received the “/start” command.
  • If the text is “/start”, the workflow will proceed to a block that sends a welcome message to the user.

Step 7: Set up the greeting message block to respond to the “/start” command in Telegram

  • Select Block 3, which will handle the greeting text. In the Block Configuration panel, choose the block type “Execute”.
  • For the service, select “Telegram”, since the initial greeting will be sent to the user via Telegram after the bot is started. Use the same authorization that was configured in the first block.
  • To reply directly to the user in Telegram, select the “send message” method.

Step 8: Fill in the required fields to send the initial greeting in Telegram

  • Next, complete the required fields for the “send message” method. In the “chat ID” field, select the variable “message.chat.id” from the Telegram service in the first block — this ensures the text is sent to the correct user chat.
  • In the “text” field, enter the welcome message you want to send to the user, such as “Hi there! I’m your AI assistant. I’ll help you analyze Marketing Texts quickly and efficiently. To learn how to work with me, just click the button below 👇”.

Step 9:  Add an inline button below the initial greeting to provide bot usage instructions

To enhance user interaction, add a button under the welcome message that will send usage instructions when clicked.

  • In the “reply markup” section, select “inline keyboard markup” and add an inline keyboard button. This object defines the buttons displayed under the text sent to the user.
  • Fill in the following fields for the button:
    • text — this is the label shown on the button, for example: “What can the bot do?”;
    • callback data — this is the data returned when the button is pressed. It can be used to track user actions or pass data for further processing. Enter a command such as “/Instructions” to handle this interaction in your workflow.

Don’t forget to save the block settings and assign a clear name to the block for future reference.

Step 10: Handle the case when the bot is added to a group chat

Let’s configure the workflow to show a welcome message and an instruction button when the bot is added to a group. Unlike in private chats where the “/start” command is used, group additions do not trigger the “message.text” variable.

To support this, return to the “Case of” block (Block 2) and add a new condition. This condition will check if the “message.text” variable does not exist — a common case when the bot is added to a group chat.

In the “Type of condition” field, select “does not exist”. This allows your workflow to branch and handle welcome interactions for group environments.

Step 11: Configure Block 4 as a “Case of” block to verify if the bot was added to a group

In this step, we’ll confirm whether the bot itself was added to a group chat.

  • Open Block 4 and set its type to “Case of” by selecting it in the “1. Select block type” field.
  • Then, in “2. Compare with variable”, open the variables panel and choose: “message.new_chat_members.user_object.first_name” from the first block (Webhook).
  • Set the index to 1, since this variable always contains the name of the user — in this case, the bot.
  • To check if it’s your bot, set the “Type of condition” to “equals”, and in the “Value” field, enter the bot’s name — for example: AI-assistant.

Step 12: Configure Block to send a welcome note in group chats, similar to the private bot greeting

Configure Block 5 like Block 3 (User greeting (bot).

  • In the “chat ID” field, use the variable “message.chat.id” to ensure the text is sent to the correct group.
  • Add the same inline instruction button so that group members can also access the bot usage guide.
  • Assign a clear name to this block, such as “User greeting (group)”.

Additionally, since “message.text” does not exist when a button is pressed, we’ll reuse Block 4 to also check for button presses. Rename “Block 4” to something more descriptive, like “Group/Button Check”, to reflect its dual purpose in the workflow.

Step 13: Add a condition to detect button presses and prepare for handling multiple callbacks

  • In the “Group/Button Check” block, add a new condition to handle button clicks.
  • When a button is pressed, the variables “message.text” and “message.new_chat_members.user_object.first_name” do not exist.
  • To detect this, set the “Type of condition” to “doesn’t exist”.

Then, proceed to the next block, where we’ll identify which button was pressed.

This setup is flexible and allows you to expand the bot later with additional buttons under the welcome note.

  • In Block 6, select the block type “Case of”.
  • In the “2. Compare with variable” field, choose “callback_query.data” from the variable panel, using the data from the “Get Input” (Webhook) block.

Step 14: Configure block to detect the specific button pressed

  • In the “Select the button” block, click “Add condition” to create a new rule for detecting button interaction.
  • In the condition settings:
    • Set “Type of condition” to “equals”.
    • In the “Value” field, enter “/Instructions” — this is the exact string you defined earlier as the callback data when creating the instruction button.

This condition allows the workflow to recognize that the “What can the bot do?” button was clicked and respond accordingly.

Step 15: Send instructions when the button “What can the bot do?” is pressed

To display instructions when the user clicks the “What can the bot do?” button, configure a new block as follows:

  • Set the block type to “Execute”.
  • Choose Telegram as the service.
  • Select the “send message” method.
  • Since this block responds to a button press, in the “chat ID” field, choose the variable: “callback_query.message.chat.id” (from the “Get Input” block).
  • In the text field, insert the following instructional:

“📘 AI Bot Usage GuideHi there! 👋This bot will help you quickly analyze the text written by an copywriter and suggest improvements.👉 The analysis is based on a built-in prompt, which looks like this:
🔧 Default Prompt:
“Hi, I need you to analyze the text. This text is written by an copywriter, and usually the texts are very dry, written in a corporate style, or a lot of water, or written in a language that is not very clear, I want the texts to be simple and clear, without water and without too much formal style.”🧾 How to use the bot:You can:- Paste the text directly (up to 3700 characters), or- Send a link to a Google Docs document.To trigger the bot, reply to the message and mention the bot.🔁 How to do it:- Send a message with the text or Google Docs link.- Reply to that message.- Mention the bot in your reply: @AIAssistantArticleBot⚠️ Important: The bot only works with documents created in Google Docs.
If you upload a Word file to Google Drive, the bot won’t be able to read it.
Make sure the document’s sharing settings are set to Anyone with the link.”

The prompt above is set as the default. However, if required, you can extend and customize your workflow to allow dynamic configuration of prompts for Chat GPT integration. This flexibility enables advanced users to tailor the prompt to different content goals, tone requirements, or project needs.

Step 16: Add a condition to check Bot Mention

Go back to the second block and add a new condition. This condition will check whether the bot was mentioned in the message.

To do this:

  • Set the Type of condition to equals.
  • In the “Value” field, enter the bot’s username (the one used with @), for example: @AIAssistantArticleBot.
  • In this case, the text is stored in the message.text variable.

Don’t forget to give the second block a clear and descriptive name such as “Select a branch” to keep your flow organized.

Step 17: Configure a “Case of” block to check bot mention in reply

Set the next block to type “Case of”. This block determines whether the bot was mentioned in a reply to a message or in a regular message.

  • If the bot was mentioned as a reply, the workflow will proceed and pass the data for analysis.
  • If the bot is mentioned without a reply, send a reminder to tag it in a reply message.

Configuration steps:

  • In the “Compare with variable” field, add: “message.reply_to_message.text”.
  • Add the first condition: Type of condition: does not exist (this triggers the reminder text when the bot is not mentioned in a reply).
  • Add the second condition: Type of condition: exist (this allows the flow to proceed when the bot is properly mentioned in a reply).

Step 18: Configure a block for when the bot is mentioned in a regular message

If the bot is mentioned outside of a reply, we need to send the user a reminder message.

Create an “Execute” block with Telegram → “send message”. Use “message.chat.id” for chat ID (from the “Get Input” block).

In the “Text” field, set up a personalized reminder by tagging the user.

  • Start with the @ symbol — no space after it.
  • Then add the variable from the “Get Input” block: “message.from.username”.
  • After the variable, add your reminder message. For example:
    • “Hi there! 😊 To help you properly, please mention me in a reply to the specific message.”

This block allows the bot to send a direct message to the chat where it was mentioned, reminding the user to mention the bot in a reply for proper functionality.

Step 19: Configure a Decision-Making block with ChatGPT

In this step, we’ll use a Chat GPT integration combined with “Case of” logic to build smart routing and decision-making in the workflow.

  • Branch 1: triggers when the user sends a Google Document link.
  • Branch 2: triggers when the text is provided directly in Telegram (up to 3700 characters).

How to configure the Smart Brain: GPT Routing block:

  • Select the block named Smart Brain: GPT Routing.
  • Set the Block type to: Execute.
  • Under Service, choose: ChatGPT.
  • If you haven’t created an authorization yet, create a new one or select an existing one.
  • Then, choose the method: create chat (we need a new conversation to analyze the input).
  • In the required Model field, enter: gpt-4o — the latest high-performance model with improved accuracy and speed.

Let’s finish setting up the Smart Brain: GPT Routing block. We’ll add a prompt to help ChatGPT decide which branch to take.

Configure the message object:

  • Click on the “Messages” field.
  • Add a new message object.
  • In the name field, enter any identifier — for example: MyBot (this is the name of the message “author”).
  • In the role field, enter: user.

Compose the prompt:

  • In the content field, add the following instruction: “Hello! Help me analyze and make a decision: I’ll send you information, and your task is to determine the following: 1 If the message contains text, select this item. The command: /text is responsible for selecting this branch. 2 If the message contains a link to Google Docs, select this option. The command to select this branch is /link-docs. I want to receive only the command from you in response, without any extra text or explanation. For example, my message: “https://docs.google.com/document/d/17vC9EBGWDFq6TtINYvRho3WsP7oHVJgAcXIx9jkZ5Qw/edit?tab=t.0”, and I expect /link-docs in response. Process the following message:”.
  • After the promt, add the variable “message.reply_to_message.text” — it contains the content the user replied to when mentioning the bot.

🧠 This block acts as the intelligent router, deciding whether the input should be processed as plain text or via a linked document, allowing you to integrate Google Docs seamlessly into the workflow.

To complete the decision-making flow, create a new block to handle the response from ChatGPT.

Configuration:

  • Add a new block with the type: “Case of”.
  • In the field “2. Compare with variable”, insert the response variable from the “Smart Brain: GPT Routing”: “block body.choices.choice.message.content”. Set the index to 1.

Add two conditions:

  • Condition 1:
    • Type of condition: equals.
    • Value: /link-docs.
  • Condition 2:
    • Type of condition: equals.
    • Value: /text.

Thanks to this block, ChatGPT intelligently routes requests, sending them to either the Google Docs branch or the standard Telegram message branch.

Step 20: Configuring the branch for text processing in Telegram

This branch runs when the user sends plain text (up to 3700 characters) in Telegram.

Setup steps:

  • Create a new block.
  • Block type: Execute.
  • Service: ChatGPT.
  • Method: create chat — to initiate a new conversation.
  • In the Model field, enter: gpt-4o — the latest fast and accurate model.
  • Configure the message object:
    • Add a message object:
      • Name — any name.
      • Role — user.
      • For the Content field, use this prompt: “Hi, I need you to analyze the text. This text is written by an copywriter, and usually the texts are very dry, written in a corporate style, or a lot of water, or written in a language that is not very clear, I want the texts to be simple and clear, without water and without too much formal style. Text for analysis:”. Then add the “message.reply_to_message.text” variable. This variable provides the actual Telegram message for ChatGPT’s analysis.

Step 21: Configure output block to send ChatGPT result back to Telegram user

This block sends ChatGPT’s reply to the user.

Setup steps:

  • Create a new block.
  • Block type: Execute.
  • Service: Telegram.
  • Method: send message.
  • Configure the fields:
    • “chat ID” field: Use the variable from the “Get Input” block: “message.chat.id”.
    • “text” field: Insert the variable containing ChatGPT’s response (index 1): “body.choices.choice.message.content”.

Step 22: Configure the branch to analyze Google Docs Links in Telegram

Set up a branch that will analyze the content if a user sends a Google Docs link via Telegram.

Use ChatGPT to extract the Google Docs document ID from the shared link.

Set Up the ChatGPT Service Block

  • Block Type: Execute.
  • Service: ChatGPT.
  • Method: create chat.
  • Model: gpt-4o.
  • Add a message object with:
    • Name — any name.
    • Role — user.
    • Content —  “Remove the initial part “@AIAssistantArticleBot, ” and return only the Google Docs document ID found in the link. I want a clean response containing only the document ID, without any extra text.  For example, if I send: “https://docs.google.com/document/d/17vC9EBGWDFq6TtINYvRho3WsP7oHVJgAcXIx9jkZ5Qw/edit?tab=t.0” Your response should be: “17vC9EBGWDFq6TtINYvRho3WsP7oHVJgAcXIx9jkZ5Qw” Now process the following message:” Then append the variable message.reply_to_message.text from the “Get Input” block. This variable contains the actual link to the document.

Step 23: Set Up the Google Docs Block

Now let’s integrate Google Docs to retrieve the document content.

  • Block Type: Execute.
  • App: Google Docs.
  • We create authorization.
  • Method: documents get.
  • Use the ChatGPT response in the Document Id field. Make sure to set the variable index to 1.

Step 24: Configure the ChatGPT block for document content analysis

Next, set up a block that analyses the content of the Google Docs document using ChatGPT integration.

The configuration is similar to the “Text Analysis” block you previously set up (used for analyzing text received directly from Telegram).

Key Difference:

  • Replace “message.reply_to_message.text” with the variable holding the extracted document content from the Google Docs block. This is crucial for ChatGPT to analyze the complete document text, rather than a limited Telegram message.

Step 25: Send ChatGPT response back to the Telegram user

This block sends ChatGPT’s reply back to the Telegram user.

Set block type to “Execute”, service — Telegram, method — “send message”.

Filling in the fields:

  • chat id: Use the variable from the Webhook block → “message.chat.id”.
  • text: Use the variable that contains the ChatGPT response → “body.choices.choice.message.content” (set the index to 1).

🎉 Final Step: Your Automation Flow Is Ready!

Congratulations — your automation flow using ChatGPT, Telegram, and Google Docs is fully set up and ready to use!

All integrations are in place, and ChatGPT is now effectively working as the “brain” of your workflow.

What’s Next?

Simply run the workflow and start using it in real scenarios.

If you plan to use this bot in a Telegram group, make sure to assign it as an administrator so it can read messages and respond appropriately.

Enjoy your AI-powered assistant! 

🧩 How to Customize for Your Team

Adapt the workflow to your team’s roles:

  • CMO — gets AI summaries with key suggestions.
  • SEO team — sets up prompts to guide AI tone and clarity.
  • Content managers — keep docs in sync with real-time feedback.

With this setup, your team saves time, avoids confusion, and focuses only on their part of the process.

Get Started with DigitalBPM today

Sign up for a free today and start automating your business processes