> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nuon.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Workflows

> Workflows are scheduled and manual lifecycles of deploying, updating or tearing down apps, components, and actions.

## What is a Workflow?

A workflow represents the complete lifecycle of deploying, updating or tearing down an app and its components. Workflows also manage the execution of actions.

<Note>
  If new to Nuon, familiarize yourself with the [app and install life cycle](../guides/app-install-life-cycle) first.
</Note>

<img src="https://mintcdn.com/nuoninc/uqLvX02qjwFRtj50/images/concepts/workflows/workflows-list.png?fit=max&auto=format&n=uqLvX02qjwFRtj50&q=85&s=bf555eb00d2da4c7f506ce54567e844b" alt="Workflows List" width="1092" height="944" data-path="images/concepts/workflows/workflows-list.png" />

## Workflow Types

### Install

An install workflow covers all of the steps required to install an app from scratch. This includes creating the install stack, creating the virtual machine and starting the Nuon runner, provisioning the sandbox, syncing secrets, deploying the components of the app with Terraform, Helm or Kubernetes manifests e.g., databases, applications, certificates, application load balancers, and executing actions which are bash scripts to perform additional configurations like initializing a database or performing a health check.

<img src="https://mintcdn.com/nuoninc/uqLvX02qjwFRtj50/images/concepts/workflows/install-workflow.png?fit=max&auto=format&n=uqLvX02qjwFRtj50&q=85&s=8666179f5ac3722e06618b534c602b27" alt="Install Workflow" width="1136" height="810" data-path="images/concepts/workflows/install-workflow.png" />

### Component

A component workflow deploys a component. If there are dependent components, the user can instruct Nuon to deploy those components as well.

<img src="https://mintcdn.com/nuoninc/uqLvX02qjwFRtj50/images/concepts/workflows/component-workflow.png?fit=max&auto=format&n=uqLvX02qjwFRtj50&q=85&s=d883f08dbd4aebfb4aec1098cb6daec9" alt="Component Workflow" width="1002" height="708" data-path="images/concepts/workflows/component-workflow.png" />

### Action

An action workflow executes the script associated with an action. e.g., initialize a database, run a health check on a component, make a one-off configuration change.

<img src="https://mintcdn.com/nuoninc/uqLvX02qjwFRtj50/images/concepts/workflows/action-workflow.png?fit=max&auto=format&n=uqLvX02qjwFRtj50&q=85&s=1d0e5250294f680ca4a03ab1780d18f1" alt="Action Workflow" width="1002" height="708" data-path="images/concepts/workflows/action-workflow.png" />

## Workflow States

**Success (green checkmark)**: A step or install component completed successfully

**Error (red X)**: One or more steps failed

**Cancelled (yellow X)**: An install or step was cancelled by the user

**In-progress (brown circle pulsing or clockwise spinning blue circle)**: A component or action is underway

<img src="https://mintcdn.com/nuoninc/uqLvX02qjwFRtj50/images/concepts/workflows/workflow-states.png?fit=max&auto=format&n=uqLvX02qjwFRtj50&q=85&s=c1df1706178dd61d391be2546bff736b" alt="Workflow States" width="1022" height="274" data-path="images/concepts/workflows/workflow-states.png" />

## Workflow Approvals

Components using Terraform, Helm and Kubernetes manifests run a plan step which requires the user to approve or reject the step before proceeding to the apply or deploying of the sandbox and components.

<img src="https://mintcdn.com/nuoninc/uqLvX02qjwFRtj50/images/concepts/workflows/approval-sandbox.png?fit=max&auto=format&n=uqLvX02qjwFRtj50&q=85&s=d2085e5bcda094117cc3ef881a719b31" alt="Workflow Approvals" width="1091" height="1074" data-path="images/concepts/workflows/approval-sandbox.png" />

At the install-level and at the individual workflow-level, the user can opt to Approve All plan steps.

<img src="https://mintcdn.com/nuoninc/uqLvX02qjwFRtj50/images/concepts/workflows/install-approve-all.png?fit=max&auto=format&n=uqLvX02qjwFRtj50&q=85&s=b4c3d034dada08ef40e474fa8f4ac319" alt="Component Workflow" width="477" height="626" data-path="images/concepts/workflows/install-approve-all.png" />

## Workflow Diffs

If a component using Terraform, Helm or a Kubernetes manifest has been changed by the user, re-synced to an app and therefore re-built, the plan step will visually show the diff, aka the before and after proposed change, and require the user to approve or reject/deny the change. Learn more about [Understanding diffs](../updates/012-approval-diffs-plan-only).

<img src="https://mintcdn.com/nuoninc/uqLvX02qjwFRtj50/images/concepts/workflows/approval-step-helm.png?fit=max&auto=format&n=uqLvX02qjwFRtj50&q=85&s=8658b5272562e1404797d181d30b3d77" alt="Workflow Diffs" width="1238" height="864" data-path="images/concepts/workflows/approval-step-helm.png" />

## Drift Detection

[Drift Detection](../updates/023-drift-workflow-improvements) allows you to automatically identify discrepancies between your defined infrastructure in Nuon and what’s actually running. You can schedule periodic drift checks or manual drift scans from the dashboard. Drilling into the relevant Workflow will show the drift.

<img src="https://mintcdn.com/nuoninc/uqLvX02qjwFRtj50/images/concepts/workflows/drift-in-workflow.png?fit=max&auto=format&n=uqLvX02qjwFRtj50&q=85&s=9581d86e7c735e703c55012993351cff" alt="Drift Detection" width="1002" height="1046" data-path="images/concepts/workflows/drift-in-workflow.png" />
