Skip to main content

An email arrives

Triggeremail-arrives

Starts when an email arrives with a document attached.

At a glance​

PropertyValue
Trigger nameemail-arrives
ResourceClusterTrigger (lumen.ai/v1alpha1)
Sourceevent
Needs a connectionyes, one that provides email
Producesemail, file
Emitsitem
Installation must providenothing

A flow using this trigger names a Connector in connectorRef. Connection types that provide email: [Email forwarding](/reference/connections/email-forward).

The trigger goes under spec.triggers of a Flow. Its outputs are referenced as <triggerId>.<field>. A trigger can also carry a when condition ("Start only when") and disabled: true.

Outputs​

A later node references an output as {nodeId.field} in text, or nodeId.field in a condition.

OutputType
fromstring
tostring
subjectstring
bodystring
attachmentsnumber
senderVerifiedboolean
receivedAtdate
messageIdstring

Settings​

Set under config: on the flow trigger.

SettingTypeDefaultDescription
requireAttachmentbooleantrueRequireAttachment drops mail that carries no file; unset is true.
maxSizeMBinteger25MaxSizeMB starts no run for a mail bigger than this; unset is 25.minimum 1; maximum 40
attachmentsstring-Each attachment separately: every file goes through the flow on its own, with the email's sender, subject and body, so reply and forward steps answer once per file. The whole email as one: all the files travel together as one document. A trigger saved before this setting existed works as the whole email as one.one of separate, together
includeInlinebooleanfalseInclude images in the email body

The full JSON Schema of these settings: email-arrives.schema.json.

Use it in a flow​

flow.yaml
apiVersion: lumen.ai/v1alpha1
kind: Connector
metadata:
name: my-email-forward
namespace: tenant-acme
spec:
classRef: {name: email-forward}
config: {}
---
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
name: email-arrives-example
namespace: tenant-acme
spec:
displayName: "An email arrives"
triggers:
- id: start
ref: {name: email-arrives}
connectorRef: {name: my-email-forward}
next: [notify-in-app]
nodes:
- id: notify-in-app
stepRef: {name: notify-in-app}
config:
body: 'Total: {total}'
title: New invoice from {supplier}
to: admins