Folder examples/E-Mail. Almost all of them need a mail account: see Mail sending and Mailbox in the
overview. The addresses in the examples are placeholders.
AI Auto Answer​
Intermediate examples/E-Mail/AI Auto Answer
Starts with every new e-mail in the inbox. A language model answers the question in the mail as a short e-mail, using a fixed text as its facts (a party at the barn, no cars allowed), and the answer is sent back to the sender. If the AI step fails the diagram ends without sending anything. The idea is explained in Automatic answers with AI.
Needs: a language model; a mailbox (the event) and mail sending.
Prompt
Create a diagram that starts on every new e-mail in the INBOX folder. Let the language model answer the question in the mail as a short e-mail, using only this text as its facts: "There is a party by the barn, no cars allowed." Send the answer to the sender. If the AI step fails, end the diagram without sending anything.
Filter and Sort​
Intermediate examples/E-Mail/Filter and Sort
Starts for every unread mail in the inbox and checks the text against a regular expression for the words keyword1,
keyword2 and text3. A mail that matches is moved to the folder Filtered, the others stay. The diagram listens for
five minutes: a timer event leads to a join where the main path waits, and then it ends. See
Decision and Event node.
Needs: a mailbox with the folder Filtered.
Prompt
Create a diagram that starts for every unread e-mail in the INBOX folder and matches the mail text against the regular expression
\b(?:keyword1|keyword2|text3)\bwith a regex decision. A mail that matches is moved to the IMAP folder "Filtered", others are left alone. Stop listening after five minutes: a timer event of 5 minutes leads to a join where the main path waits and then ends the diagram.
Support Inbox Triage​
Intermediate examples/E-Mail/Support Inbox Triage
A robot for a shared inbox. A language model classifies each new mail with one word: invoice, customer or newsletter.
Invoices are moved to the folder invoice and forwarded to accounting, newsletters to newsletter, everything else to
customer, where the language model drafts a polite reply that is sent to the sender. The use case is described in
Support inbox triage.
Needs: a language model; a mailbox with the folders invoice, newsletter and customer; mail sending; replace
accounting@example.com.
Prompt
Create a robot that starts on every new e-mail, lets the language model classify it as exactly one word (invoice, customer or newsletter, temperature 0.1) and branches on the answer: for "invoice" move the mail to the folder invoice and forward it to accounting@example.com, for "newsletter" move it to the folder newsletter, in all other cases move it to the folder customer, let the language model draft a short polite reply that promises nothing and send it to the sender. Name the branches "is invoice" and "is newsletter" and put the conditions in the parameters of the edges. If the classification fails, end the diagram.