router
Router — classify an event and start the workflow that owns it
One rule table (routes.json), first match wins, and a start: step that starts the matched workflow as its own run. The generic front door for events from chats, hooks and other workflows.
| Source | templates/router/workflow.yaml |
| Category | debugging-ops |
| Trigger | called by other workflows · manual (wfx run) |
| Steps | 2 |
| Human approval before | none |
| Providers named | default (WFX_DEFAULT_PROVIDER) |
Use it
Section titled “Use it”wfx templates routerwfx new router --as my-routerwfx dryrun my-routerWhat it does
Section titled “What it does”Classifies one event against a rule table and starts the workflow that owns it as an independent child run. Routes only: it never replies or changes anything itself.
What you fill in
Section titled “What you fill in”- routes.json: one rule per workflow — kind, chatType, chat, source, fromOwner and a
textregex; the last rule is the fallback - every workflow routes.json names must exist in the project (pingpong, frontdesk, …)
Inputs
Section titled “Inputs”| Input | Type | Default | Required | Meaning |
|---|---|---|---|---|
event |
object | yes | ||
subscription |
object | {} |
| # | Step | Kind | Skills | Gates |
|---|---|---|---|---|
| 1 | classifyClassify the event |
shell (run:) |
exitCode = 2 → fail |
|
| 2 | routeStart the workflow that owns it |
agent |
Human gates
Section titled “Human gates”This template never stops for a person.