Skip to content
Weik.ioDocs
2026.2
Try Weik.io

One copy at a time

Weik.io 2026.2

An integration that two agents run can still do its work once, with singleton: true or Camel's master: component and a lock the hub keeps. Product page · Video

Watch: One copy at a time, 2:58

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, which is how an integration is made highly available. A polling route or a nightly job must do its work once, though, and for those Weik.io elects a leader among the copies.

The whole integration: singleton#

singleton: true in integration.yaml runs one copy at a time. Every matching agent starts its copy, the copies elect a leader through a lock the hub keeps, and the others wait with their routes stopped until they lead. When the leader’s agent goes away, another copy 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 set it too, for one environment.

One route: Camel’s master component#

To lead with a single route and keep the others running 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

You write no connection settings. When the build finds Camel’s master component in the version’s dependencies, the agent gives the process the settings of the platform’s lock, and the platform’s own cluster service elects the leader through the hub. A site needs no ZooKeeper. An integration that configures a cluster service of its own keeps it.

Kinds that run one copy by default#

File transfers, schedules, change tracking and event sources run one copy at a time unless the integration or its deployment says singleton: false. A transfer that two agents match still moves each file once, and a change tracking publishes each database change once.

See who leads#

The integration’s page shows a Leader or Standby badge on each copy in the Environments section, a line above the agents table says which copy leads, and the strip shows <agent> leads. An agent’s Integrations table has a Role column with leader, standby or -, and a closed Leader changes fold lists the moves of the lead over the last seven days.

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

When the hub can’t be reached#

whenHubUnreachable says what the leading copy does while its agent can’t reach the hub. keepLeading keeps it working, and standDown stops it until the hub answers again. Change tracking stands down by default, and every other kind keeps leading.

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

The Runs row of the integration’s Details panel says how it runs, where that setting comes from and what the leader does when the hub can’t be reached. When no copy leads, the integration’s health shows No leader.