Skip to content

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)
Terminal window
wfx templates router
wfx new router --as my-router
wfx dryrun my-router

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.

  • routes.json: one rule per workflow — kind, chatType, chat, source, fromOwner and a text regex; the last rule is the fallback
  • every workflow routes.json names must exist in the project (pingpong, frontdesk, …)
Input Type Default Required Meaning
event object yes
subscription object {}
# Step Kind Skills Gates
1 classify
Classify the event
shell (run:) exitCode = 2 → fail
2 route
Start the workflow that owns it
agent

This template never stops for a person.