Dialogflow Intent and Priority Backup to Google Sheets via Telegram - n8n Workflow

Use this secure n8n workflow to export Dialogflow intents, analyze their priority levels using an n8n code node, and log the structured data automatically into Google Sheets.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Bot Developers and QA Engineers who need a traceable history of their Dialogflow agent configuration.
Users seeking advanced n8n templates that combine secure access control (Telegram ID validation) with custom data transformation.
Teams needing a simple, command-line interface to execute complex backend tasks using n8n automation.
Anyone looking for a practical application demonstrating the power of the n8n code node for data parsing and enrichment.

Overview

Managing large AI agents requires robust monitoring of configuration changes, especially intent priorities. This powerful n8n workflow solves the problem of manual data extraction by automating the entire backup process using a secure Telegram command. When a designated user sends the 'backup' command, the n8n trigger activates the flow.

This unique n8n template integrates critical security checks, ensuring only authorized users can request the data dump. Furthermore, it employs a custom n8n node (the Code node) to analyze the numerical priority values returned by the Dialogflow API and map them to clear textual and emoji indicators (Highest, High, Normal, Low), providing instant, actionable intelligence when the data lands in Google Sheets. This highly efficient n8n workflow guarantees timely and structured documentation of your agent's current state.

How it Works

This automation sequence starts with the primary n8n trigger and executes a series of validation and processing steps:


  1. Telegram Trigger Activation: The n8n workflow is initiated when the Telegram Trigger receives any message directed to the connected bot.

  2. User Validation (If node): The flow immediately checks the sender's Telegram User ID against a pre-configured, authorized ID. If the ID is invalid, the user receives an 'Usuario inválido' message via Telegram, and the n8n workflow stops execution down this path.

  3. Command Validation (If node): If the user is authorized, the n8n node verifies that the message text is exactly 'backup'. If the command is incorrect, the user receives a 'Palabra inválida' message.

  4. Dialogflow API Call (HTTP Request n8n node): If both checks pass, the n8n workflow executes an authenticated HTTP request to the Dialogflow API to fetch all current intents for the specified project ID.

  5. Data Transformation (Code n8n node): The custom Code n8n node is the heart of this n8n template. It processes the complex JSON response from Dialogflow, extracts the displayName and priority for each intent, and applies JavaScript logic to assign clear priority classifications (e.g., 🔴 Highest, 🔵 Normal).

  6. Google Sheets Registration: The transformed data items (one item per intent) are sequentially processed. The Google Sheets n8n node appends a new row for each intent, including the name, priority text/color, numerical priority value, and the timestamp of the recording.

  7. Confirmation: Finally, a Telegram n8n node sends a confirmation message back to the authorized user, specifying how many intents were successfully registered in Google Sheets. This confirmation uses the 'Execute Once' option to ensure only one final message is sent, regardless of the number of items processed by the Sheets node.

Installation Guide

To implement this advanced n8n workflow, follow these setup steps:


  1. Import the n8n Workflow: Copy the provided JSON and import it into your n8n instance.

  2. Telegram Credentials: Set up your Telegram Bot API credentials for the Telegram Trigger and the subsequent Telegram action nodes.

  3. Secure Access Setup: In the Validación de usuario por ID n8n node, replace the placeholder user ID (7894561234) with the actual Telegram ID of the user authorized to run the backup.

  4. Google Sheets Credential Setup: Authenticate the Añadir fila en la hoja n8n node with your Google Sheets credentials and select the target Spreadsheet ID and Sheet Name where the data will be written.

  5. Dialogflow/Google API Setup:

Create or use an existing Google API credential within n8n.
Ensure the associated service account has the necessary permissions to read Dialogflow intents (Dialogflow API Client).
* In the Obtiene datos de los intents n8n node, replace TUPROJECTID in the URL with your actual Dialogflow project ID. This HTTP Request n8n node must use the configured Google API authentication.

Node Details

Telegram Trigger (n8n trigger): Sets the automation in motion upon receiving any Telegram message. It acts as the primary n8n trigger point.
Validación de usuario por ID (If n8n node): A security checkpoint. It verifies that the incoming message originates from a whitelisted Telegram User ID.
Validación del comando (If n8n node): Checks if the incoming message text is exactly the required command ('backup').
Obtiene datos de los intents (HTTP Request n8n node): Sends an authenticated request using Google API credentials to the Dialogflow v2 API to retrieve all intents and their associated metadata.
Mapear intents con su prioridad (Code n8n node): This crucial transformation n8n node uses custom JavaScript to iterate over the intents array, extract the numerical priority, and translate it into standardized descriptive text and corresponding emojis (e.g., 'Highest', 'Low'). This prepares the data structure for consistent logging in Google Sheets.
Añadir fila en la hoja (Google Sheets n8n node): Appends the structured intent data, including the name, priority level, color code (emoji), and processing timestamps, to the designated Google Sheet.


  • Mensaje de confirmación (Telegram n8n node): Provides feedback to the user, confirming the successful execution of the n8n workflow and reporting the total count of intents exported.

Related n8n Workflows

Free

Nodes: 7 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*