This walks through the whole loop once: write a flow, publish it, deploy it, point a webhook at it, and read the run. It takes about ten minutes and leaves you with something real in your workspace.
Everything here happens in the app. If you would rather work in your own editor, the CLI section at the end picks up from the same objects.
Flows → New flow. Give it a name; the name is its identity, so pick the thing it does
(order-received, not flow-1). Creating it opens the browser editor with a runnable
main.ts already in place.
Replace it with two steps:
import { Workflow } from "konnecthub/flow";
export default class OrderReceived extends Workflow {
readOrder() {
const order = this.payload as { id: string; total: number };
this.log("INFO", `order ${order.id} for ${order.total}`);
return order;
}
summarise() {
return { seen: true };
}
}
The highlighted method is one step. So is summarise, and they run top to bottom. There is no
run method to fill in — see Writing a flow for why.
Your edits are saved to the flow's draft, which is a real version rather than a scratch buffer. Nothing runs in production until you publish it.
In the editor's Versions panel, choose Publish. That freezes the draft as a numbered version and starts bundling it in the background.
On the flow's Deployments tab, create one. A deployment is where the flow becomes runnable: it pins a version, holds the input values, and owns the limits.
Two settings are worth setting deliberately now rather than discovering later:
0. A step that throws fails the run on the first attempt.Webhooks → New webhook. Name it, save it, and the platform issues its URL:
https://your-konnecthub-host/api/v1/webhooks/trigger/<token>
A new webhook is not wired to anything yet. Bind it from the deployment's Triggers tab (or the webhook's Targets tab — they are two views of the same binding).
curl -X POST https://your-konnecthub-host/api/v1/webhooks/trigger/<token> \
-H 'content-type: application/json' \
-d '{"id":"A-1001","total":42.5}'
The call returns as soon as the delivery is recorded — it does not wait for your flow. (A webhook can be configured to block and stream the run's response instead; see Webhooks.)
Open Executions. The newest row is your run. Inside it you get, per step, its status, what it
returned, how long it took, and the log lines it wrote — including the INFO line from
readOrder.
If you see an event but no execution, that is a real distinction rather than a glitch: the delivery was recorded and reached nobody. Check the binding, and check whether the deployment is switched on.
The CLI edits the same draft the browser editor does, so the two are interchangeable rather than alternatives.
curl -fsSL https://your-konnecthub-host/install.sh | sh
konnecthub login
login opens a browser and asks which workspace to grant. In CI, set KONNECTHUB_TOKEN
instead — that is a first-class path, not a fallback.
konnecthub init my-flows # scaffold a project — adopts nothing
cd my-flows
konnecthub link # adopt the flow you just made in the app
konnecthub new another-flow # or create one from here, remotely and locally
init deliberately links nothing: the repo is an opt-in view of a workspace, not a mirror of it.
A flow's name is its identity key and becomes its directory name.
From then on:
konnecthub push # working tree → the draft (3-way merge on conflict)
konnecthub pull # the draft → working tree
konnecthub test # run tests/*.json as draft runs
konnecthub deploy # push → publish → wait READY → activate
konnecthub runs # recent executions
Because both editors write the same draft, a 409 on push while somebody is typing in the
browser is normal — the CLI re-merges.