Workflows
Step-by-step walkthroughs the assistant can lead a user through.
A workflow walks a user through something they are better off doing themselves: where to go, what to click, what the form asks for. The assistant chooses to start one, and the runtime, not the model, runs its steps, so the walkthrough is always the one you wrote.
Workflows only show. None of their steps changes data. To change data, use an action, with its permission, risk tier and confirmation.
Defining one
{
"name": "add_first_product",
"description": "Walk the user through adding their first product. Use when they ask how to add or list a product.",
"triggerPhrases": ["add a product", "list an item"],
"steps": [
{ "type": "navigate", "screenId": "inventory.products", "message": "Products live here." },
{ "type": "highlight", "componentKey": "products.addButton", "message": "Start with this button." },
{ "type": "wait", "message": "Press it when you are ready, and tell me when the form is open." },
{ "type": "focus", "componentKey": "products.nameInput", "message": "Give it a name first." }
]
}description is what the model reads when choosing, so say when to start it.
triggerPhrases widen what it matches. They do not start it on their own.
Steps
| Step | What it does |
|---|---|
navigate | Goes to a published screen. |
highlight | Points at a component on the current screen. |
focus | Puts the cursor in an input. |
open_form | Opens a form or dialog so the user can see what it asks. |
wait | Says something and stops until the user comes back. |
Each step can carry a message. Steps up to a wait happen together, and a
wait ends the turn, which is what keeps a walkthrough from arriving as one
wall of instructions.
Publishing, or building in the dashboard
Workflows are part of the registry, in its
workflows list. A publish checks every step: a navigate to a screen you did
not publish, or a step pointing at a component you did not list, is refused
before it can break in front of a user. Component targets are checked when you
publish components, and at runtime otherwise.
You can also build a workflow on the app's Registry tab, choosing each step's target from your published screens and components. A published workflow is shown there read-only, because your next publish would replace an edit.