Invoke a route
Weik.io 2026.2weikio invoke and the admin UI's Invoke dialog send a message into a running route, on any endpoint whose component accepts one, and show the reply.
On this page
weikio invoke sends one message into a route of a running deployment and prints the reply. It works the way Camel’s own camel cmd send does: the agent hands the message to the process through Camel’s CLI connector. It needs no extra port and no second process, so it works on a site that opens no inbound port.
Send a message#
$ weikio invoke finance/erp-invoice-export --env devtest --endpoint direct:run-exportTarget: https://hub.example, project finance (argument), environment devtest (--env)
200 replied in 1.9 s
traceparent: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-03
{"exported":14}
To see this message's trace, run:
weikio trace 4bf92f3577b34da6a3ce929d0e0e4736The reply has its status, the headers and the body as the route left it. 200 means the route replied, 500 that it failed, with the exception’s text, and 504 that no reply came within --timeout, 30 seconds by default. The trace shows every step the message went through.
--body @order.json sends a file as the body, --body '...' sends text, and --header k=v adds a header. In a production environment the CLI asks before it sends, and -y confirms.
Which endpoints accept a message#
Any endpoint whose component can produce a message accepts one: direct:, seda:, kamelet: and every other component Camel doesn’t mark as consumer only. timer:, quartz: and platform-http: start routes but accept no message, so the CLI tells you how to reach the work behind them instead:
$ weikio invoke finance/nightly-payroll --env devtestTarget: https://hub.example, project finance (argument), environment devtest (--env)
error: No endpoint of version '1.0.0' of 'finance/nightly-payroll' accepts a message.
'quartz:payroll/nightly' doesn't accept a message.
Add a direct: route that this route calls:
- from: uri: quartz:payroll/nightly steps: [{ to: "direct:run-nightly-payroll" }]
- from: uri: direct:run-nightly-payroll steps: [ ... ]
Then invoke that route with:
weikio invoke finance/nightly-payroll --env devtest --endpoint direct:run-nightly-payrollA route that starts from platform-http: answers on its agent’s host, on port 8080 unless the integration sets its own server settings, or through an API in front of it.
Without --endpoint, the CLI looks at the endpoints the routes start from. When exactly one accepts a message it sends there, and when several do it lists them:
$ weikio invoke finance/orders --env devtestTarget: https://hub.example, project finance (argument), environment devtest (--env)
error: Version '1.2.0' of 'finance/orders' has 3 endpoints that accept a message. Choose one with --endpoint:
direct:new-order route new-order routes/orders.camel.yaml
seda:retry route retry routes/orders.camel.yaml
kamelet:timer-source?message=go route nightly routes/nightly.camel.yaml
Not listed: 'platform-http:/orders' is an HTTP endpoint, which invoke can't send to. Call it on its agent's host (port 8080 by default), or through an API routed to it.Run a schedule or a transfer now#
A schedule runs its command at once with weikio invoke <project>/<name>, and the reply is what the command printed. A transfer starts a run with --endpoint direct:mft-run, which waits behind a run in progress and returns at once.
Which copy gets it#
For an integration that runs one copy at a time, the message goes to the copy that leads. Otherwise it goes to one of the running copies, and --agent picks the agent.
In the admin UI#
A deployment that accepts messages has Invoke in its menu. The dialog acts on the environment of the deployment you opened it on, and its Endpoint field suggests the endpoints the routes start from. A schedule’s and a transfer’s deployments have Run now instead, which says in one sentence what the run does and needs nothing filled in.