Skip to content

Choose your workflow

Netherframe supports two execution workflows over the same Python construct model: hybrid execution (the default for all new projects) and legacy compatibility (for existing Terraform or OpenTofu pipelines).

This page explains how the two workflows differ, how CLI selectors route commands between them, and why state boundaries remain explicit.


Hybrid execution (default)

In hybrid execution, Netherframe launches Terraform provider binaries directly over gRPC, walks the whole-app dependency graph, manages state in a local or remote backend, and runs checks, deferred provider rounds, and recovery strategies itself. Neither Terraform nor OpenTofu is required.

Register apps under [tool.nf].apps in pyproject.toml (the older hybrid_apps key remains supported as an alias):

[tool.nf]
apps = ["infra:app"]

Use nf plan --app <selector> and nf apply --app <selector> to operate across every stack in the app. Use hybrid execution when you are:

  • Starting a new Netherframe project
  • Migrating execution off Terraform/OpenTofu onto nf
  • Using hybrid-native features: ROLLBACK, LifecycleRules(retain=...), app.check finalizers, @hybrid_runtime, deferred provider rounds, or PostgreSQL graph state

See Hybrid Execution Semantics for exact guarantees and fail-closed boundaries.


Legacy compatibility (nf synth)

In legacy compatibility mode, nf synth exports Terraform JSON under .nf.out/<app>/<stack>/ and hands execution and state ownership to an external Terraform or OpenTofu binary.

Register synthesis apps under [tool.nf].terraform_apps (or its alias legacy_apps):

[tool.nf]
terraform_apps = ["legacy_infra:app"]

Use legacy compatibility when:

  • An existing CI/CD platform consumes Terraform JSON directly
  • A stack relies on Terraform-only behaviors that hybrid mode rejects by design (such as provisioner / connection blocks, create_before_destroy, or external CLI workflows)

See Synthesis and output layout.


How command selectors route execution

The CLI decides which engine runs based on what you pass, not solely on which list in pyproject.toml holds the app:

Command Engine selected Scope
nf plan --app app Hybrid (direct) Every stack in the configured app app
nf plan --app app --stack network Hybrid (direct) The network stack inside app app
nf synth Synthesis export Writes Terraform JSON for terraform_apps / legacy_apps
nf plan --stack .nf.out/platform/network External Terraform/OpenTofu Explicit synthesized directory (omit --app)

Passing raw Terraform/OpenTofu passthrough arguments or --legacy-bin requires the explicit synthesized --stack directory path; hybrid --app commands reject them so you never accidentally cross engines.


State boundaries stay explicit

Hybrid execution and external Terraform/OpenTofu do not silently share state ownership. Moving an existing resource from an external Terraform state into Netherframe hybrid state is always an explicit, reviewed adoption operation.

A single repository can register both apps and terraform_apps side by side while migrating gradually. Give each app its own state backend and a single active writer.