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#
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.
Script template
You can create a scenario according to the instructions or use our ready-made template.
Algorithm for creating 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 webhooks trigger, instance setup: is automatically installed
"webhookUrl": "webhookserver make",
"incomingWebhook": "yes"
Algorithm for setting up a trigger:
- Create a new scenario
-
Click on the
+
sign, find GREEN-API for WhatsApp in the list of applications -
Select the Watch webhooks trigger at the beginning 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 instance
idInstance
andapiTokenInstance
(The scenario will receive messages from the number associated with this instance)The
Connection name
field can be used to name the instance being added (e.g. "work number" or "sales"). This will allow you to easily find the desired account in the list of available integrations when creating. -
Click
Save
to save the values
- Test by clicking the
Run once
button.
If the selected instance has incoming messages and the test is successful, click the magnifying glass
to see which fields will be available when configuring the action.

Done! The trigger is set up and ready to use!
How to receive notifications only from a specific chat or group?
By default, the scenario is triggered when a message is received from any number that wrote.
To run a scenario 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, it is required to enter it in international format + postfix c@us
- phoneNumber@c.us
. For example: 79876543210@c.us
.
To add multiple numbers, add the desired number of fields by clicking Add item

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.
-
Click on the
+
sign, find GREEN-API for WhatsApp in the list of applications -
Select the Send a Message module
-
From the
Connection
list, select a ready-made connection or add a new one by clicking theadd
button.When adding a new connection, fill in your instance data
idInstance
andapiTokenInstance
Then clickSave
to save. -
In the
Chat ID source
field, selectManual
: -
Click on the
Chat Id
input field, specify thesender
variable from thesenderData
object in it. -
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.