דלג לתוכן הראשי

Your first flow

In about ten minutes you will build a flow that takes the invoices your suppliers email, keeps only the PDFs, merges them into one file named by date and sender, keeps it in Lumen and emails it to you. Then you will run it and read the run.

  • 10 minutes
  • No code
  • Any workspace

You need a Lumen workspace and permission to edit flows in it. Everything here happens in the console at app.go-lumen.ai; the same flow as YAML is at the end, for when you want it in git.

Create a flow from a template​

A template is a working flow with sensible settings, so you start from something that runs instead of from an empty canvas.

  1. In the console, open Flows and choose the Templates tab.
  2. Find One file from a pile of invoices. The icons under each template are its steps, in order.
  3. Click the card to use it. The editor opens with the template's trigger and four steps already connected.
The Templates tab of the Flows page, filtered to All. Four template cards: One file from a pile of invoices (marked Runs today), Invoice inbox, Delivery notes from the phone, and Split a bundle into files, each with a row of step icons.The Templates tab of the Flows page, filtered to All. Four template cards: One file from a pile of invoices (marked Runs today), Invoice inbox, Delivery notes from the phone, and Split a bundle into files, each with a row of step icons.
Flows, then Templates. Filter by how a flow starts: from email, on a schedule, or from a file.
The flow editor with the template loaded: a trigger tile When an email arrives, marked with a red dot and the note This flow starts when an email arrives, so it needs an address first, followed by four connected steps: 1. Keep only the PDFs, 2. Merge them into one PDF, 3. Rename the file, 4. Keep it in Lumen. Each step shows its estimated credits.The flow editor with the template loaded: a trigger tile When an email arrives, marked with a red dot and the note This flow starts when an email arrives, so it needs an address first, followed by four connected steps: 1. Keep only the PDFs, 2. Merge them into one PDF, 3. Rename the file, 4. Keep it in Lumen. Each step shows its estimated credits.
The template on the canvas. The red dot on the trigger means it still needs one setting.

Choose the address that starts it​

The trigger is When an email arrives. It needs to know which address to listen on.

  1. Click the trigger tile. Its settings open on the side.
  2. Under Source, keep A Lumen forwarding address: mail you forward to it arrives the moment it is sent. (Your mailbox reads a connected Gmail or Microsoft 365 inbox instead.)
  3. Under Which address starts this flow?, pick your workspace's forwarding address.
  4. Under Attachments, choose Each attachment separately. Every file goes through the flow on its own; the merge step gathers the files of one email back together.
  5. Leave Only emails with an attachment on, so a plain reply never starts a run, and click Done.
The An email arrives settings panel. Source is set to A Lumen forwarding address. The address field shows a forwarding address ending in in.lumen.example. Attachments is set to Each attachment separately, with an explanation of both options. Largest mail is 25 MB and Only emails with an attachment is switched on.The An email arrives settings panel. Source is set to A Lumen forwarding address. The address field shows a forwarding address ending in in.lumen.example. Attachments is set to Each attachment separately, with an explanation of both options. Largest mail is 25 MB and Only emails with an attachment is switched on.
The trigger's settings. The forwarding address is yours alone; forward supplier mail to it.
Forward, do not move

Set a rule in your mail client that forwards supplier invoices to the address. The originals stay in your inbox, and Lumen gets a copy as it arrives.

Add a step​

Now add the step that emails you the merged file.

  1. Hover the line after 4. Keep it in Lumen and click the + at its end.
  2. Choose Action, then type email in Search steps. The list narrows to the Messages steps.
  3. Choose Send it to me by email.
The step picker open after the last step, with email typed in the search box. Under Messages it lists five steps: Send it to me by email, Ask by email and wait for the reply, Confirm receipt and take the file, Reply to the email, and Forward the email, most marked 1 credit.The step picker open after the last step, with email typed in the search box. Under Messages it lists five steps: Send it to me by email, Ask by email and wait for the reply, Confirm receipt and take the file, Reply to the email, and Forward the email, most marked 1 credit.
The picker offers only the steps that can run here: each step says what it needs, and the editor checks it is on the path.
  1. In its settings, Send it to already holds your own address. Add a Subject and a Message. Keep Attach the files on, then click Done.
  2. Click Save and enable at the top right.
