
MailReceivedTrigger
MailReceivedTrigger
yaml
type: "io.kestra.plugin.microsoft365.outlook.MailReceivedTrigger"Examples
yaml
id: outlook_listen
namespace: company.team
tasks:
- id: each
type: io.kestra.plugin.core.flow.EachSequential
value: "{{ trigger.messages }}"
tasks:
- id: log
type: io.kestra.plugin.core.debug.Return
format: "New email: {{ taskrun.value.subject }}"
triggers:
- id: watch
type: io.kestra.plugin.microsoft365.outlook.MailReceivedTrigger
interval: PT5M
tenantId: "{{ secret('AZURE_TENANT_ID') }}"
clientId: "{{ secret('AZURE_CLIENT_ID') }}"
clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
userEmail: "user@example.com"
folderId: "inbox"
yaml
id: outlook_with_attachments
namespace: company.team
tasks:
- id: each
type: io.kestra.plugin.core.flow.EachSequential
value: "{{ trigger.messages }}"
tasks:
- id: process
type: io.kestra.plugin.core.debug.Return
format: "Processing {{ taskrun.value.subject }} with {{ taskrun.value.attachments | length }} attachments"
- id: each_attachment
type: io.kestra.plugin.core.flow.EachSequential
values: "{{ taskrun.value.attachments }}"
tasks:
- id: log_attachment
type: io.kestra.plugin.core.log.Log
message: "Attachment: {{ taskrun.value.name }} stored at {{ taskrun.value.uri }}"
triggers:
- id: watch
type: io.kestra.plugin.microsoft365.outlook.MailReceivedTrigger
interval: PT2M
tenantId: "{{ secret('AZURE_TENANT_ID') }}"
clientId: "{{ secret('AZURE_CLIENT_ID') }}"
clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
userEmail: "invoices@company.com"
folderId: "inbox"
filter: "hasAttachments eq true"
includeAttachments: true
yaml
id: outlook_filtered_sender
namespace: company.team
tasks:
- id: process
type: io.kestra.plugin.core.log.Log
message: "Received {{ trigger.count }} email(s) from important sender"
triggers:
- id: watch
type: io.kestra.plugin.microsoft365.outlook.MailReceivedTrigger
interval: PT1M
tenantId: "{{ secret('AZURE_TENANT_ID') }}"
clientId: "{{ secret('AZURE_CLIENT_ID') }}"
clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
userEmail: "user@example.com"
filter: "from/emailAddress/address eq 'boss@company.com'"
stateTtl: P30D
Properties
clientId*Requiredstring
clientSecret*Requiredstring
tenantId*Requiredstring
userEmail*Requiredstring
allowConcurrentNon-dynamicboolean
Default
falseconditionsNon-dynamic
Definitions
Condition to allow events between two specific datetime values.
type*Requiredobject
afterstring
Format
date-timebeforestring
Format
date-timedatestring
Default
{{ trigger.date }}Condition to allow events on a particular day of the week.
dayOfWeek*Requiredstring
Possible Values
MONDAYTUESDAYWEDNESDAYTHURSDAYFRIDAYSATURDAYSUNDAYtype*Requiredobject
datestring
Default
{{ trigger.date }}Condition to execute tasks on a specific day of the week relative to the current month (first, last, ...)
dayInMonth*Requiredstring
Possible Values
FIRSTLASTSECONDTHIRDFOURTHdayOfWeek*Requiredstring
Possible Values
MONDAYTUESDAYWEDNESDAYTHURSDAYFRIDAYSATURDAYSUNDAYtype*Requiredobject
datestring
Default
{{ trigger.date }}Condition for a specific flow of an execution.
flowId*Requiredstring
namespace*Requiredstring
type*Requiredobject
Condition that checks labels of an execution.
labels*Requiredarrayobject
type*Requiredobject
Condition for an execution namespace.
namespace*Requiredstring
type*Requiredobject
comparisonstring
Possible Values
EQUALSPREFIXSUFFIXprefixbooleanstring
Default
falseCondition based on the outputs of an upstream execution.
expression*Requiredbooleanstring
type*Requiredobject
Condition based on execution status.
type*Requiredobject
inarray
SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDnotInarray
SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDCondition based on variable expression.
expression*Requiredstring
type*Requiredobject
Condition for a specific flow. Note that this condition is deprecated, use `io.kestra.plugin.core.condition.ExecutionFlow` instead.
flowId*Requiredstring
namespace*Requiredstring
type*Requiredobject
Condition for a flow namespace.
namespace*Requiredstring
type*Requiredobject
prefixboolean
Default
falseCondition that matches if any taskRun has retry attempts.
type*Requiredobject
inarray
SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDnotInarray
SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDRun a flow if the list of preconditions is met in a time window.
conditions*Requiredobject
id*Requiredstring
Validation RegExp
^[a-zA-Z0-9][a-zA-Z0-9_-]*Min length
1type*Requiredobject
resetOnSuccessboolean
Default
truetimeWindow
Default
{
"type": "DURATION_WINDOW"
}io.kestra.core.models.triggers.TimeWindow
deadlinestring
Format
partial-timeendTimestring
Format
partial-timestartTimestring
Format
partial-timetypestring
Default
DURATION_WINDOWPossible Values
DAILY_TIME_DEADLINEDAILY_TIME_WINDOWDURATION_WINDOWSLIDING_WINDOWwindowstring
Format
durationwindowAdvancestring
Format
durationwindowDeprecatedstring
Format
durationwindowAdvanceDeprecatedstring
Format
durationCondition to exclude other conditions.
conditions*Required
Min items
1type*Requiredobject
Condition to have at least one condition validated.
conditions*Required
Min items
1type*Requiredobject
Condition to allow events on public holidays.
type*Requiredobject
countrystring
datestring
Default
{{ trigger.date}}subDivisionstring
Condition to allow events between two specific times.
type*Requiredobject
afterstring
Format
timebeforestring
Format
timedatestring
Default
{{ trigger.date }}Condition to allow events on weekend.
type*Requiredobject
datestring
Default
{{ trigger.date }}filterstring
folderIdstring
Default
inboxincludeAttachmentsbooleanstring
Default
falseintervalNon-dynamicstring
Default
PT5MFormat
durationmaxMessagesintegerstring
Default
10scopesstring
Default
https://graph.microsoft.com/.defaultstateKeystring
stateTtlstring
Format
durationstopAfterNon-dynamicarray
SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDuserPrincipalNamestring
Outputs
countinteger
folderIdstring
messagesarray
Definitions
io.kestra.plugin.microsoft365.outlook.MailReceivedTrigger-EmailMessage
attachmentsarray
io.kestra.plugin.microsoft365.outlook.MailReceivedTrigger-AttachmentData
contentTypestring
idstring
isInlineboolean
namestring
sizeinteger
uristring
Format
uribodystring
bodyContentTypestring
bodyPreviewstring
ccRecipientsarray
SubTypestring
fromstring
fromNamestring
hasAttachmentsboolean
idstring
importancestring
isReadboolean
receivedDateTimestring
Format
date-timesentDateTimestring
Format
date-timesubjectstring
toRecipientsarray
SubTypestring