Bring your own workflow

You can reuse the modules, backend, runner and governance from an existing pipeline, including one currently running on GitHub Actions. Adapt the execution logic into an Argo WorkflowTemplate and connect it through the IaCStack execution contract.

What you can change and what you must keep

You ownThe integration needs
Module, inputs, images, and stages. HTML reports, OPA, and approval forms are optional.A registered Argo WorkflowTemplate selected by the stack. GitHub Actions YAML does not run directly.
Identity, target, backend, and state lock.A consistent target binding and a single state writer. The pipeline and backend are responsible for those.
When to review plans, remediate drift, or block apply.Intent and results in the execution contract format. If the alias requires authorization, request and claim it before apply. Human approval is separate.

Want to see a change before migrating? Add a real step in Kind. For adopting existing state, follow the sequence below.

Connect an existing pipeline

  1. Identify where the old pipeline resolves source and target, plans, reviews and applies.
  2. Package the runner dependencies and the versioned iacstack CLI. Alternatively, implement the transport defined in the execution contract.
  3. Give the workflow a ServiceAccount for its target and state. Register its alias, template and contract settings in the controller. Select it with spec.workflowRef.name.
  4. Check target identity, backend binding, locking and state ownership. Disable writes from the old pipeline during the handoff.
  5. Run the first plan in a controlled environment. An adoption with identical configuration should report NoChanges and preserve resource identities. Exercise a controlled input change before regular use.

Existing pipeline before and after adoption

Execution contract and CLI · Operations

Translate the pipeline, not its state

Existing CI/CD conceptArgo / IaC Stack equivalent
Trigger, manual dispatch, pipeline inputsIaCStack declaration, reconciliation and intent
Jobs and dependenciesWorkflowTemplate steps or DAG
Runner image and toolsPer-template script.image or container.image
Environment credentialsWorkflow ServiceAccount, workload identity and secret references
Job outputs / uploaded planArgo parameters for small signals; protected artifacts for the saved plan
Manual approval or policyArgo suspend and policy steps; controller authorization is separate
Pipeline resultCLI publishes a functional execution-result

For example, migrate a GitHub Actions plan/apply job by extracting its shell logic to scripts in your runner or repository. Replace checkout/ref inputs with the validated intent and immutable revision. Preserve the backend configuration, provider lock file and tool versions. Use Argo artifacts or an appropriately scoped PVC to transport a saved plan and the required execution context between Pods. A fresh Pod does not inherit another Pod’s files or environment.

Wire the contract

  • Read INTENT and WORKFLOW; validate the requested source, operation, target and existing binding.
  • Resolve the immutable revision and backend/target binding, then publish resolved-source.
  • Run plan with detailed exit codes (0 = no change, 2 = change, 1 = error). A no-change apply reports NoChanges without mutating. Destroy must be verified and report Verified, even if the target is already absent.
  • For an authorization-enabled integration, run policy/approval, publish the request from a completed step, verify the reviewed plan and binding in the mutation step, then claim before applying.
  • Apply the saved plan and verify the outcome before reporting Verified. A functional rejection reports Blocked; a deliberate cancellation without mutation reports Cancelled. Operational errors fail the Argo step. Do not turn a failed apply into a successful result.
  • Map the output files to global Argo parameters and register the same names in Helm values.

See the CLI reference for concrete commands and the workflow lab for a complete registration example. For a split-stage implementation with artifacts, policy and approval, inspect the governed test fixture and the OPA governance tutorial. Test fixtures include development-only images and storage configuration; they are not production-ready drop-in manifests.

Cut over safely

  1. Test the adapted workflow with an isolated backend and least-privilege identity. Exercise no-change, change, rejection, failure, and destroy against disposable resources.
  2. Inventory the real state and backend key, credentials, Terraform/OpenTofu and provider versions. Back up state and record resource identities.
  3. Stop all old pipeline writers for that state and retain backend locking. Confirm that no other IaCStack manages the same state.
  4. Perform a controlled plan-only review or an approval-gated plan with no mutation permitted. Verify the binding, revision and expected diff. A nonempty plan needs investigation, not automatic application.
  5. Enable reconciliation only after the handoff is accepted; monitor status and logs. To roll back, stop new attempts and drain active executions before restoring the old writer. Do not run both systems concurrently against the same state.

Follow the GitHub Actions migration walkthrough and workspace transport guide. For a complete release-based WorkflowTemplate, see Build a pipeline from scratch.