Studio workflow authoring and monitoring
Studio gives engineers one place to define workflows, inspect their versions, run or manage them, and follow live execution. It joins visual workflow designers with the remote workflow APIs so that a definition becomes an executable workflow and an instance becomes an observable run. See Studio application platform for the host and module model, Workflow definition management for server-side definition rules, and Workflow APIs and HTTP integrations for the API and live-update boundary.
Workflow authoring
The authoring experience turns a workflow definition into a visual graph with editable activity properties. The editor keeps the graph, metadata, inputs and outputs, variables, version history, and code view in one workspace. Changes can be saved as a draft, applied from JSON, published, retracted, or saved as a new definition.
Editor workspace
The workflow editor combines an activity picker, a diagram area, and an activity properties area. It loads the latest definition by default, but the workspace can display another version without replacing the latest draft. The code view provides a second way to inspect or change the definition when visual editing is not the best fit.
The editor supports read-only mode. In that mode, Studio keeps the workflow visible but blocks changes that would alter the definition. Auto-save and auto-apply are enabled by default for the normal authoring flow, while explicit save, publish, retract, import, and export actions remain available through the editor controls.
References: src/…/WorkflowDefinitionEditor.razor• L11-31 src/…/WorkflowDefinitionWorkspace.razor.cs• L33-75 src/…/WorkflowEditor.razor.cs• L257-307 src/…/ServiceCollectionExtensions.cs• L67-71
Activity selection
The activity picker exposes the activity types that the connected backend has registered. It groups activities by category and supports search, so an author can drag an activity into a compatible place in the graph instead of building the workflow from raw JSON.
Selection links the diagram to the property panel. When an activity is selected, Studio uses its type and version to show the matching settings. Nested containers use a breadcrumb path so the author can move between the root graph and an embedded branch without losing the surrounding workflow context.
References: src/…/ActivityPicker.razor• L13-64 src/…/WorkflowEditor.razor.cs• L512-518 src/…/DiagramDesignerWrapper.razor• L21-40 src/…/DiagramDesignerWrapper.razor.cs• L657-775
Diagram designers
Studio chooses a diagram designer from the root activity or embedded container. The designer presents the graph in the form that best matches the workflow structure while sharing common actions such as selection, navigation, statistics, and read-only display.
The main visual forms are:
- Flowcharts for branching graphs. They support layout controls and image export.
- Sequences for ordered activity groups. They support orientation, ordering, and layout controls.
- State machines for states and transitions. They support graph navigation and state inspection.
- BPMN processes for imported BPMN documents.
- A fallback view for activity structures without a specialized designer.
Double-clicking a supported nested activity opens its own diagram view. A workflow activity can instead open the referenced workflow definition, which lets authors move between related definitions.
References: src/…/ServiceCollectionExtensions.cs• L53-58 src/…/FlowchartDiagramDesigner.cs• L28-94 src/…/SequenceDiagramDesigner.cs• L22-88 src/…/StateMachineDiagramDesigner.cs• L22-80 src/…/DiagramDesignerWrapper.razor.cs• L667-689
BPMN interchange
BPMN support lets Studio bring an external BPMN 2.0 process into the workflow system and preserve the source document for later exchange. Imported BPMN processes open in a BPMN-specific view rather than the generic fallback view.
BPMN editing boundary
The BPMN canvas is a view of the imported process. It is read-only in the current authoring path, and BPMN is not available on the React Flow canvas. Authors can still set the workflow activity binding for BPMN elements through the Performed by area. Those binding changes belong to the imported BPMN document, not to an unrelated rewrite of the generated activity graph.
This boundary keeps the executable workflow and the source BPMN document aligned. A normal definition save can update other definition properties, but a graph change outside the BPMN document is refused. A binding save uses the document revision that Studio read, and a stale revision is reported as a conflict rather than silently overwritten.
References: src/…/BpmnDiagramDesigner.cs• L21-31 src/…/BpmnDesignerWrapper.razor• L3-16 src/…/WorkflowEditor.razor.cs• L270-283 src/…/BpmnDocumentSession.cs• L8-25
BPMN import and export
The definitions view accepts BPMN 2.0 files as a separate import path. Studio loads the resulting definition into the editor, where the diagram and its bindings can be reviewed before further work.
Export is available when the definition still represents an imported BPMN document. Studio asks for confirmation because the BPMN file carries workflow binding configuration and expressions. The server rejects export when the definition is missing, was not imported from BPMN, or no longer matches the imported document; Studio reports those conditions instead of downloading an ambiguous file.
References: src/…/WorkflowDefinitionList.razor• L76-85 src/…/BpmnDiagramDesigner.cs• L145-212 src/…/ExportBpmnDialog.razor.cs• L6-16 src/…/WorkflowEditor.razor.cs• L875-905
Definition export
Studio treats export as a way to move or review a workflow definition outside the current editor. Definition lists can export one or more selected definitions, and the editor can export the current definition with user-selected inclusion options.
Diagram export serves a different purpose. It produces a visual artifact for flowcharts, while BPMN export produces BPMN 2.0 XML for an eligible imported process. These outputs describe or exchange the workflow but do not replace the definition save and publish lifecycle.
References: src/…/WorkflowDefinitionList.razor• L51-60 src/…/WorkflowEditor.razor.cs• L848-852 src/…/FlowchartDiagramDesigner.cs• L84-130 src/…/BpmnDiagramDesigner.cs• L145-200
Workflow instance monitoring
An instance is one running or completed execution of a workflow definition. Studio shows the definition graph together with the instance state, execution history, activity runs, incidents, and timing information so an engineer can move from a high-level status to the activity that needs attention.
The monitoring flow connects the instance list to a focused viewer. The viewer loads the instance and its definition, selects the relevant journal scope, and updates the diagram and detail panels as execution records change.
This diagram shows how a selected instance moves from list-level status to graph-level and activity-level detail.
flowchart LR
A[Instance list] -->|View| B[Instance viewer]
B --> C[Workflow graph]
B --> D[Journal and call stack]
B --> E[Activity details]
F[Live update source] --> B
D -->|Select record| C
E -->|Select execution| C
Instance observation
Running instances use a live observer when the remote real-time feature and its server hub are available. The observer receives workflow, journal, and activity execution updates, then the viewer refreshes the matching graph statistics and detail panels.
Studio falls back to periodic API polling when real-time updates are disabled or the hub is not available. The viewer stops observing after the instance finishes and disposes the observer when the page closes. This keeps live monitoring useful in deployments that do not expose the real-time transport.
References: src/…/WorkflowInstanceObserverFactory.cs• L33-87 src/…/SignalRWorkflowInstanceObserver.cs• L7-49 src/…/PollingWorkflowInstanceObserver.cs• L15-81 src/…/WorkflowInstanceViewer.razor.cs• L64-78
Execution views
The instance viewer places the workflow diagram beside a detail workspace. The left side provides the execution journal and activity call stack. The main area shows the workflow graph and its activity information. A selected execution opens a detail drawer, and selections made in the journal or call stack navigate the diagram to the related activity, including a nested activity when needed.
The graph can show two kinds of live state. Activity statistics identify starts, completions, faults, blocks, and unfinished work. BPMN element statistics add state to gateways, events, and sequence flows that do not have an Elsa activity ID. The viewer refreshes these overlays with the same observation cycle so the diagram and execution records remain aligned.
References: src/…/WorkflowInstanceViewer.razor• L5-53 src/…/WorkflowInstanceWorkspace.razor• L5-35 src/…/WorkflowInstanceDesigner.razor.cs• L280-307 src/…/DiagramDesignerWrapper.razor.cs• L552-569
Workflow management views
Studio provides separate list views for workflow definitions and workflow instances. The definition view manages reusable process versions, while the instance view manages individual runs. Both views use server-backed tables so that search, filters, paging, and actions operate on the remote workflow store rather than only on the current browser page.
Definition management
The definition list shows the definition ID, name, latest version, published version, and description. From the list, an engineer can create, edit or view, run, duplicate, cancel, delete, publish, retract, import, and export definitions, subject to read-only mode and the permissions exposed by the backend.
The editor's version history gives a definition-level view of published and draft versions. An engineer can inspect a version, roll back when permitted, or remove versions when the permission rules allow it. The selected version can be viewed without changing which version is the latest working definition.
References: src/…/Index.razor• L1-16 src/…/WorkflowDefinitionList.razor• L22-86 src/…/WorkflowDefinitionList.razor• L135-160 src/…/VersionHistoryTab.razor• L7-55
Instance management
The instance list shows each run with its workflow, version, status, incident count, correlation ID, and key time points. Search, workflow, status, sub-status, incident, and date filters narrow the server query. The list can refresh on demand or poll at a configured interval, which is set to ten seconds by default for the list view.
Instance actions include viewing, cancelling, deleting, importing, and bulk cancellation or deletion. Alteration controls appear only when the optional alterations feature is available. Instance export controls are not currently exposed in the list, so the instance viewer is the supported path for inspection rather than file export.
References: src/…/Index.razor• L1-16 src/…/WorkflowInstanceList.razor• L37-147 src/…/WorkflowInstanceList.razor.cs• L123-188 src/…/ServiceCollectionExtensions.cs• L72-76
Authoring and monitoring relationship
Authoring and monitoring use the same definition graph but have different goals. The editor changes the definition that future runs use, while the instance viewer reads a specific definition version and overlays the execution state of one run. This distinction lets an engineer inspect a live or finished run without changing its source definition.
The main hand-offs are:
- An engineer creates or imports a definition and edits its graph or properties.
- Studio saves a draft or publishes a version through the workflow management boundary.
- A run appears in the instance list with its definition version and status.
- The instance viewer loads that version and correlates journal and execution records with graph nodes.
- The engineer follows live updates or uses the journal and call stack to locate faults, blocked work, or unfinished activities.
References: src/…/WorkflowDefinitionWorkspace.razor.cs• L98-134 src/…/WorkflowEditor.razor.cs• L647-685 src/…/WorkflowInstanceList.razor.cs• L123-175 src/…/WorkflowInstanceViewer.razor.cs• L135-167
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the diagram designer provider order and activity type checks aligned when a new workflow root or visual form is added.
- Keep activity selection, breadcrumb navigation, journal filters, and node IDs aligned so a selection from a nested execution still opens the correct graph container.
- Keep BPMN document saves, imported source state, ETags, and ordinary definition saves consistent so a graph cannot become stale relative to the source BPMN document.
- Keep the real-time feature name, SignalR hub route, server middleware, and polling fallback aligned when changing live instance updates.
- Keep list filters and URL query encoding aligned when adding or renaming instance filters, because saved links must reconstruct the same server query.
- Keep read-only and permission checks aligned between list actions, editor actions, and version-history actions.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| The real-time feature is enabled but the workflow-instance hub is not installed. | The live connection cannot start and the viewer would otherwise lose live updates. | The observer factory falls back to polling when the hub returns not found. |
| An author changes the generated activity graph of an imported BPMN definition outside the BPMN document. | The save is refused because the executable graph no longer matches the imported source. | Edit BPMN bindings through the document-backed Performed by path, or reload to discard the graph change. |
| A BPMN document changed after Studio read it. | The binding save is rejected as a stale revision, and the local working copy is not silently overwritten. | Reload the document, review the current bindings, and save again. |
| A workflow definition version referenced by an instance is missing. | The instance cannot be mapped to a definition name in the list and is excluded from the displayed rows. | The instance list resolves definition versions before creating rows and removes unmatched records. |
| A live viewer receives an update after the component or browser circuit is gone. | A timer or observer callback can try to update a disposed UI. | Observer and timer disposal paths stop callbacks and treat circuit-loss exceptions as a quiet disconnect. |
Key files
| File | Why to read it |
|---|---|
| src/…/ServiceCollectionExtensions.cs | Shows how the workflow authoring module composes designers, observers, import/export services, and default behavior. |
src/studio/modules/Elsa.Studio.Workflows/Components/WorkflowDefinitionEditor/WorkflowDefinitionEditor.razor | Shows the top-level authoring layout: activity picker beside the definition workspace. |
| src/…/WorkflowEditor.razor.cs | Shows the definition save, publish, import, export, BPMN boundary, and selection lifecycle. |
| src/…/DiagramDesignerWrapper.razor.cs | Shows shared graph loading, nested navigation, activity selection, and execution overlays across diagram types. |
| src/…/BpmnDiagramDesigner.cs | Shows the BPMN display, export, and imported-document boundary. |
| src/…/BpmnDocumentSession.cs | Shows the BPMN binding working copy, revision checks, and save conflict behavior. |
| src/…/WorkflowInstanceList.razor.cs | Shows instance filters, paging, polling, management actions, and URL state. |
| src/…/WorkflowInstanceViewer.razor.cs | Shows how a selected instance loads its definition, journal, observer, and cross-panel selection state. |
| src/…/WorkflowInstanceObserverFactory.cs | Shows the real-time capability check and polling fallback used for live monitoring. |