Triggers
A trigger is what starts a run: an email, a schedule, a call to a webhook, a button you press. Every flow has at least one, and a flow can have up to 16. This page lists them all, shows how to pick one, and covers the two controls every trigger shares: a condition that decides whether to start, and a switch that turns it off.
Each run starts from exactly one trigger. The trigger hands its first steps whatever arrived (an email and its files, the fields of a form, the text of a chat message), and the steps after it read those values as <trigger id>.<field>, for example {email.subject}.
Choose what starts a flow
- Console
- YAML
- Open a flow in the editor. On a new flow, click Choose what starts this flow. On an existing one, click its trigger, then Change.
- Pick one from the list, or type in Search triggers.
- Fill in its settings, such as the address or the schedule. A red dot on the trigger tile means a required setting is still missing.
- Click Done.
Name the catalog trigger in ref, add its config, and list the first steps in next:
triggers:
- id: email
ref: {name: email-arrives}
connectorRef: {name: invoices-inbox}
config: {attachments: separate, requireAttachment: true}
next: [pdfs]
id is permanent: runs record which trigger started them, and conditions and placeholders name it. title (up to 80 characters) only changes what the canvas calls it.
Every trigger
| Trigger (console title) | Catalog name | Starts when | Needs | Guide |
|---|---|---|---|---|
| An email arrives | email-arrives | Mail reaches a Lumen forwarding address. | An email forwarding connection | Email forwarding |
| An email arrives, source Your mailbox | mailbox-email | A new email lands in a mailbox Lumen reads over IMAP. Checked every 5 minutes unless you change it. | A mailbox connection | Gmail and mailboxes |
| On a schedule | on-schedule | The days and time you choose, or at a fixed interval. | Nothing | Waits and schedules |
| I press Run | manual-run | Someone presses Run and chooses files, or runs lumen run. | Nothing | Your first flow |
| A chat message arrives | chat-message | Someone writes in the chat. The flow's reply is what they read back. | Nothing | Agents |
| A webhook is called | webhook-received | Another system calls your webhook address. | A webhook connection | HTTP and webhooks |
| A form is submitted | form-submitted | Someone fills in one of your forms. | A form | Forms |
| A WhatsApp message arrives | whatsapp-message-received | Someone writes to your WhatsApp number or taps a button you sent. | A WhatsApp connection | |
| A Jira issue changes | jira-issue-changed | An issue in the projects you pick is created, changes status or changes otherwise. Checked every 5 minutes unless you change it. | A Jira connection | Jira and GitHub |
| GitHub activity | github-activity | An issue or pull request in the repositories you pick is opened, labeled, closed or merged, a review is requested, or a draft is marked ready. Checked every 5 minutes unless you change it. | A GitHub connection | Jira and GitHub |
| Another flow starts it | flow-called | Another flow runs it with a Run flow step, on the same documents. | Nothing | Run another flow |
| Test cases | evaluation | You run an evaluation: the flow runs once per row of a table of test cases, in test mode. | A test-cases table | Test and evaluate |
| A file lands in a folder | file-added | Planned. The catalog lists it, but nothing fires it yet, so a flow that uses it cannot be switched on. |
The email trigger is one entry in the editor with a Source setting (A Lumen forwarding address or Your mailbox). In YAML they are two catalog triggers, email-arrives and mailbox-email, with the same outputs. A flow saved with either keeps working as saved.
What each trigger gives the steps
Every trigger puts its own fields on the document. These are the ones for the email triggers; the others are listed on their guide.
| Field | Type | Meaning |
|---|---|---|
from, to | text | Sender and recipients. |
subject, body | text | The subject and the text of the email. |
attachments | number | How many files the trigger took (at most 20 per email). |
senderVerified | yes/no | True when the sending server's own check passed: DMARC passed, or the domain has no DMARC policy and SPF or DKIM passed for an aligned domain. |
receivedAt | date | When it arrived. |
messageId | text | The email's Message-ID. |
Email settings
| Setting (console label) | YAML key | Default | Notes |
|---|---|---|---|
| Attachments | attachments | separate for a new trigger in the editor | separate: each file goes through the flow on its own, with the email's sender, subject and body. together: one document holds every file. A trigger saved before this setting existed behaves as together. |
| Include images in the email body | includeInline | off | Takes images shown in the body as attachments too. |
| Largest mail (MB) | maxSizeMB | 25 | From 1 to 40. A bigger email starts no run. |
| Only emails with an attachment | requireAttachment | on for an address, off for a mailbox | Turn it off to start on every email. |
A mailbox trigger adds folder (default INBOX), pollMinutes (1 to 60, default 5), afterHandling (markRead, moveTo or leave), includeAttachments, importExisting (0 to 500: take the newest mails already in the folder, once, when the folder is first read) and two optional filters, fromContains and subjectContains.
Start only when
Start only when is a condition on the trigger's own fields. It is checked the moment the arrival is taken in, before any run exists. An arrival that does not match starts no run and costs nothing.
It is available on the email triggers, A Jira issue changes and GitHub activity. On any other trigger, use a filter as the first node instead.
- Console
- YAML
- Open the trigger and scroll to Start only when.
- Build the condition in Visual mode (field, operator, value, with Condition and Group to add more), or switch to Text and write it, such as
trigger.subject ~ "invoice" AND trigger.senderVerified = true. - Click Done.
On a trigger created in the console the id is trigger, so its fields read trigger.subject. The editor says valid when the text parses.
Mail that was checked and did not start a run is listed in the trigger's Recent emails, with the reason (for example Start only when did not match), so you can see what a condition kept out.
when takes either expr or field, op and value, never both. A field is <trigger id>.<output>, and only the trigger's own outputs are allowed.
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
name: triggers-invoices-only
namespace: tenant-acme
spec:
displayName: Invoices from verified senders
triggers:
- id: email
ref: {name: email-arrives}
connectorRef: {name: invoices-inbox}
config: {attachments: separate, requireAttachment: true}
when:
expr: 'email.subject ~ "invoice" AND email.senderVerified = true'
next: [pdfs]
nodes:
- id: pdfs
stepRef: {name: keep-pdfs}
next: [keep]
- id: keep
stepRef: {name: keep-in-lumen}
Operators and the text grammar are the same as for filters and branches. See Branches and filters.
A mailbox email that does not match is left where it is: not marked read, not moved.
Use several triggers in one flow
A flow can start from more than one place. Each trigger lists its own first steps, so the paths can differ, and several triggers can share a step. Each run starts from one trigger and follows only its path.
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
name: triggers-invoice-intake
namespace: tenant-acme
spec:
displayName: Invoice intake
triggers:
- id: email
title: A supplier emails an invoice
ref: {name: email-arrives}
connectorRef: {name: invoices-inbox}
config: {attachments: separate, requireAttachment: true}
next: [pdfs]
- id: manual
ref: {name: manual-run}
next: [pdfs]
- id: monday
title: Every Monday
ref: {name: on-schedule}
config: {cron: "0 8 * * 1", timeZone: Asia/Jerusalem}
next: [remind]
nodes:
- id: pdfs
stepRef: {name: keep-pdfs}
next: [keep]
- id: keep
stepRef: {name: keep-in-lumen}
- id: remind
stepRef: {name: notify-in-app}
config: {to: admins, title: "Check the invoices folder"}
What the steps after the trigger can use depends on what it produces: a schedule produces no document, so only steps that need nothing can follow it. The editor and the API refuse a step whose needs are not met.
To branch on which trigger started a run, use the run field run.trigger, which holds the trigger's id (or its catalog name). For example, the condition run.trigger = "manual".
Turn a trigger off
A disabled trigger keeps its settings and starts nothing, whatever arrives. Use it to pause one entry point of a flow, or to test with the others.
- Console
- YAML
Hover the trigger and click the stop icon in its toolbar, or open its ... menu and choose Disable. Do the same to turn it back on. A disabled trigger is drawn dimmed. When every trigger of a flow is off, the editor warns that nothing starts the flow.
triggers:
- id: manual
ref: {name: manual-run}
disabled: true
next: [pdfs]
What a disabled trigger does depends on how the arrival comes in:
| Trigger | When it is disabled |
|---|---|
| Email to a forwarding address | The email is taken in and logged as not started, with the reason "the trigger was disabled". |
| Mailbox | The mailbox is not read for it. |
| Schedule | Nothing fires. Switching it back on does not replay the time it was off. |
| Webhook | The call is accepted (202), no run starts, and the response lists the trigger as skipped. The sender is not told to stop or retry. |
| Form, WhatsApp, chat | Nothing starts. |
| Manual run | A run asked of it is refused. With no trigger named, the first enabled manual trigger is used. |
To pause the whole flow instead, turn off its switch at the top of the editor (suspend: true in YAML). Runs already queued still finish.
Duplicate mail
A redelivered email does not start a second run. Lumen records every email once, keyed on its Message-ID, and derives each run's identity from that record, the flow and the trigger. If a message arrives again, for example after a mail server retries, a message that was already fully handled starts nothing, and one that was recorded but never queued still starts its runs.
A mailbox is deduplicated the same way, per flow, on the Message-ID. So marking a mail unread or moving it back to the folder does not run it a second time.
This protects against the same message arriving twice. It does not recognize two different emails that carry the same invoice. For that, add the Skip duplicates step: it remembers a key you choose, such as {supplier} {invoiceNumber}, for a number of days, and ends the run quietly when it has seen the key before.

