Skip to content

Outlook Email Webhook

This component acts as a dedicated watcher for your Outlook mailbox. It automatically listens for changes in a specific folder, such as when an email arrives or gets deleted. When an event is detected, the component captures the email details and passes them to your workflow, allowing you to automate actions based on your email activity.

How it Works

The Outlook Email Webhook connects to the Microsoft Graph API to monitor your Outlook mailbox. It continuously checks a specific folder you select for changes based on the events you choose. When an event is detected, the component extracts the relevant details and formats them into a structured format that can be easily used by other parts of your Nappai workflow.

Connection & Credentials

This component requires configuring a credential in the Nappai panel before interacting with the external service:

  1. Go to the Credentials section in your Nappai panel.
  2. Create a new credential of the type Microsoft Outlook and fill in the required fields (Client ID, Client Secret, Tenant ID).
  3. In your workflow, select the saved credential in the Credential input field of this node.

You can create your credentials in the Microsoft Azure Portal. Register an app and grant the necessary permissions to access Outlook mail.

Inputs

Input Fields

  • Events: Outlook Email events to listen for. Defaults to Message Received if none selected. Options include Message Received and Message Deleted.
  • Mail Folder: Select the mail folder to monitor. Defaults to Inbox.

Outputs

The component produces structured data describing the email event. This output contains both a text summary and detailed information about the email, such as the subject, sender, body, and attachments. You can use this data in subsequent steps to perform actions, generate AI responses, or store the information in other systems.

Output Data Example (JSON)json

{ “id”: “AAMkADAx…messageId”, “subject”: “Project Update Q3”, “bodyPreview”: “Here are the latest updates regarding the Q3 project…”, “receivedDateTime”: “2024-05-20T10:15:00Z”, “isRead”: false, “hasAttachments”: true, “from”: { “emailAddress”: { “address”: “sender@example.com”, “name”: “Sender Name” } }, “toRecipients”: [ { “emailAddress”: { “address”: “recipient@example.com”, “name”: “Recipient Name” } } ] }

Connectivity

As a webhook or listener component, this node is typically placed at the beginning of a workflow to trigger actions based on email events. You can connect its Data output to:

  • AI Agents to analyze email content or summarize messages.
  • Data Processors to extract specific information like attachments or sender details.
  • Database Connectors to archive email history.
  • Notification Tools to alert team members about important emails.

Usage Example

Scenario: Automatically log important emails to a database

  1. Add the Outlook Email Webhook component and configure it to monitor the Inbox for Message Received events.
  2. Connect the Data output to a Database component.
  3. Map the email subject and bodyPreview from the webhook data to the database fields.
  4. When a new email arrives, the webhook captures the event and automatically saves the details to your database.

Tips and Best Practices

  • Ensure you have the correct permissions in Azure for the selected folder to avoid access errors.
  • Use the Mail Folder input to focus on specific areas like “Inbox” or “SentItems” depending on your workflow needs.
  • Select only the events you need to reduce processing load and improve performance.
  • The component provides detailed email metadata; use this to filter or route emails based on sender or subject in subsequent steps.
  • Check the Data output structure to map fields correctly in the next step.

Security Considerations

  • This component uses the Microsoft Outlook credential which requires a Client ID and Client Secret. Ensure these secrets are kept secure and not shared publicly.
  • The component interacts with the Microsoft Graph API; ensure your Azure application has the minimum necessary permissions to access the mailbox.
  • Review the output_data carefully before sending it to external services to ensure no sensitive information is exposed inadvertently.