Remote Dialogflow Intent Response Management via Telegram - n8n Workflow

Use this powerful n8n workflow to securely update your Dialogflow intent responses remotely via a simple Telegram command. Features user ID and keyword validation for security.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

This n8n template is ideal for:
Chatbot developers who need a quick way to update production responses without accessing the Dialogflow console.
Technical managers requiring a secure, remote mechanism for content changes.
Anyone looking to implement a secure, command-based control system using n8n and Telegram.
Users seeking advanced examples of API interaction within an n8n workflow.

Overview

Managing bot responses often requires access to complex consoles like Dialogflow. This specialized n8n workflow solves this by creating a secure, command-line interface directly within Telegram. The core value of this n8n automation is security and convenience. It triggers only upon receiving a message from a whitelisted user ID and containing a specific keyword (e.g., 'update'). Once validated, the n8n workflow executes a PATCH request to the Dialogflow API using Google Service Account credentials, instantly applying predefined changes to the target intent's responses. This robust system ensures that only authorized personnel can initiate critical updates to your AI agents.

How it Works

This n8n workflow operates in four main steps, triggered by a message in Telegram:


  1. Telegram Reception (n8n Trigger): The n8n workflow starts immediately when a message is received by the configured Telegram Bot.

  2. Validation Logic: The automation first passes the incoming data through the User validation by ID n8n node (an If statement). If the sender's ID matches the predefined user, it proceeds. If not, an 'Invalid user' message is sent.

  3. Keyword Check: If the user is valid, the flow hits the Keyword validation n8n node, checking if the message text is exactly 'update'. If the keyword is incorrect, an 'Invalid word' message is sent.

  4. Intent Update: If both validations pass, the flow executes the crucial HTTP Request UPDATE n8n node. This node performs a PATCH request to the Dialogflow API URL for a specific intent ID. The request body contains the complete, modified JSON structure of the intent, including the desired new response text. This updates the intent in Dialogflow.

  5. Confirmation: Finally, the Mensaje de confirmación n8n node sends a success message back to the initiating user via Telegram, confirming that the intent update was completed successfully. This completes the robust n8n workflow cycle.

Installation Guide

To deploy this n8n template, follow these steps:


  1. Import the n8n Workflow: Copy the provided JSON and import it directly into your n8n instance using the 'New' > 'Import from JSON' function.

  2. Set Up Credentials:

Telegram: Configure the Telegram Trigger n8n node and the subsequent Telegram message nodes with your Telegram Bot API token.
Google Service Account: You must configure a Google API credential using a Service Account that has permissions to interact with the Dialogflow API (dialogflow.intents.patch). This credential must be linked to the HTTP Request UPDATE n8n node.

  1. Configure Validation: In the User validation by ID n8n node, replace the placeholder {{ TelegramuserID }} with the actual Telegram User ID of the authorized updater.

  2. Configure Dialogflow Target: Update the URL in the HTTP Request UPDATE n8n node to point to your specific Dialogflow project ID and the exact Intent ID you wish to modify. (Refer to the sticky notes in the n8n workflow for guidance on finding the Intent ID).

  3. Define Update Payload: The body of the HTTP Request UPDATE n8n node must contain the entire JSON structure of the Dialogflow intent, with the messages field updated to reflect the new response text. Ensure you remove the external array brackets ([]) from the JSON payload.

  4. Activate: Save and activate the n8n workflow.

Node Details

This n8n workflow utilizes several key n8n node types to achieve secure and reliable automation:

Telegram Trigger (n8n Trigger):
Function: Serves as the starting point, listening for incoming Telegram messages.
Key Configuration: Configured to listen specifically for 'message' updates.

User validation by ID (If n8n node):
Function: Enforces security by checking if the incoming message sender ID matches a known, authorized user ID (checked against a variable TelegramuserID).
Key Configuration: Compares {{ $json.message.from.id }} to the user ID.

Keyword validation (If n8n node):
Function: Ensures the user intended to run the update command by validating the message text is exactly 'update'.
Key Configuration: Checks if {{ $json.message.text }} equals 'update'.

HTTP Request UPDATE (n8n node):
Function: Performs the critical API call (HTTP PATCH) to Dialogflow to overwrite the existing intent definition with the new content.
Key Configuration: Method set to PATCH. Uses a predefined Google API Service Account credential. The body is complex JSON representing the full intent structure, including updated text responses.

Mensaje de confirmación (Telegram n8n node):
Function: Notifies the user that the n8n workflow executed successfully, confirming the updated intent name (displayName).
* Key Configuration: Sends the message back to the originating chatId ({{ $('Telegram Trigger').item.json.message.from.id }}).

Related n8n Workflows

Free

Nodes: 5 Nodes
Updated: December 26 2025
View all
Created by

Soy un apasionado de la tecnología. Me entusiasma el desarrollo y la implementación de chatbots y automatizaciones. Disfruto simplificando procesos y mejorando la experiencia del usuario.

Featured*