Expert Mode
Launch the merchant-configured guided flow, which welcomes the shopper, asks questions one by one, then recommends products.
The simplest way to start it from your online store: data-workflow
Add data-workflow next to the usual trigger attribute. No JavaScript to write.
<button type="button" data-just-ai-agent-trigger data-workflow>
Find the right product for me
</button>The shopper's first message
By default the bubble reads "Let's go!". To change it, set
data-workflow-first-message on the button:
<button
type="button"
data-just-ai-agent-trigger
data-workflow
data-workflow-first-message="Find my size"
>
<svg>…</svg>
</button>The bubble text never reaches the model: the flow's own launch instruction is what goes to the agent.
data-first-message is ignored in workflow mode
Outside workflow mode, data-first-message displays an opening agent message
written in your theme. In workflow mode the flow already opens with the
welcome message configured in the dashboard, so the widget keeps that one and
drops yours.
Manual dispatch
The programmatic equivalent of the attribute:
window.dispatchEvent(
new CustomEvent('just:ai-agent:open', {
detail: { workflow: true },
}),
);Add message to choose the user's first message. It is the equivalent of
data-workflow-first-message, and the only way to set it here: a manual dispatch
has no button text to fall back on.
window.dispatchEvent(
new CustomEvent('just:ai-agent:open', {
detail: { workflow: true, message: 'Find my size' },
}),
);Behavior contract
- No workflow id ever travels on the wire. The shop's live flow runs, and which one is live is a dashboard setting: switching flows requires no theme change at all.
workflowwins overmessage. The text sent to the backend is a fixed internal instruction, never yourmessage, which only becomes the label shown in the shopper's bubble. Without it, a trigger block falls back todata-workflow-first-message, then to the generic label ("Let's go!").
No live workflow, no error
If the shop has no live workflow (or it was deleted), the open silently degrades to a normal conversation, with no visible error for the shopper. Nothing on the page signals which dashboard state is live.
During the flow
- One question at a time. While a question waits for its answer, the agent searches no products: it records the answer or leaves the flow.
- Optional step: a "Skip" button. Every optional step (choices, free text, email, photo) has a "Skip" button. The step is marked as skipped and the flow goes on.
- The shopper changes topic: the flow stops. If the shopper asks something else instead of answering, the agent answers that question and does not ask the flow's questions again.
- Required step left unanswered: the answers are dropped. If the shopper leaves the flow while a required step still waits for its answer (for example a required email), the agent no longer uses any answer from that flow, to search or to recommend. Example: the shopper answers "XXL", then asks for t-shirts instead of giving their email: the t-shirts shown ignore the XXL size. Refusing a required email gives the same result: no end-of-flow recommendation. To let a flow finish without an email, make the email step optional.
Merchant side
The answers collected by the flow are readable in the dashboard: Expert Mode → the flow → Answers tab.
Configure or change the live flow at https://ralph.getjust.eu/workflows.
See also
- Trigger button: everything the trigger attribute does outside workflow mode.
- Events reference: the full
just:ai-agent:opendetail contract.