The Embedded UI supports full workflow execution, including multi-step sequences of modules with navigation, submission persistence, and step progress indicators. This reference covers how workflows are mounted, how navigation and submissions work, and the workflow state machine.
What Is Workflow Embedding?
A workflow is an ordered sequence of Unqork modules that an end-user moves through step by step, similar to a multi-page form. When a workflow is embedded in a host page, the entire step-by-step experience renders inside a single custom HTML element, without redirecting the end-user to the Unqork platform.
The Embedded UI supports:
- Step navigation (Next, Previous).
- Save and Exit.
- persistence across steps.
- Step progress indicators.
Mounting a Workflow
To embed a workflow, call runtime.mountWorkflow() with the workflow's path and the DOM target where it should render. The parameters below control how the workflow loads and whether an existing in-progress submission is resumed.
| Parameter | Type | Required | Description |
|---|---|---|---|
workflowPath |
string |
Yes | The unique path identifier for the workflow, like insurance-onboarding. |
target |
string |
Yes | The custom element tag name or CSS selector for the DOM element where the workflow renders. |
submissionId |
string |
No | The ID of an existing submission to resume. If provided, the workflow loads at the step where the end-user left off. |
style |
string |
No | An optional CSS style override applied to the workflow container. |
Workflow Flow
The diagram below shows the sequence of calls that happen when mountWorkflow() is called and when an end-user navigates between steps. Each participant represents a layer in the Embedded UI stack, from the host page down to the Unqork API.
sequenceDiagram
participant Host as Host Page
participant RT as UnqorkRuntime
participant CE as CentauriRuntime
participant SPA as spa-embed.js
participant ANG as Angular (Shadow DOM)
participant API as Unqork API
Host->>RT: mountWorkflow({ workflowPath })
RT->>CE: mountModule({ workflowPath })
CE->>SPA: mount({ workflowPath })
SPA->>ANG: $state.go('embedWorkflowStart', { workflowPath })
ANG->>API: GET /fbu/uapi/workflow/{workflowPath}
API-->>ANG: { form, navigation, submission, ... }
Note over ANG: DisplayWorkflow controller processes response
ANG->>ANG: $state.go('embedWorkflowPath', { workflowPath, stepPath })
Note over ANG: Module renders inside workflow template
Host->>ANG: User clicks Next
ANG->>API: POST /fbu/uapi/workflow/{workflowPath}/navigate
API-->>ANG: { nextStep form, navigation, submission }
ANG->>ANG: $state.go('embedWorkflowPath', { stepPath: nextStep })
Workflow State Machine
The diagram below shows the states a workflow moves through from mount to completion. Each transition maps to a user action or an API response.
stateDiagram-v2
[*] --> embedWorkflowStart: mountWorkflow()
embedWorkflowStart --> embedWorkflowPath: API returns first step
embedWorkflowPath --> embedWorkflowPath: Next or Previous
embedWorkflowPath --> embedWorkflowStepSubmission: When submissionId exists
embedWorkflowStepSubmission --> embedWorkflowPath: Continue navigation
embedWorkflowPath --> [*]: Save and Exit or Complete
Workflow Template
Each embedded workflow renders using a built-in inline template. The template provides the structural elements that make the workflow work inside a host page, including navigation controls, a loading state, and the content area where each step's module renders.
| Element | Description |
|---|---|
| Loader overlay | Displays a loading indicator during API calls. The overlay stays in the custom element's boundaries using position: absolute so it does not cover the host page. |
| Flash messages | Displays warnings and errors returned from the workflow API. |
| Header title | A configurable title pulled from the workflow definition. |
<workflow-navigation> |
Displays the end-user's current step in the workflow. |
<unqorkio> |
The content area where the current step's module renders. |
| Navigation buttons | The Save and Exit, Previous, and Next buttons for moving through the workflow. |
Submission Persistence
Workflow submissions are stored on the server so data is not lost when an end-user moves between steps. The submission is created automatically the first time the user moves forward, and the same submission is reused for every subsequent step.
- The end-user fills Step 1 and clicks Next.
- A
POST /navigaterequest creates a submission and returns asubmissionId. - Step 2 loads with the
submissionIdin state params. - Data persists across forward and backward navigation.
- Save and Exit persists current data and exits.
Workflow Errors
When something goes wrong during a workflow, like a failed API call or a navigation error, the Embedded UI sends an error payload to the host page. The table below lists each workflow-specific error type, where it originates, and what it means.
| Error Type | Source | Description |
|---|---|---|
workflow |
DisplayWorkflow.error() |
The workflow API returned an error status, like a 4xx or 5xx response. |
workflow-fatal |
DisplayWorkflow.handleError() |
A fatal error occurred while the workflow was processing the API response. |
workflow-navigation |
onWorkflowNavigate() catch |
A navigation action (Next, Previous, or a direct jump) failed to complete. |
Workflow Error Payloads
All workflow errors include timestamp, type, message, and originalError. Additional fields depend on the error type:
workflow: includesworkflowPath,stepPath, andstatus(HTTP status code).workflow-fatal: includesworkflowPathandstepPath. Also triggers an error dialog inside the embedded module.workflow-navigation: includesworkflowPath,stepPath, andaction. Theactionfield is one ofnext,previous, orgoto, indicating which navigation action failed.
{
"timestamp": "2026-06-11T12:00:00.000Z",
"type": "workflow-navigation",
"message": "Workflow navigation failed (next)",
"workflowPath": "insurance-onboarding",
"stepPath": "step-1",
"action": "next",
"originalError": {}
}
Note: The
workflow-navigationerror is separate from theunqork-embed-workflow-navigatesuccess event, which fires only on successful navigation and includesaction,submissionId,stepPath, andworkflowPath. The error fires in thecatchblock and does not includesubmissionId.
For full per-type payload details, see the Embedded UI Error Surfacing Reference.
Changelog
| Date | Change |
|---|---|
| 2026-04-21 | Initial publication. |
| 2026-06-15 | Added Workflow Error Payloads section with per-type payload details, JSON example, and workflow-navigation vs. success event distinction. |
| 2026-06-11 | Editorial pass: fixed metadata title (was "Testing Reference"), fixed metadata description, removed HR dividers, added description paragraphs to all H2 sections and Mermaid diagrams, expanded parameter table and element table descriptions, updated internal links. |