For the complete documentation index, see llms.txt. This page is also available as Markdown.

Outlook

Use the Outlook node to send and search email. Connect it to other nodes to generate recipients, content, and attachments dynamically.

Connect Outlook

Most workflows use StackAI's built-in connector. Sign in with your Microsoft account. Your connection inherits your existing permissions and access.

1

Add an Outlook node

Add an Outlook node (or the On Email Received trigger) to your workflow.

2

Add a connection

In the node's connection field, choose Add new connection > Outlook (OAuth2).

3

Sign in

Sign in with your Microsoft account and accept the consent prompt.

4

Use the connection

The connection is ready to use. No Azure setup is required.

Advanced connection setup

Use a separate setup path for these cases:

Available Actions

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.

Inputs

recipient (Optional)

  • Type: String (comma-separated email addresses)

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

  • Examples:

    • "recipient": "team@example.com"

    • "recipient": "user1@example.com, user2@example.com"

subject (Optional)

  • Type: String

  • Description: Subject line. If replying (message_id provided), leave blank to use original subject.

  • Example: "subject": "Weekly Report"

body (Required)

  • Type: String

  • Description: Email content. Supports plain text or HTML.

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

attachment_urls (Optional)

  • Type: String (comma-separated URLs)

  • Description: File URLs to attach. Files are 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 original sender

    • With recipient: Forwards the message to new recipients

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

draft (Optional)

  • Type: Boolean

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

  • Default: false

  • Example: "draft": true

allowed_emails (Optional)

  • Type: String (comma-separated email addresses)

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

  • Example: "allowed_emails": "approved1@example.com, approved2@example.com"

Outputs

result_msg (Always returned)

  • Type: String

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

  • Example:

Notes

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

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

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

  • Attachments: Files are downloaded from provided URLs and attached

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

  • Allowed Emails: Restricts recipients to whitelist; blocked recipients reported in 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).

    • Example: "query": "from:boss@example.com subject:invoice"

  • 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 which Outlook connection to use.

Outputs

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

    • Example:

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?