Start a flow
When an email arrives
Starts the flow for new mail in an IMAP mailbox, Gmail or Outlook, with each message as a record and its attachments as files.
Nodes › TriggersOpen in Neblex
- Good for
- Mail-driven work
- Role
- Starts a flow
- Find it in
- Nodes › Triggers
When to use it
- Invoices, orders or requests arrive by email.
- Attachments should be read, filed or passed on.
- Handled mail should be marked read or moved to another folder.
Reach for something else when
WebhookWhen the sender can call an address instead of sending mail.Poll for changesWhen you want to read from a system that is not a mailbox.
Example
Every five minutes, take unread invoices from the Invoices folder, read the attached PDF, file it and move the message to Processed.
How it works
- Settings
- Mailbox type: IMAP (any mail server), Gmail or Microsoft Outlook; Mailbox: the connection to it; Folder [the inbox]: an IMAP folder, a Gmail label ID or an Outlook folder (a well-known name such as
inboxorarchive, or a folder ID); Only unread mail [off]; After pickup: leave the message as it is, mark it read, or move it to another folder [leave it]; Move to (when moving): an IMAP folder, a Gmail label ID (the message leaves the folder that was read) or an Outlook folder; Check for new mail: how often, like a schedule. - Behaviour
- The first check only notes where the mailbox stands, so turning the flow on never replays old mail. After that each check starts a run with the messages that arrived since the last one, oldest first, a page at a time. Each record has
subject,from,to,cc(each a list of{name, email}),date,message_id,text,html,attachments(each withfilename,contentType,sizeand the file incontent_base64),raw(the whole message as an.emlfile),folderand the message'sid(IMAP:uid). A message too large to read in memory arrives as itsrawfile. Marking read or moving happens only once the run with the message has started safely; if it fails, the message stays where it is and the run still has it. With Records per run set, the messages are split into runs of that size. Gmail starts again from the current mail if it was not checked for about a week. - Example
- Every five minutes, take unread invoices from the
Invoicesfolder, read the attached PDF and file it, then move the message toProcessed.
Add it to a flow
- Open the flow from Build › Workflows.
- Open Nodes and find When an email arrives under Triggers. Drag it onto the canvas as the first step.
- Connect it to the next step and open its settings with ✎ Edit.
- Save and test with Run, then set the flow Active so it starts on its own.
More in Start a flow
WebhookStarts the flow the moment another system calls its address.Nodes › TriggersForm (starts flow)Starts the flow when someone submits a form, with their answers as the input.Nodes › TriggersScheduleRuns the flow on a repeating interval or at set times.Nodes › TriggersPoll for changesChecks a system regularly and starts a run only for records that are new or changed.Nodes › TriggersLive streamSubscribes to a queue, topic or stream and runs the flow for each message as it arrives.Nodes › TriggersWhen calledMakes the flow callable by other flows, the API and AI agents, with a declared input and output.Nodes › Triggers