Outlook

Learn how to automate Outlook email tasks in StackAI. Discover available actions, required inputs, configurations, and output examples for seamless workflow integration.

What is Outlook?

Outlook in StackAI is a powerful integration node that enables you to automate sending and managing emails directly through your Outlook account. This node streamlines communication workflows, allowing you to trigger email actions as part of your automated processes.

How to use it?

To use the Outlook node in StackAI, simply add it to your workflow and configure the desired action. Connect it to other nodes to dynamically generate email content, recipients, or attachments. You can use this node to send emails, search your mailbox, or automate other Outlook-related tasks.

Example of Usage

Suppose you want to automatically send a summary report to your team every week. You can connect a report-generating node to the Outlook node, configure the email details, and automate the process without manual intervention.


Available Actions

Below are the most commonly used Outlook actions in StackAI:

1. Send Email

Description

Send an email, reply to an existing message, or forward a message using your Outlook account. Supports drafts, attachments, and recipient filtering.

App Registration Setup

If using an App Registration connection (not OAuth), your Azure AD application requires these Application permissions:

  • Mail.Send - Send emails as any user

  • Mail.ReadWrite - Create drafts, add attachments, modify messages, reply/forward

Important: After adding these permissions in Azure Portal, click "Grant admin consent" for your tenant.

Inputs

recipient (Optional)

  • Type: String (comma-separated email addresses)

  • Description: Recipient email address(es). If replying to a message (message_id provided), leave blank to reply to the original sender. If forwarding, specify new recipient(s).

  • Examples:

subject (Optional)

  • Type: String

  • Description: Subject line of the email. If replying to a message (message_id provided), leave blank to use the original subject.

  • Example: "subject": "Weekly Report"

body (Required)

  • Type: String

  • Description: Content/body of the email. Supports plain text or HTML.

  • Example: "body": "Please find the attached weekly report."

attachment_urls (Optional)

  • Type: String (comma-separated URLs)

  • Description: URLs of files to attach to the email. Files will be downloaded and attached.

  • Example: "attachment_urls": "https://example.com/file1.pdf, https://example.com/file2.xlsx"

message_id (Optional)

  • Type: String

  • Description: Microsoft Graph message ID to reply to or forward. When provided:

    • Without recipient: Creates a reply to the original sender

    • With recipient: Forwards the message to new recipient(s)

  • Example: "message_id": "AQMkAGY1MTc5Y2Y5LTNlMWMtNGU4NS05NzljLTRmM2IwOGNlYjI3MgBGAAAD..."

draft (Optional)

  • Type: Boolean

  • Description: If true, saves the email as a draft instead of sending it immediately.

  • Default: false

  • Example: "draft": true

allowed_emails (Optional)

  • Type: String (comma-separated email addresses)

  • Description: Whitelist of allowed recipient email addresses. If specified, emails will only be sent to addresses in this list. Leave blank to allow all recipients.

  • Example: "allowed_emails": "[email protected], [email protected]"

Outputs

result_msg (Always returned)

  • Type: String

  • Description: Summary of the email operation, including recipients, subject, body, and any errors or warnings.

  • Example:

    {
      "result_msg": "Recipient: [email protected]\nSubject: Weekly Report\nBody: Please find the attached report."
    }

Notes

  • New Emails: recipient and subject are required when not replying/forwarding

  • Replies: When message_id is provided without recipient, the action replies to the original sender

  • Forwards: When message_id is provided with recipient, the action forwards to new recipients

  • Attachments: Files are downloaded from provided URLs and attached to the message

  • Drafts: When draft=true, the message is saved but not sent

  • Allowed Emails: Use to restrict recipients to a whitelist; blocked recipients are reported in the result message


2. Search Emails

Description:

Search your Outlook mailbox for emails matching specific criteria.

Inputs:

  • query (Required): The search query string (e.g., keywords, sender, date).

  • folder (Optional): Specify the folder to search in (e.g., Inbox, Sent).

    • Example: "folder": "Inbox"

  • max_results (Optional): Limit the number of results.

    • Example: "max_results": 10

Configurations:

  • connection_id (Required if you have multiple Outlook accounts): Specify the Outlook connection to use.

Outputs:

  • emails (Always returned): List of matching emails with details such as subject, sender, date, and body.

    • Example:

      {
        "emails": [
          {
            "subject": "Invoice Due",
            "from": "[email protected]",
            "date": "2025-07-01",
            "body": "Please see the attached invoice."
          }
        ]
      }

Best Practices

  • Always ensure required fields are filled to avoid errors.

  • For attachments, connect a Files node or other relevant node to provide file paths.


Automate your Outlook email workflows in StackAI to save time, reduce manual effort, and ensure consistent communication.

Last updated

Was this helpful?