Skip to content

Deployment internals

Overview

The deployment sidebar lets users deploy BPMN/DMN diagrams and start process instances against Camunda 7 and Camunda 8 clusters. The architecture is a linear chain: webview form → DeploymentController → service (DeploymentService or StartInstanceService) → CamundaEngineRouter → engine-specific RestClient.

See the user-facing Deployment page for the UX contract, settings, REST endpoints, payload formats, and authentication modes.

System overview

Two services share a single controller:

  • DeploymentService — reads the main file + additional files, calls deploy, persists the endpoint and credentials via VS Code's SecretStorage.
  • StartInstanceService — discovers .json payload files under <configFolder>/payloads/, resolves the process definition key, calls start-instance.

The CamundaEngineRouter dispatches to either C7RestClient or C8RestClient based on the engine field in the form config.

Entry points

  • Deployment webview (apps/deployment-webview) posts DeployCommand or StartInstanceCommand to the extension host.
  • DeploymentController (extension host) is the host-side entry — it wires every webview message to a service method.
  • BpmnModelerService (for the sidebar-to-editor interactions) supplies form defaults based on the currently open BPMN file.

Key files

FilePurpose
apps/deployment-webview/Sidebar UI (Vite dev) — forms for Deploy and Start Instance
apps/modeler-plugin/src/infrastructure/DeploymentWebviewHtml.tsRuntime HTML shipped inside the extension — must stay in sync with apps/deployment-webview/index.html
apps/modeler-plugin/src/controller/DeploymentController.tsRoutes webview commands to the two services
apps/modeler-plugin/src/service/DeploymentService.tsDeploy orchestration, credential persistence
apps/modeler-plugin/src/service/StartInstanceService.tsStart-instance orchestration, payload file discovery
apps/modeler-plugin/src/service/ArtifactService.tsHierarchical payload/config-folder discovery
apps/modeler-plugin/src/service/CamundaEngineRouter.tsDispatches to C7 vs C8 REST client
apps/modeler-plugin/src/infrastructure/C7RestClient.tsCamunda 7 REST calls + auth
apps/modeler-plugin/src/infrastructure/C8RestClient.tsCamunda 8 REST calls + auth
libs/shared/src/lib/modeler.tsDeployment message types

Message protocol

MessageDirectionPayload
RequestFormDefaultsCommandwebview → host{ editorId }
FormDefaultsQueryhost → webview{ name, engine, endpoint, auth, … }
DeployCommandwebview → hostfull deploy config
DeploymentResultQueryhost → webviewsuccess payload or error
RequestProcessDefinitionKeyCommandwebview → host{ editorId }
ProcessDefinitionKeyQueryhost → webview{ key } extracted from the current BPMN
RequestPayloadFilesCommandwebview → host{ editorId }
SelectedPayloadFileQueryhost → webview{ filePath, label }
StartInstanceCommandwebview → hostconfig + payload
StartInstanceResultQueryhost → webviewsuccess payload or error

Interaction flow

Deploy

Start Instance

Gotchas

  • The deployment webview has two copies of its HTML that must stay in sync:apps/deployment-webview/index.html (Vite dev) and apps/modeler-plugin/src/infrastructure/DeploymentWebviewHtml.ts (runtime in VS Code). When you change the form markup, update both.
  • Credentials are stored via SecretStorage, not globalState. Don't persist passwords or OAuth2 tokens in any other location.
  • C7 and C8 payload formats differ — C7 wraps each variable in { value, type, valueInfo }, C8 uses plain values. The extension sends the payload file contents as-is (wrapped in a variables key), so file format mismatch shows up as a deploy-time error, not a validation error.
  • ArtifactService walks up from the BPMN file's directory to the workspace root, collecting payload files at each level (nearest first). Changing the discovery order breaks teams that override default payloads per subdirectory.