n8n-nodes-kusto
v0.3.1
Published
N8N community node for running Azure Data Explorer (Kusto) KQL queries via the REST API.
Maintainers
Readme
n8n-nodes-kusto
This is an n8n community node that lets you execute KQL queries against Azure Data Explorer (Kusto) clusters directly from your n8n workflows.
It authenticates via Azure AD service principal (client credentials) or OAuth2 Authorization Code flow and calls the Kusto REST API to run queries and management commands, returning rows as JSON items.
n8n is a fair-code licensed workflow automation platform.
Table of Contents
- Installation
- Prerequisites
- Credentials
- Node Reference
- Usage Examples
- Development
- Compatibility
- License
- AI Transparency
- Contributing
Installation
Follow the installation guide in the n8n community nodes documentation.
Via n8n UI
- Go to Settings → Community Nodes
- Enter
n8n-nodes-kusto - Click Install
Via npm (self-hosted)
cd ~/.n8n
npm install n8n-nodes-kustoThen restart your n8n instance.
Prerequisites
- An Azure Data Explorer cluster (e.g.
https://mycluster.westeurope.kusto.windows.net) - One of the following authentication methods:
Option A: Service Principal (Client Credentials)
Best for server-to-server automation where no interactive sign-in is needed.
- An Azure AD (Entra ID) App Registration with:
- A client secret
- Permissions granted on the Kusto cluster (viewer / admin role)
- The tenant ID, client ID, and client secret from the app registration
Setting up Service Principal credentials
- Go to Azure Portal → App registrations
- Register a new application (or use an existing one)
- Under Certificates & secrets, create a new client secret — save it
- In your Kusto cluster, grant the app permissions:
.add database MyDatabase viewers ('aadapp=<client-id>;<tenant-id>') - Note your Tenant ID (from Azure AD overview), Client ID (from app overview), and the Client Secret value
Option B: OAuth2 Authorization Code
Best for interactive / cross-tenant scenarios where the user signs in via browser.
- An Azure AD (Entra ID) App Registration with:
- A Web redirect URI:
https://<your-n8n-host>/rest/oauth2-credential/callback - API permissions:
Azure Data Explorer→user_impersonation(delegated) - For multi-tenant access: set the app to Accounts in any organizational directory
- A Web redirect URI:
- The tenant ID (or
common/organizationsfor multi-tenant), client ID, and client secret
Credentials
Kusto API (Service Principal)
Select Authentication Type → Service Principal in the node, then add Kusto API credentials:
| Field | Description | | --------------- | ------------------------------------------------------------ | | Tenant ID | Azure AD (Entra ID) tenant ID (GUID) | | Client ID | Azure AD application (client) ID (GUID) | | Client Secret | Azure AD application client secret (stored securely) |
Kusto OAuth2 API
Select Authentication Type → OAuth2 in the node, then add Kusto OAuth2 API credentials:
| Field | Description |
| --------------- | ------------------------------------------------------------ |
| Tenant ID | Azure AD tenant ID — use common or organizations for multi-tenant (default: common) |
| Cluster URL | Azure Data Explorer cluster URL — used to scope the access token |
| Grant Type | Authorization Code (interactive sign-in) or Client Credentials (app-only) |
| Client ID | Azure AD application (client) ID |
| Client Secret | Azure AD application client secret |
After saving, click Connect (for Authorization Code) to sign in via the browser. n8n manages token refresh automatically.
Node Reference
Kusto Query
Operations:
| Operation | Description |
| -------------------- | ---------------------------------------------------- |
| Query | Execute a read-only KQL query |
| Management Command | Execute a control command (e.g. .show tables) |
Parameters:
| Parameter | Type | Required | Description |
| -------------------- | -------- | -------- | ---------------------------------------------------- |
| Authentication Type | select | ✅ | Service Principal or OAuth2 |
| Cluster URL | string | ✅ | Azure Data Explorer cluster endpoint URL |
| Database | string | ✅ | Target database name |
| KQL Query | string | ✅ | The KQL query or management command to execute |
Options:
| Option | Type | Default | Description |
| ------------------- | ------- | ------- | -------------------------------------------------- |
| Server Timeout | string | 4m | Server-side query timeout (e.g. 10m, 1h) |
| No Truncation | boolean | false | Disable result truncation (return all rows) |
| Client Request ID | string | | Custom request ID for tracing |
Usage Examples
Example 1: Simple query
- Add a Manual Trigger node
- Connect a Kusto Query node
- Configure:
- Cluster URL:
https://mycluster.westeurope.kusto.windows.net - Database:
MyDatabase - KQL Query:
StormEvents | take 10
- Cluster URL:
- Execute the workflow
Each row from the result set is returned as a separate n8n item with all columns as JSON properties.
Example 2: Aggregation query
StormEvents
| summarize EventCount = count() by State
| top 5 by EventCount descReturns items like:
[
{ "State": "TEXAS", "EventCount": 4701 },
{ "State": "KANSAS", "EventCount": 3166 },
...
]Example 3: Management command
Set Operation to Management Command and use:
.show tablesReturns one item per table with columns like TableName, DatabaseName, Folder, etc.
Example 4: Using expressions
You can use n8n expressions in the KQL Query field:
{{ $json.tableName }} | where Timestamp > ago({{ $json.hours }}h) | countDevelopment
Build
git clone https://github.com/sergey-goncharenko/n8n-community-kusto.git
cd n8n-community-kusto
npm install
npm run buildTest locally with n8n
# In the n8n-nodes-kusto directory:
npm link
# In the n8n directory (or ~/.n8n):
npm link n8n-nodes-kusto
# Restart n8n
n8n startLint
npm run lint
npm run lintfixCompatibility
| n8n Version | Compatible | | ----------- | ---------- | | ≥ 1.0.0 | ✅ |
- Node.js: ≥ 18.0.0
- Azure Data Explorer REST API: v1
License
🤖 AI Transparency
This project was developed with AI-assisted tooling:
- GitHub Copilot in VS Code — powered by Claude Opus 4.6 (Anthropic) for code generation, architecture decisions, and iterative development
- GitHub.com Copilot — for code review, CI/CD pipeline design, and npm publishing workflow
- Microsoft Copilot — for Azure Data Explorer API research and documentation
All AI-generated code was reviewed, tested, and validated by the maintainer against live Azure Data Explorer clusters.
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines on:
- Reporting bugs and requesting features
- Setting up the development environment
- Submitting pull requests
- Coding standards and commit conventions
Please read our Code of Conduct before participating.
