How to integrate Exchange Server with n8n workflow automation

Hi everyone! I’m working on a project where I need to pull contact information from our Exchange server and store it in a database. Specifically, I want to extract email addresses, first names, and last names from Exchange contacts.

I’ve been researching this and found that I should use Microsoft Graph API for this task. The endpoint I’m looking at is:

https://graph.microsoft.com/v1.0/me/contacts

My plan is to set up an n8n workflow that makes API calls to this endpoint and then processes the returned contact data before saving it to our database. Has anyone successfully connected Exchange to n8n before? I’d appreciate any guidance on the best approach for this integration.

Graph API works great with n8n once you get the scopes right. In your Azure app registration, use application permissions for headless setups or delegated permissions when you need user context. That /me/contacts endpoint only works with delegated permissions since it hits the logged-in user’s contacts. If you want org-wide contacts, try /users/{id}/contacts instead. I ran into timezone issues processing contact data, so double-check those date fields before dumping into your database. And if you’re syncing regularly, definitely use /contacts/delta - way more efficient than pulling everything every time.

Been there! The HTTP request node in n8n tripped me up - set authentication to ‘OAuth2’, not ‘bearer token’ for initial setup. Also, Graph API sometimes returns empty displayName fields, so check for those before parsing or you’ll get messy nulls in your database.

I did this with our Exchange setup last year. Graph API is the way to go, but nail the authentication first. Register your app in Azure AD and grab the right permissions - you need Contacts.Read at minimum. Pagination bit me hard - the contacts endpoint batches results, so your n8n workflow needs to handle @odata.nextLink to grab everything if you’ve got tons of contacts. Watch out for rate limiting too since Graph API throttles. I added error handling for token refresh stuff - saved me headaches later. The data structure’s pretty clean once you get connected.

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.