Microsoft TeamsERPNext Agent view

How to add Microsoft Teams to ERPNext

Short answer

ERPNext has no native Teams channel, so you connect it with a Webhook DocType that posts to a Power Automate workflow or a small Bot Framework service. Adaptive Cards carry approve and reject buttons, and the callback hits a whitelisted ERPNext method using a scoped API user.

Companies that run ERPNext often run Microsoft 365 beside it, and the office staff live in Teams all day. The Desk is a browser tab they open when they have to. Approvals pile up there: Material Requests, Purchase Orders over a threshold, Leave Applications, Expense Claims. The Workflow DocType emails the approver, but email is where requests go to be forgotten.

Teams can be the place where the nudge happens and where the decision is taken. The practical question is how much you want to build. A one-way alert into a channel is an afternoon. An interactive card that approves a document in ERPNext on behalf of a named person is a small project, because identity, permissions and audit all have to line up.

What teams use it for

Purchase Order approval cards

When a Purchase Order enters a 'Pending Approval' Workflow state, post an Adaptive Card to the approver with supplier, total and top lines, plus Approve and Reject buttons.

Low stock and reorder alerts to a purchasing channel

ERPNext auto-creates Material Requests from Item reorder levels. Post a summary of new requests to a purchasing channel each morning so buyers start the day on the right list.

Quality failures to a production channel

A failed Quality Inspection or a new Non Conformance record posts a card with item, batch and inspector to the quality channel, with a link straight to the document.

Sales order won notifications

Large Sales Orders submitted trigger a message to the planning channel so production sees demand before the first MRP run, not after.

Ask-the-ERP in a Teams chat

A bot lets staff ask 'which POs are late for supplier X' and replies with read-only data from the API, respecting the asker's own permissions.

ERPNext integration surface

  • Webhook DocType: on_submit, on_update or after_insert events with a condition and a Jinja JSON body, suitable for posting to an HTTPS endpoint such as a Power Automate flow trigger.
  • Workflow and Workflow Action DocTypes: states, transitions and allowed roles; your callback should move a document with the same transition names instead of editing the state field.
  • REST endpoints /api/resource/<DocType> and /api/method/<path>, with token authentication for a service user or OAuth through the built-in OAuth Provider settings, depending on version.
  • Frappe also supports Social Login Key for providers; Microsoft Entra ID via OAuth/OIDC is commonly configured here so staff use the same identity in both places.
  • Server Scripts and custom app hooks for logic that needs to enrich a card, such as pulling the supplier's open PO count before posting.

How it works

  1. 1

    Pick the Teams delivery mechanism

    Microsoft has been moving teams away from classic Incoming Webhook connectors toward Workflows built on Power Automate, so check the current guidance for your tenant. For interactive cards that call back, plan for an Azure Bot Framework bot.

  2. 2

    Register the identity

    Create an Entra ID app registration for the bot. In ERPNext, create a service User with only the roles the callback needs, and keep its API key in your service's secret store.

  3. 3

    Post from ERPNext

    Create a Webhook on the DocType and event, with a condition like grand_total over your threshold. The JSON body carries the document name, approver email and a deep link to the form.

  4. 4

    Build the Adaptive Card

    Render summary facts and Action.Submit buttons that include the document name and the transition. Keep the card short; a link to the ERPNext form handles detail.

  5. 5

    Handle the button press

    The bot receives the activity, identifies the Teams user, maps their email to the ERPNext User, and checks they are a valid approver for the current Workflow state before acting.

  6. 6

    Apply the transition and update the card

    Call a whitelisted method that applies the Workflow action as that user context where possible, then update the original card to show who decided and when.

Example flows

Approve a Material Request from Teams

Trigger: Material Request moves to the 'Pending' Workflow state.

  1. Webhook posts document name, requester and item lines to the bot service.
  2. The bot sends the approver an Adaptive Card with Approve and Reject.
  3. The approver clicks Approve; the bot verifies their ERPNext role for the state.
  4. The bot calls the ERPNext method to apply the transition and edits the card to a 'decided' view.

