How to Create WhatsApp Echo Bot Using GREEN-API in Make#
How to create an echo bot:
- Setting up the Green-API application
- Creating a scenario
- Setting up receiving incoming messages
- Sending a message
- Launching and testing the bot
Setting up the Green-API application#
Setting up the Green-API application is described in detail in the section Integration setup
Creating a scenario#
A Scenario is an automated process created in Make.
Each scenario consists of a trigger and an action. When a trigger is fired in one application, Make automatically performs the action in the other.
Scenario template
You can create a scenario according to the instructions or use our ready-made template.
Steps to create a scenario:
- Log in or register an account in Make
-
Click the
Scenarios
button in the sidebar -
On the scenarios page, click
Create a new scenario
to create a new scenario -
Scenario successfully created!
After creating the scenario, a plus sign (adding a module) will appear on the Make page.
Setting up receiving incoming messages#
To receive messages in Make, you need to set up a trigger:
Setting up an instance
When using the Watch Incoming Webhooks trigger, instance setup: is automatically installed
"webhookUrl": "https://hook.eu2.make.com/xxxxxxxxxxxxxxxxxxxx",
"incomingWebhook": "yes"
- Create a new scenario
-
Click on the
+
sign, in the list of applications find GREEN-API for WhatsApp -
Select the Watch Incoming Webhooks trigger at the top of the list
-
Click on the added module to open its settings
-
Click
Create a webhook
to add a webhook -
Click
Create a connection
to add a connection to the instance- Specify the values of your
idInstance
andapiTokenInstance
(The script will receive messages from the number linked to this instance)
The Connection name field can be used to name the instance being added (for example, "work number" or "sales").
This will allow you to easily find the required account in the list of available integrations when creating. - Specify the values of your
Filter messages by sender number
By default, the script activates when a message is received from any number.
To run the script when a message is received from a specific number (or several specific numbers), use the chatIds
parameter.

-
The number can be selected from the contact list by clicking on the drop-down list icon:
-
The number can be added manually by entering it in the
ChatId
field:
When filling in the number manually, enter it in international format + postfix c@us
- phoneNumber@c.us
.
For example: 79876543210@c.us
.
To add multiple numbers, add the required number of fields by clicking Add item

- Click
Save
to save your settings
- Test by clicking
Run once
.
If the selected chat has incoming messages and the test is successful, click the magnifer
to see what fields will be available when configuring the action.

Done! The trigger is set up, ready to use!
Sending a message#
After setting up the receipt of incoming messages, you need to create an action that will respond to the user with the same text.
To do this, find GREEN-API for WhatsApp in the list of applications

-
Select
Send a Message
module -
From the
Connection
list, select a ready-made connection or add a new connection by clicking theadd
button.When adding a new connection, specify your instance values
idInstance
andapiTokenInstance
Then click
Save
to save. -
As a recipient, select the sender from the
incomingMessageReceived
notification received in the Watch Incoming Webhooks module- Click on the
Chat Id
input field. - A window will open on the right with data received via the trigger.
- Specify the
chatId
variable from thesenderData
object as theChat Id
.
- Click on the
-
In the
Message
field, specify the variable with the message text.Since the message text can be transmitted in different fields depending on the message type, it is recommended to specify the condition: "
extendedTextMessageData.text
should only be used iftextMessageData: textmessage
is empty" -
Click
Save
to save the settings -
Run a test by clicking the
Run once
button. If the test is successful, click on themagnifying glass
to see the action result details
Done! Echobot is ready to run
How to configure the bot to respond only to certain messages?
In some situations, it may be useful for the bot to respond only to certain messages from the chat, for example, when the bot is in a group.
Let's configure our bot to respond to messages with the text !green-bot
.
To do this, we will use filters. You can configure them by clicking on the dots linking the webhook and sending the message.

As an example, we will check the incoming message for the phrase !green-bot
.
- In the
Condition
parameter, we specify a variable with the message text.
Since the message text can be transmitted in different fields depending on the message type, it is recommended to specify the condition:
"iftextMessageData: textmessage
is not empty, then use it; otherwise, useextendedTextMessageData.text
"
- In the
Text operators: Equal to
parameter, specify the text that the bot will respond to

We set the check condition to Starts with
, to check for the presence of a phrase at the beginning of the message

Now the bot will only respond to messages starting with !green-bot
.
To remove this part of the message and get only the user's text request, we will use the Replace
module from the built-in Text parser
application.
Create a module between the webhook and sending a message

Select the Replace
module

In the Pattern
field, enter the phrase that we will delete. In our case, !green-bot
(with a space at the end)

In the New Value
field, insert the variable emptyString
to replace the phrase with an empty string

As the text for processing, select textMessage

In the Send a Message module, replace the text of the response message with output of the Replace
module

After this setup, the bot will only respond if the phrase !green-bot
is entered at the beginning of the message
Launching and testing the bot#
To ensure that the echo bot works continuously, you need to run automation by activating the switch.

Now the bot is launched and ready to work. You can check its functionality by writing to the number associated with the instance. The bot will respond with the same message in response.

This completes the bot setup.