This package contains nodes for n8n that enable complete integration with Microsoft Power BI REST APIs. These nodes enable automation, integration, and orchestration of data flows with Power BI directly in n8n.
This Community Node was created and made freely available by Anderson Rocha from Universo Automático for the community and was designed to simplify and abstract all the complexity of using Power BI APIs.
- Linkedin: https://www.linkedin.com/in/andersonsantosrocha
- YouTube: https://www.youtube.com/@universoautomatico
- Instagram: https://www.instagram.com/universoautomatico/
- N8N + Power BI Training: https://n8npowerbi.com/
- Features
- Available Resources
- Authentication Methods
- Setting up the Application in Microsoft Entra ID (Azure AD)
- Using the Nodes
- Limitations and Troubleshooting
- Additional Resources
This package offers a unified Power BI node with flexible authentication methods:
Comprehensive node that supports two authentication methods:
- OAuth2 Authentication: Interactive authentication with Microsoft Entra ID (formerly Azure AD)
- Bearer Token Authentication: Direct token authentication for API integrations
- Managing reports, dashboards, and datasets
- Workspace (groups) administration
- DAX query execution
- Data refresh operations
- Report export in multiple formats
- Gateway management
- Dataflow operations
- Get Workspace Information: Retrieves complete details about workspaces, including dataset schema, DAX expressions, lineage, and data sources
- Get Scan Results: Retrieves workspace scan results
- List Dashboards: Retrieves all dashboards in a workspace
- Get Dashboard: Retrieves details of a specific dashboard
- Get Tiles: Retrieves tiles from a dashboard
- List Datasets: Retrieves all datasets in a workspace
- Get Dataset: Retrieves details of a specific dataset
- Refresh Dataset: Initiates a dataset refresh operation
- Get Tables: Lists all tables in a dataset
- Add Rows: Adds data to a dataset table
- Execute DAX Queries: Performs DAX language queries on a dataset
- Get Refresh History: Retrieves dataset refresh history
- List Dataflows: Retrieves all dataflows in a workspace
- Get Dataflow: Exports the specified dataflow definition to JSON
- Get Dataflow Data Sources: Returns a list of data sources for the specified dataflow
- Get Dataflow Transactions: Returns a list of transactions for the specified dataflow
- Refresh Dataflow: Triggers a refresh for the specified dataflow
- List Gateways: Returns a list of gateways for which the user is an administrator
- Get Gateway: Returns the specified gateway details
- Get Datasource: Returns the specified datasource from the specified gateway
- Get Datasources: Returns a list of datasources from the specified gateway
- Get Datasource Status: Checks the connectivity status of the specified datasource
- Get Datasource Users: Returns a list of users who have access to the specified datasource
- List Groups: Retrieves all accessible workspaces
- Get Group: Retrieves details of a specific workspace
- Get Reports: Lists reports in a workspace
- Get Dashboards: Lists dashboards in a workspace
- Get Datasets: Lists datasets in a workspace
- List Reports: Retrieves all reports in a workspace
- Get Report: Retrieves details of a specific report
- Get Pages: Lists pages in a report
- Export File: Exports a report in various formats
This node supports two authentication methods:
- Use case: Applications acting on behalf of a user through an interactive authentication flow, or app-only automation through a Service Principal
- Credential type: Power BI OAuth2 API
- Token management: Automatic refresh when tokens expire
The Power BI OAuth2 API credential supports two grant types, selectable from the Grant Type field:
- Authorization Code (default): Interactive, delegated authentication. A user signs in once and the node acts on their behalf, with their permissions.
- Client Credentials: App-only authentication using a Service Principal. No user interaction is required. The application authenticates with its own Client ID and Client Secret, using permissions granted directly to the app registration (see Configure API Permissions).
Use Client Credentials when you need unattended automation (scheduled workflows, backend jobs) that must not depend on any individual user's session or permissions. It requires the extra setup described in Additional Setup for Client Credentials.
- Use case: Direct API integration with pre-obtained tokens
- Credential type: Power BI API
- Token management: Manual token management required
In the node configuration:
- Select Authentication type (OAuth2 or Bearer Token)
- The appropriate credential field will appear automatically
- Configure the matching credential type
The Power BI node has been configured as an AI tool within n8n, allowing it to:
- Be easily accessed by n8n's AI assistant
- Be used in natural language-driven automations
- Appear in the AI tools palette in the flow editor
To use the Power BI node with OAuth2 authentication, you need to register an application in Microsoft Entra ID (formerly Azure AD). Follow the steps below:
- Access the Azure Portal.
- Navigate to Microsoft Entra ID > App registrations.
- Click New registration.
- Provide a name for the application, for example "n8n Power BI Integration".
- In Supported account types, select Accounts in this organizational directory only.
- In the Redirect URI section, select Web and enter:
https://your-n8n-domain/rest/oauth2-credential/callback.- For local development environment, use:
http://localhost:5678/rest/oauth2-credential/callback
- For local development environment, use:
- Click Register.
-
In the registered application's side menu, click API permissions.
-
Click Add a permission.
-
Select Power BI Service.
-
You can choose between Delegated permissions (for OAuth2) or Application permissions (for Service Principal):
For delegated permissions (recommended for most cases):
- Dataset.Read.All
- Dataset.ReadWrite.All
- Report.Read.All
- Report.ReadWrite.All
- Dashboard.Read.All
- Dashboard.ReadWrite.All
- Workspace.Read.All
- Workspace.ReadWrite.All
- Content.Create
- Tenant.Read.All (for administrative functions)
For application permissions (Service Principal):
- Dashboard.Read.All
- Report.Read.All
- Dataset.Read.All
- Workspace.Read.All
- Tenant.Read.All
-
Click Add permissions.
-
If using Service Principal, you'll need to request an administrator to Grant admin consent for [your directory].
- In the side menu, click Certificates & secrets.
- In the Client secrets section, click New client secret.
- Add a description and select an expiration period.
- Click Add.
- IMPORTANT: Immediately copy the generated secret value, as it cannot be viewed again.
Note the following values that will be needed to configure the node in n8n:
- Client ID: Found in Overview > Application (client) ID
- Client Secret: The value you copied when creating the client secret
- Tenant ID: Found in Overview > Directory (tenant) ID
If you plan to use the Client Credentials grant type, two extra steps are required beyond the standard app registration:
-
Enable service principals in the Power BI Admin Portal
- Go to https://app.powerbi.com/admin-portal > Tenant settings > Developer settings.
- Enable Allow service principals to use Power BI APIs, either for the whole organization or for a specific security group containing your app registration.
- Only a Power BI Administrator can change this setting, and it can take up to 15 minutes to take effect.
-
Add the service principal to the target workspaces
- In each Power BI workspace you want to access, go to Access > Add people or groups.
- Search for your app registration by name or Client ID and grant it Member, Contributor, or Admin access as needed.
- Without this step, workspace-scoped calls (for example
/groups/{groupId}/...) fail even when authentication succeeds.
- Add the Power BI node to your workflow.
- Select Authentication Method: Choose between OAuth2 or Bearer Token
- Configure Credentials:
-
Create a "Power BI OAuth2 API" credential with:
- Client ID: The registered application ID
- Client Secret: The generated client secret
- Grant Type:
Authorization Codefor delegated access, orClient Credentialsfor a Service Principal - Scope:
https://analysis.windows.net/powerbi/api/.default offline_accessfor Authorization Code, orhttps://analysis.windows.net/powerbi/api/.default(withoutoffline_access) for Client Credentials
-
For Client Credentials only, also set:
- Access Token URL: Replace
commonwith your Tenant ID, for examplehttps://login.microsoftonline.com/<your-tenant-id>/oauth2/v2.0/token. Thecommonendpoint does not work with this grant type.
- Access Token URL: Replace
-
Create a "Power BI API" credential with:
- Bearer Token: Your API access token
-
Select Resource and Operation: Choose the desired resource (dashboard, report, dataset, etc.) and operation
-
Configure Parameters: Set operation-specific parameters as needed
- Rate limits: The Power BI API imposes rate limits that may vary depending on your license and subscription plan. Learn more
- Permissions: Many operations require administrative or owner permissions in the workspace
- Some operations require Premium license: Certain operations like programmatic refresh or DAX queries in large volumes may require Premium capacity
