Flow SDK

Dependency Graph

Visualize how artifacts, modules, workflows, and packs depend on each other — understand blast radius before making changes.

The dependency graph at SDK → Dependencies is a live directed acyclic graph (DAG) showing every dependency relationship in your workspace. It answers the question: "If I change X, what breaks?"

Node Types

Icon ColorTypeDescription
IndigoModuleTypeScript library imported by artifacts.
PurpleArtifactCustom node, script, handler, job, or transform.
GreenWorkflowWorkflow definition that uses a custom node or runs a script.
AmberPackInstalled pack providing bundled artifacts and modules.
Bluenpm PackageExternal npm package imported in a module or artifact.
GraySystem TablePlatform table read or written by an artifact.

Reading the Graph

  • Arrow direction: Points from dependent → dependency. An arrow from artifact A to module M means "A imports M".
  • Upstream (ancestors): Click any node and select "Show upstream" to see everything that depends on this node. This is your blast radius for a change.
  • Downstream (descendants): "Show downstream" shows everything this node depends on — its full transitive dependency tree.
  • Critical path: Nodes with the most upstream dependents are highlighted in red — changes here affect the most other things.

Impact Analysis Before Deployment

When you publish a new version of a module or artifact, FlowOS automatically runs an impact analysis and shows you all affected artifacts and workflows:

bash
# CLI — show impact before publishing
flowos module publish github-helpers --dry-run

# Output:
# Publishing github-helpers@5 would affect:
#   3 artifacts:
#     - github-push-handler (active in production)
#     - github-action-failed (active in production)
#     - link-pr-to-change (active in staging)
#   2 workflows using these artifacts:
#     - GitHub Actions Failure → Incident (active)
#     - PR → Change Request Link (active)
#
# Proceed? [y/N]

Circular Dependency Detection

The graph builder detects circular dependencies at save time. A module cannot import another module that directly or transitively imports it back. If a cycle is detected:

  • The save is blocked and the exact cycle path is shown in the editor: module-a → module-b → module-c → module-a
  • Refactor by extracting shared types or utilities into a third module that neither imports from the other two.

Stale Dependency Warnings

The graph flags the following conditions:

WarningMeaningAction
Pinned to old versionArtifact pinned to module@2, but module@5 is active.Update the import to latest or re-pin deliberately.
Deprecated artifactA workflow uses an artifact flagged as deprecated.Replace with the recommended successor.
Pack update availableAn installed pack has a newer version.Review changelog and update via SDK → Packs.
Unused moduleModule has no dependents for 30+ days.Candidate for archival.
Broken referenceArtifact imports a module that no longer exists.Fix import or restore the module from version history.

Graph API

The graph is built per-artifact rather than fetched as a single blob — the UI walks the tree by calling these endpoints for each node:

bash
# Get dependencies (downstream) of a specific artifact — what it depends on
GET /api/flowsdk/artifacts/:id/dependencies

# Get dependents (upstream) of a specific artifact — what depends on it
GET /api/flowsdk/artifacts/:id/dependents
Bookmark the dependency graph page and check it before any significant module change. The graph is also embedded inline on every artifact and module detail page — you don't need to navigate away to see local dependencies.