Workflow
When to use workflows and how they start.
Overview
Workflow guidance is integrated into the standard chat bubble, giving you step-by-step activation work, visible progress, and explicit handoff to the user.
When To Use It
- Use workflows when the customer is completing setup, activation, or first-value tasks.
- The chat bubble switches UI modes automatically when a workflow is active.
Workflows feel like a step-by-step checklist inside the same AI bubble that supports freeform help.
Runtime Contract
To avoid replaying completed flows, pass stable user identity and eligibility fields into the provider.
import {
ModelNexProvider,
ModelNexChatBubble,
} from '@modelnex/sdk'
function AppShell() {
return (
<ModelNexProvider
websiteId="your-website-id"
userProfile={{
userId: currentUser.id,
type: currentUser.role,
isNewUser: currentUser.isNewUser,
features: currentUser.enabledFeatures,
}}
>
<Routes />
<ModelNexChatBubble appName="My Product" />
</ModelNexProvider>
)
}
userProfile.userIdscopes completion and dismissal state.userProfile.isNewUserpowersfirst_visitmatching.userProfile.typeshould match the audiences you target in Portal.alwaysflows do not require extra eligibility fields beyond your normal targeting data.
first_visit matches when userProfile.isNewUser === true.
always stays eligible regardless of whether the user has already seen or dismissed the flow.
Resilience and Refreshes
ModelNex is designed to be resilient to page transitions and refreshes that occur during a workflow.
- Auto-resumption: If a user refreshes the page or navigates away, the SDK automatically re-establishes the connection and resumes the active workflow from the correct step.
- Benign re-evaluations: Technical disconnections (like those caused by a page reload) are handled as benign events. The agent re-verifies the user's current state against the goal before proceeding.
- Cross-type compatibility: While you can separate "Product Tours" from "Onboarding Workflows," the system allows seamless resumption across hook types if a session is already in progress.
Start Behavior
Experiences with matching triggers now start immediately by default.
Use the manual trigger, labeled "Manual or Search" in Portal, for flows that should only launch from an explicit action such as a button click, checklist item, or chat bubble search/conversation flow.
Testing
Test workflows deterministically with ?modelnex_test_workflow=FLOW_ID against staging environments that mirror production auth, flags, and routing.
- Validate that the panel persists across route transitions.
- Validate that user-waiting steps pause instead of forcing automation.
- Validate that completed users do not re-enter finished flows unexpectedly.
Continue with Workflow Authoring, then Workflow Preview and Publish.