List emails from Microsoft Outlook
Retrieve a list of email messages from a specific folder using Microsoft Graph API. Supports filtering with OData syntax and pagination.
type: "io.kestra.plugin.microsoft365.outlook.list"Examples
List recent emails from inbox
id: list_outlook_emails
namespace: company.team
tasks:
- id: list_emails
type: io.kestra.plugin.microsoft365.outlook.List
tenantId: "{{ secret('AZURE_TENANT_ID') }}"
clientId: "{{ secret('AZURE_CLIENT_ID') }}"
clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
userEmail: "user@example.com"
folderId: "inbox"
top: 10
List emails with filter and store to internal storage
id: list_filtered_emails
namespace: company.team
tasks:
- id: list_emails
type: io.kestra.plugin.microsoft365.outlook.List
tenantId: "{{ secret('AZURE_TENANT_ID') }}"
clientId: "{{ secret('AZURE_CLIENT_ID') }}"
clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
userEmail: "user@example.com"
folderId: "inbox"
filter: "isRead eq false and receivedDateTime ge {{ now() | dateAdd(-7, 'DAYS') | date('yyyy-MM-dd') }}T00:00:00Z"
top: 50
fetchType: STORE
Get first message only
id: get_first_email
namespace: company.team
tasks:
- id: get_first
type: io.kestra.plugin.microsoft365.outlook.List
tenantId: "{{ secret('AZURE_TENANT_ID') }}"
clientId: "{{ secret('AZURE_CLIENT_ID') }}"
clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
userEmail: "user@example.com"
folderId: "inbox"
fetchType: FETCH_ONE
top: 1
Properties
clientId *Requiredstring
Client ID
Azure application (client) ID
clientSecret *Requiredstring
Client Secret
Azure client secret
tenantId *Requiredstring
Tenant ID
Azure tenant ID (directory ID)
userEmail *Requiredstring
User email
Email address of the user whose mailbox to access (optional, uses authenticated user if not specified)
fetchType string
FETCHSTOREFETCHFETCH_ONENONEThe way you want to store the data
FETCH - outputs the messages as an output FETCH_ONE - outputs the first message only as an output STORE - stores all messages to a file NONE - no output
filter string
Filter
OData filter expression to filter the results (e.g., 'isRead eq false', 'from/emailAddress/address eq 'sender@example.com'')
folderId string
inboxFolder ID
Email folder to retrieve messages from (inbox, sentitems, drafts, deleteditems, or folder ID)
scopes string
https://graph.microsoft.com/.defaultScopes
Scopes for Microsoft Graph
top integerstring
50Top
Maximum number of messages to return
userPrincipalName string
User Principal Name
User email to act on behalf of (optional)
Outputs
count integer
0Message count
Number of messages retrieved
folderId string
Folder ID
ID of the folder that was queried
hasNextPage boolean
Has next page
Whether there are more messages available
message MessageSummary
Single message (when fetchType is FETCH_ONE)
uri string
uriURI of the stored messages file (when fetchType is STORE)
Definitions
io.kestra.plugin.microsoft365.outlook.domain.MessageSummary
bodyPreview string
conversationId string
fromMail string
hasAttachments boolean
id string
importance string
isRead boolean
receivedDateTime string
date-timesenderMail string
sentDateTime string
date-time