Result: The request moves on in minutes, and the ERPNext version history shows the transition with the correct user.

Daily purchasing digest

Trigger: A scheduler event at 07:30 each weekday.

  1. A scheduled job queries open Material Requests and overdue Purchase Order items through the API.
  2. It groups them by buyer and builds a card per team.
  3. The card is posted to the purchasing channel with links to filtered list views.

Result: Buyers start with a prioritised list rather than opening five reports.

Keeping data on-prem

ERPNext can stay fully on-prem, but Teams is a Microsoft cloud service, so the integration needs an outbound path to Microsoft endpoints and an inbound HTTPS endpoint for bot callbacks. The usual pattern is a small service in a DMZ that holds the bot credentials and talks to ERPNext over an internal address, with ERPNext itself not exposed to the internet. If you add AI to summarise documents or answer questions in chat, run the model on your own hardware and pass only the minimum fields into a card. Sites that cannot allow any cloud messaging should use an on-prem chat tool instead and keep the same webhook pattern.

Security checklist

  • Map the Teams user to an ERPNext User before acting, and enforce Workflow role checks server side, never trust the card payload.
  • Use a service account with the narrowest roles and rotate its key; store it in a secret manager, not in the flow definition.
  • Sign or verify callback requests, and expire cards so old buttons cannot be replayed.
  • Keep cards to identifiers, totals and links; sensitive attachments stay behind ERPNext login.
  • Audit approvals in ERPNext as well as Teams, so the system of record has the evidence.

Ways to get it done

Webhook to Power Automate flow

Effort: A day or two per alert type.

One-way alerts and simple links when your tenant already uses Power Automate and you want no custom code.

Custom Teams bot with Adaptive Cards

Effort: Several weeks with Azure registration, testing and tenant approval.

Interactive approvals and Q&A where identity and role checks must be exact.

Partner build with Netray

Effort: Pilot on a single approval type, then extend.

Teams with approvals plus an AI layer that explains a document before the approver decides, running on local models.

Pitfalls

  • !Letting the card carry the transition and trusting it blindly allows spoofed approvals; always re-validate on the server.
  • !Using shared channel credentials makes the audit trail say 'bot approved'; carry the human identity through.
  • !Tenant admin consent for bot apps can take weeks; start the request early.
  • !Cards cannot hold large tables well; link to the form for anything beyond a few lines.
  • !Posting on every update floods the channel; limit to state changes.

Frequently asked questions

Is there an official ERPNext Teams connector?

I am not aware of one in the core product. Teams is usually reached by a Webhook DocType posting to a Power Automate workflow, a community Frappe app, or a custom bot. Check the Frappe marketplace for the current state before building.

Can approvers approve inside Teams?

Yes with a bot and Adaptive Cards, provided the callback maps the Teams user to an ERPNext user and applies the Workflow transition under the right permissions. Simple Power Automate flows can also do approvals using the Approvals connector and then call the ERPNext API.

Do I need Azure to do this?

For one-way alerts through Power Automate, you mainly need a Microsoft 365 tenant. For an interactive bot you register an app in Entra ID and usually host the bot service somewhere, which can be on your own servers or in Azure.

Will it work with ERPNext on Frappe Cloud?

Yes. Webhooks and the REST API work the same way. Custom apps may be limited by what the hosting plan allows, so check whether you can install the app you need before committing to a design.

How do I sign users in with their Microsoft account?

Frappe supports OAuth based sign-in through Social Login Key, and Microsoft Entra ID can be configured as a provider. The exact fields differ by version, so follow the current Frappe documentation and test with a non-admin account first.

Want Microsoft Teams working on your ERPNext?

A free 30 minute assessment: we map the integration path for your version and setup, and where it should run.

Get a free assessment