Skip to main content

Workflow Reference Storage

Summary

Source-backed persistence of the workflow linkage carried by the Asset aggregate — a single optional workflow-instance identifier and its index. There is no separate workflow table in this database; the reference is a column on the asset row.

Audience

Backend engineers, database reviewers, architects, QA, support, operations, security reviewers, and product owners.

Overview

When an asset's approval is delegated to the Workflow Service, the asset records the identifier of the workflow instance that governs that decision. This linkage is stored as a nullable Guid column (WorkflowInstanceId) on the Assets table — not as a separate entity or table. The workflow instance itself is owned by the Workflow Service; the asset holds only the reference.

Confirmed persistence behavior

FieldStorageRequiredNotes
WorkflowInstanceIdGuid on the Assets rowNoSet when approval is delegated to the Workflow Service; identifier-only
  • Location: WorkflowInstanceId is a column on the Asset aggregate (the Assets table), not a separate workflow table.
  • Index: IX_Assets_WorkflowInstance indexes the column.
  • When set: the identifier is populated when approval for the asset is delegated to the Workflow Service.
  • Managed indicator: an asset is treated as workflow-managed when WorkflowInstanceId is set and its Status is Requested. This is a computed condition (IsWorkflowManaged), not a persisted column.
  • Callback idempotency: workflow callbacks are idempotent — when the asset's Status is no longer Requested, the callback is acknowledged without re-applying the decision.
  • Retained for traceability: the identifier is kept on the row after the decision is made, providing a durable link back to the governing workflow instance.
  • Identifier-only boundary: there is no foreign key from this database to the Workflow Service. The value is a plain identifier, and there is no reconciliation of the referenced instance from this service.

Classification

Implemented identifier-only cross-service reference on the aggregate.

Requires confirmation

Whether the workflow linkage requires reconciliation or lifecycle cleanup after a decision is not decided in source and requires confirmation.

Diagram

See Also

Keywords

  • Workflow reference
  • Workflow Reference Storage
  • Draft database documentation

Source References

  • microservices/src/asset-service/Domain/Asset/Asset.cs
  • microservices/src/asset-service/Infrastructure/AssetDbContext.cs
  • microservices/src/asset-service/Application/WorkflowIntegration.cs
  • microservices/src/asset-service/Infrastructure/WorkflowServiceClient.cs

Revision Information

  • Status: Draft
  • Last reviewed: 2026-07-17
  • Review cycle: Quarterly