Skip to content
Weik.ioDocs
2026.2
Try Weik.io

One copy at a time

Weik.io 2026.2

Use singleton: true or Camel's master: component so that an integration run by two agents does its work once. Product page · Video

Watch: One copy at a time, 3:01

The video runs one copy of an integration at a time across two agents with singleton: true.

On this page

A deployment runs on every agent that matches it, so two matching agents run two copies. For a polling route or a nightly job that must do its work once, Weik.io elects a leader among the copies.

Run one copy#

singleton: true in integration.yaml runs one copy at a time. The copies on the matching agents elect a leader. The other copies wait with their routes stopped. When the leader’s agent goes away, one of them takes over.

erp-invoice-export/integration.yaml
name: erp-invoice-export
version: 1.2.0
singleton: true
requirements: { os: linux, region: fi }

A deployment can also set singleton for its environment alone.

Lead with one route#

To run one route in a single copy and the other routes in every copy, start that route with Camel’s master: component and a namespace of your choosing:

routes/fetch-invoices.camel.yaml
- route:
    from:
      uri: master:erp-poll:timer:tick?period=60000
      steps:
        - to: "{{erp-url}}/api/invoices/pending"
        - to: direct:transform

The master: component needs no connection settings and no ZooKeeper. An integration that configures its own cluster service keeps it.

One copy by default#

  • File transfers
  • Schedules
  • Change tracking integrations
  • Event sources

To turn this off for one of them, set singleton: false on the integration or its deployment. A transfer that two agents match still moves each file once. A change tracking integration publishes each database change once.

See who leads#

In the admin UI, you see which copy leads on the integration’s page and on the agent’s page:

  • The environment’s cell on the integration’s Overview, as <agent> leads
  • The integration’s Environments section, as a Leader or Standby badge on each copy
  • The Role column of the Integrations table on an agent’s page, as leader, standby or -

To see each change of leader over the last seven days, open the collapsed Leader changes section in the integration’s Environments section.

weikio invoke sends to the copy that leads unless you name an agent with --agent.

When the hub is unreachable#

whenHubUnreachable sets what the leading copy does while its agent can’t reach the hub:

Value What the leading copy does
keepLeading Keeps working
standDown Stops until the hub answers again

The default is standDown for change tracking and keepLeading for every other kind.

erp-invoice-export/integration.yaml
name: erp-invoice-export
version: 1.2.0
singleton: true
whenHubUnreachable: standDown

To see the value an integration uses and where that value comes from, look at the Runs row of its Details panel.

When no copy leads, the integration’s health shows No leader.

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