The settings panel of step 5, Send it to me by email, on the Settings tab. Send it to holds one address, with CC and BCC buttons below. Subject reads Invoices merged for this month and Message reads Hi, the merged invoice PDF is attached. Attach the files is switched on. A preview below shows From Lumen, the recipient, the subject and the message.The settings panel of step 5, Send it to me by email, on the Settings tab. Send it to holds one address, with CC and BCC buttons below. Subject reads Invoices merged for this month and Message reads Hi, the merged invoice PDF is attached. Attach the files is switched on. A preview below shows From Lumen, the recipient, the subject and the message.
Each text setting takes placeholders such as {email.from}, offered by the {x} button beside it.

Every setting of this step, with its type and default, is on its reference page: Send it to me by email.

Run a test​

You do not have to wait for an email to see the flow work. Run it on files from your computer.

  1. Open the flow from Flows. Click Run (the play button in the toolbar).
  2. Drop two or three PDF invoices into the dialog, or click to choose them.
  3. Click Run on 2 files (the count matches what you chose).
The Run dialog titled Run One file from a pile of invoices now. It explains that the flow works on the chosen files exactly as on a document that arrived any other way, and notes that a run uses the same credits however it starts. Two files are listed, invoice-sample.pdf and invoice-sample-2.pdf, and the button reads Run on 2 files.The Run dialog titled Run One file from a pile of invoices now. It explains that the flow works on the chosen files exactly as on a document that arrived any other way, and notes that a run uses the same credits however it starts. Two files are listed, invoice-sample.pdf and invoice-sample-2.pdf, and the button reads Run on 2 files.
A run you start by hand is a real run: it costs what any run costs, and it sends the email.
Testing one step

To try a single step without running the flow, open the step and use its Test tab. A step that changes something outside Lumen, like sending an email, shows what it would do instead of doing it.

See the run​

The console opens the run as soon as it starts.

  1. The status moves from Running to Success in a few seconds.
  2. The summary shows when it was queued, started and finished, how long it took, the credits it used and how many documents it carried.
  3. The canvas below repeats the flow: every step that ran has a green check and its own duration, and each edge says how many documents went along it.
  4. Click a step to see its Input and Output: here, the merged PDF, ready to preview or download. Run from here reruns the flow from that step; Retry reruns it all.
The Run detail page of a finished run. Status Success, with a Retry button. Queued, Started and Finished times, a duration of 5.2 seconds, 2 credits and 1 document. Below, the run's canvas: Choose what starts this flow, then 1. Keep only the PDFs (1.0 s), 2. Merge them into one PDF (2.0 s), 3. Rename the file (3.0 s) and 4. Keep it in Lumen (4.0 s), each with a green check and 1 document on every edge.The Run detail page of a finished run. Status Success, with a Retry button. Queued, Started and Finished times, a duration of 5.2 seconds, 2 credits and 1 document. Below, the run's canvas: Choose what starts this flow, then 1. Keep only the PDFs (1.0 s), 2. Merge them into one PDF (2.0 s), 3. Rename the file (3.0 s) and 4. Keep it in Lumen (4.0 s), each with a green check and 1 document on every edge.
Every run explains itself: what started it, each step, how long each took and what it cost.

The same flow as YAML​

A flow is a plain resource, so the one you just built can live in git and be applied from the CLI or CI. The YAML below is the same flow, plus a manual trigger so lumen run can start it. It validates against the built-in catalog.

invoices-one-file.yaml
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
name: invoices-one-file
namespace: tenant-acme
spec:
displayName: One file from a pile of invoices
triggers:
- id: email
ref: {name: email-arrives}
connectorRef: {name: invoices-inbox}
config: {attachments: separate, requireAttachment: true}
next: [pdfs]
- id: manual
ref: {name: manual-run}
next: [pdfs]
nodes:
- id: pdfs
stepRef: {name: keep-pdfs}
next: [merge]
- id: merge
stepRef: {name: merge-pdfs}
next: [rename]
- id: rename
stepRef: {name: rename-file}
config: {pattern: "{date} from {sender}.pdf"}
next: [keep]
- id: keep
stepRef: {name: keep-in-lumen}
next: [mail]
- id: mail
stepRef: {name: send-email}
config:
to: you@example.com
subject: Invoices merged for this month
body: Hi, the merged invoice PDF is attached.

Next steps​