Skip to content
Weik.ioDocs
2026.2
Try Weik.io

React to a run

Weik.io 2026.2

Start an integration when a transfer's run ends, from the run's summary event or from an event for each file. Video

Watch: What happened: the files behind a run, 3:28

The video opens a run and lists the files it moved. Then it finds the log line of each file.

On this page

To start the invoice processing when the morning’s invoices have landed, react to the transfer’s run instead of polling the storage account. Every run of a transfer publishes its summary into the environment’s event stream, where any integration of the project can receive it.

The run summary#

A run publishes its summary when it ends. Runs and transferred files lists what the summary has. List the summaries with the CLI:

Terminal
$ weikio events list --env production --family mft --integration finance/supplier-invoices --since 24h --with-body

Read it in an integration#

An integration receives the summaries through the weikio-event-source kamelet. Set its family to mft and its channel to the transfer’s name:

invoice-processing/routes/on-batch.camel.yaml
- route:
    from:
      uri: "kamelet:weikio-event-source?family=mft&channel=supplier-invoices"
      steps:
        - log: "Run of supplier-invoices ended: ${body}"
        - to: direct:process-batch

The integration receives every run summary, including those published while it was stopped, back to its first deploy.

When its route fails on a summary, the summary is delivered again after the retry delays of the integration’s delivery settings. Dead letters explains what happens after the last attempt.

An event for every file#

When each file needs a separate reaction, set emitPerFile: true. The transfer then publishes one event per file beside the run summary:

finance/transfers/supplier-invoices.yaml
apiVersion: weik.io/v1
kind: mft
metadata: { name: supplier-invoices, project: finance }
spec:
  schedule: "0 0 5 * * ?"
  source:      { remote: supplier-ftp,      path: /outgoing }
  destination: { remote: invoice-archive,   path: invoices/incoming }
  operation: move
  filters: ["*.pdf"]
  emitPerFile: true

Each file has its log line whether emitPerFile is on or off.

One transfer, two agents#

A transfer that two agents match still runs once. Both agents start a copy, but only one copy, the leader, runs the schedule. When the leader’s agent goes away, the other copy takes over. Integrations that receive the run summaries get one summary per run either way.

One copy at a time shows how to see which copy leads.

Sign in to the live demo

Sign in with the shared viewer account. It can open every screen of the example projects but can't change anything.

E-mail
viewer@demo.weik.io
Password
try-weikio-live-demo
Open the live demo