Lucy
  • Introduction to Lucy
  • Getting Started
  • Key Components
  • Gallery (Dashboards)
    • Creating a Canvas
    • Editing Properties of a Canvas
    • Searching and Viewing Your Canvases
    • Adding Widgets onto Your Canvas
    • Customising User-created Widgets on a Canvas
    • Adjusting Widget Settings
    • Moving a Widget around a Canvas
    • Resizing a Widget on a Canvas
    • Filtering Data in a Widget
    • Deleting a Widget from Your Canvas
    • Building a Widget from Your Canvas
    • Customising a Canvas
  • My Work (Folders)
    • Creating a New Folder
    • Searching and Viewing Your Folders
    • Adding Notes related to a Folder
    • Databases
      • Understanding Databases
      • Creating and Editing Databases
        • Creating a Database Manually
        • Creating a Database by Importing Data from an External Source
        • Using an External Source as a Database
        • Editing Fields in a Database
      • Editing Data in a Database
      • Using the Database Collection Viewer
      • Searching, Filtering, and Sorting Data in a Database
      • Exporting Data from a Database
      • Utilising Content-aware Autofill to Automatically Fill in Fields in Your Database
      • Entering a Question about Databases within a Folder to Build Your Own Widget
      • Adding Data into a Database
    • User Interfaces
      • Designing a User Interface
        • Designing a User Interface to Visualise Information
        • Designing a User Interface to Capture User Feedback
        • Designing a User Interface from Scratch
      • Working with the Widget Designer
      • Selecting a Widget Template
        • Item List Widget Template
      • Viewing Your User Interfaces
      • Sharing a User Interface
      • Saving a Widget as a Template
      • Exporting a User Interface
      • Enabling Anonymous Access to a User Interface
    • Workflows and Integrations
      • Using the Workflow Editor
      • Creating Workflows
      • Creating a Workflow to Run When New Data is Added to a Database
      • Creating a Workflow to Run When an Email is Received
      • Creating a Workflow to Run When a Message from a Chatbot is Received
      • Creating a Workflow that Runs at Specified Intervals
      • Viewing and Editing Your Workflows
      • Automating Form Submission with Email Notification
      • Automating Form Submission with Slack Message
  • Add-ons
    • Installing a New Add-on in Lucy
    • Visitor Management
    • Monitoring Internal Air Quality (IAQ) at Your Workplace
    • Setting up Occupancy Analytics at Your Workplace
    • Energy Budgeting
    • Water Budgeting
    • Gas Budgeting
    • Carbon Footprint Calculation
    • Weather
  • Mobile App
    • Getting Started
    • Designing Your Mobile App
      • Working with the Mobile App Designer
      • Handling Button Click Events
      • Designing the Login Page
      • Designing the Homepage
      • Designing the Settings Page
      • Choosing a Page Type
      • Adding a New Tab to the Bottom Navigation Bar
      • Launching a Widget on Tab Click
  • Users
    • Registering a User
    • Creating a User Group
    • Searching and Viewing Users
    • Editing User Details
    • Your Profile
  • News Feeds
    • Creating a News Feed
    • Searching and Viewing News Feeds
    • Editing a News Feed
Powered by GitBook
On this page
  • Creating a Database
  • Creating a Workflow
  • Testing the Workflow
  1. My Work (Folders)
  2. Workflows and Integrations

Creating a Workflow to Run When a Message from a Chatbot is Received

You can create workflow automations linked to popular messaging apps. This way, users can interact with Lucy through their favorite chat app, while the system automatically handles tasks whenever a message is posted in a chat.

Lucy now supports creating bots for Telegram, the widely-used messaging platform. Easily register a new bot and integrate it with a Lucy workflow for seamless bot operations.

Let's create a simple chatbot that will receive requests from clients, store them in a database and send a confirmation email to the client after the request is received.

Here are the steps:

  1. Creating a Database

  2. Creating a Workflow

  3. Testing the Workflow

Creating a Database

We'll create a database manually.

  1. On the app homepage, go to the My Work tab on the left sidebar.

  2. Click on the required folder to open it.

  3. If you cannot locate the folder in the list, type in the folder name under Search Folders. From the search results, click on the desired folder to open it.

  4. Go to the Databases tab.

  5. Click the Plus icon and pick Create Manually option.

  6. Enter a name for your database, e.g., Complaints.

  7. Click Continue.

  8. Click Skip this step.

  9. Add required fields.

    1. Click Add New Field button.

    2. Type in the Field names.

    3. The type of the field will be automatically picked by the system.

    4. Click Go to next Step.

  10. Click Create New Database. The database will be created within the folder.

Creating a Workflow

Upon creating the database, we'll create a simple workflow that triggers whenever someone sends a message via a telegram bot.

  1. On the app homepage, go to the My Work tab on the left sidebar.

  2. Open the same folder where you created the database.

  3. Go to the Workflows tab.

  4. Click the Plus icon and the Workflow Editor page opens.

  5. Select How do you want to trigger your workflow? box.

  6. Select When a telegram message from bot has been received trigger.

  7. Choose a Telegram bot.

    1. If you have existing bots created, pick the bot from the selection box or you can create a new one.

  8. Register a bot. To register a bot, you need to start conversation with the BotFather account.

    1. To create new bot, click Create a Telegram bot option.

    2. This opens a instruction window with a video to guide you.

    3. Download the Telegram desktop app and sign in to your account.

    4. Add BotFather user.

    5. To start a conversation with the BotFather account, enter the '/newbot' command.

    6. Enter a name for your bot.

    7. Then provide a Username for the bot.

    8. Your bot will be created and you will get a token from the bot as a reply message.

  9. Enter your bot details.

    1. On the workflow editor window, open the instructions window.

    2. Under the Step 4: Enter your bot details section, enter your Bot Registration Token.

    3. Type in the Bot Name.

    4. In the Bot Handle text box, provide the username.

    5. Click Save.

  10. Populate data into the database.

    1. On the workflow editor, click the plus icon to add another block.

    2. Select the Databases and Analytics category block and pick the Insert into Database block.

    3. Pick required tokens for the database attributes.

  11. On the workflow editor, click the plus icon to add another block.

  12. Pick the Send Email block.

  13. Provide a meaningful name for the workflow and save it. Now our workflow is created.

All your saved workflows will be listed under the Workflows tab within the respective folder.

Testing the Workflow

Let's see how our workflow functions.

  1. Open the bot in the Telegram app.

  2. Send a complaint message.

  3. Let's check our database.

    1. Go to the Databases tab within your folder.

    2. Click the respective database to open it. You will see the message from the bot has been added to the database.

When a message is sent via the Telegram app, it is added to the database, and send an email to the client.

Watch below video on setting up a chatbot to receive requests from clients and add them into a database. Also, send an email to the client, once the request is received.

PreviousCreating a Workflow to Run When an Email is ReceivedNextCreating a Workflow that Runs at Specified Intervals

Last updated 9 months ago

Click the arrow icon and pick the database we previously created.

Click the arrow icon and fill in the email details (Enter the Subject, To and Body fields).

Adding Fields to the database
Newly created database
Selecting a Telegram Bot or creating a new bot
Entering your bot details
Designing the workflow screen 1
Designing the workflow screen 2