Microsoft Teams

Actions

The Microsoft Teams node allows you to automate work in Microsoft Teams, and integrate Microsoft Teams with other applications. n8n has built-in support for a wide range of Microsoft Teams features, including creating and deleting, channels, messages, and tasks.

On this page, you'll find a list of operations the Microsoft Teams node supports and links to more resources.

Credentials

Refer to Microsoft credentials for guidance on setting up authentication.

Examples and templates

For usage examples and templates to help you get started, take a look at n8n's Microsoft Teams integrations list.

Basic Operations#

  • Channel
    • Create a channel
    • Delete a channel
    • Get a channel
    • Get all channels
    • Update a channel
  • Channel Message (Beta)
    • Create a message
    • Get all messages
  • Task
    • Create a task
    • Delete a task
    • Get a task
    • Get all tasks
    • Update a task

Example Usage#

This workflow allows you to create, update and send a message to a channel in Microsoft Teams. You can also find the workflow on n8n.io. This example usage workflow would use the following nodes. - Start - Microsoft Teams

The final workflow should look like the following image.

A workflow with the Microsoft Teams node

1. Start node#

The start node exists by default when you create a new workflow.

2. Microsoft Teams node (create: channel)#

  1. First of all, you'll have to enter credentials for the Microsoft Teams node. You can find out how to do that here.
  2. Select the team that you want to use from the Team ID dropdown list.
  3. Enter a name for the channel in the Name field.
  4. Click on Execute Node to run the node.

Create a channel with the Microsoft Teams node

3. Microsoft Teams1 node (update: channel)#

  1. Select the credentials that you entered in the previous node.
  2. Select 'Update' from the Operation dropdown list.
  3. Click on the gears icon next to the Team ID field and click on Add Expression.
  4. Select the following in the Variable Selector section: Nodes > Microsoft Teams > Parameters > teamId. You can also add the following expression: {{$node["Microsoft Teams"].parameter["teamId"]}}
  5. Click on the gears icon next to the Channel ID field and click on Add Expression.
  6. Select the following in the Variable Selector section: Nodes > Microsoft Teams > Output > JSON > id. You can also add the following expression: {{$node["Microsoft Teams"].json["id"]}}
  7. Click on the Add Field button and select 'Name' from the dropdown list.
  8. Enter a new channel name in the Name field.
  9. Click on Execute Node to run the node.

Update a Channel with the Microsoft Teams node

4. Microsoft Teams2 node (create: channelMessage)#

  1. Select the credentials that you entered in the previous node.
  2. Select 'Channel Message (Beta)' from the Resource dropdown list.
  3. Click on the gears icon next to the Team ID field and click on Add Expression.
  4. Select the following in the Variable Selector section: Nodes > Microsoft Teams > Parameters > teamId. You can also add the following expression: {{$node["Microsoft Teams"].parameter["teamId"]}}
  5. Click on the gears icon next to the Channel ID field and click on Add Expression.
  6. Select the following in the Variable Selector section: Nodes > Microsoft Teams > Output > JSON > id. You can also add the following expression: {{$node["Microsoft Teams"].json["id"]}}
  7. Select 'Text' from the Message Type dropdown list.
  8. Enter a message in the Message field.
  9. Click on Execute Node to run the node.

Send a message with the Microsoft Teams node

 
 

Credentials

You can use these credentials to authenticate the following nodes with Microsoft.

Prerequisites#

Create a Microsoft Azure account.

Using OAuth#

Note for n8n Cloud users

You'll only need to click on the Connect my account button to connect your Microsoft account with n8n.

  1. Access the Microsoft Application Registration Portal.
  2. Click on the Register an application button.
  3. Enter a name for your app in the Name field.
  4. Select Accounts in any organizational directory (Any Azure AD directory - Multi-tenant) and personal Microsoft accounts (e.g. Skype, Xbox) under the Supported account types section.
  5. Copy the 'OAuth Callback URL' provided in the Microsoft node credentials in n8n.
  6. Paste it in the Redirect URI (optional) field on the Register an application page. In the same section, select Select a platform > Web.
  7. Click on the Register button.
  8. Copy the Application (client) ID.
  9. Enter the name for your credentials in the Credentials Name field in the Microsoft node credentials in n8n.
  10. Paste the Application ID in the Client ID field in the Microsoft node credentials in n8n.
  11. On your Microsoft application page, click on Certificates & secrets in the left sidebar.
  12. Click on the + New client secret button under the Client secrets section.
  13. Enter a description in the Description field.
  14. Click on the Add button.
  15. Copy the displayed secret under the Value column.
  16. Paste the secret in the Client Secret field in the Microsoft node credentials in n8n.
  17. Click on the circle button in the OAuth section to connect a Microsoft account to n8n.
  18. Login to your Microsoft account and allow the app to access your info.
  19. Click on the Save button in the Microsoft node credentials in n8n to save your credentials.