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

# Version history

> Track workflow changes and roll back if needed

Neo Agent automatically tracks changes to your workflows, providing a comprehensive version history. This feature is crucial for:

* Auditing changes for compliance and troubleshooting
* Safely rolling back to a previous, stable version if an update causes unexpected behavior
* Facilitating team collaboration by providing transparency on who changed what and when

## Accessing version history

You can access the version history for any workflow directly from the main Workflows page:

<Steps>
  <Step title="Navigate to Workflows">
    Navigate to the **Workflows** section in Neo Agent.
  </Step>

  <Step title="Locate your workflow">
    Locate the workflow you want to inspect.
  </Step>

  <Step title="Open the menu">
    Click on the three-dots menu (kebab menu) on the right side of the workflow row.
  </Step>

  <Step title="Select Version History">
    Select **"Version History"** from the dropdown menu.
  </Step>
</Steps>

<Frame caption="Accessing workflow version history from the workflows page">
  <img src="https://mintcdn.com/neoagent/G1PkeWrWjzTWVbma/images/managing-workflows/version-history-1.png?fit=max&auto=format&n=G1PkeWrWjzTWVbma&q=85&s=78640e73da33182b47fb7f97f05f287b" alt="Accessing workflow version history" width="3416" height="1804" data-path="images/managing-workflows/version-history-1.png" />
</Frame>

This will open a dialog displaying all saved versions of the workflow.

## Understanding the version history dialog

The Version History dialog lists all versions of the selected workflow, with the most recent version at the top. For each version, you can see:

<ParamField path="version" type="string">
  An identifier for the version (e.g., v8, v2, v1)
</ParamField>

<ParamField path="saved_at" type="timestamp">
  The timestamp when this version was saved. The timezone displayed is your local timezone.
</ParamField>

<ParamField path="saved_by" type="string">
  The user who made the changes and saved this version
</ParamField>

<ParamField path="actions" type="object">
  Available actions for each version:

  * **Preview (eye icon):** Opens this version of the workflow in a read-only mode. This is useful for comparing different versions or understanding the configuration of an older version without making it active.
  * **Apply (up arrow icon):** Loads this version into the workflow editor. You must click "Save Changes" in the editor to make this version the current, live version of the workflow.
</ParamField>

<Frame caption="Workflow version history dialog showing available versions and actions">
  <img src="https://mintcdn.com/neoagent/G1PkeWrWjzTWVbma/images/managing-workflows/version-history-2.png?fit=max&auto=format&n=G1PkeWrWjzTWVbma&q=85&s=9a0c1f6bcb434ac0232852eb66613b24" alt="Workflow version history dialog" width="3414" height="1810" data-path="images/managing-workflows/version-history-2.png" />
</Frame>

## How versioning works

Neo Agent's versioning mechanism is designed to capture a snapshot of your workflow whenever it's modified.

### Automatic version creation

Every time a workflow is updated and saved, a new version is automatically logged in the `workflows_updates_log` table in the database.

### Data logged

Each entry in the log includes:

* The `workflow_id` to link it to the specific workflow
* A complete snapshot of the workflow's configuration at that point in time, including its `name`, `state`, `trigger_type`, `schedule`, `actions`, and other settings
* The `client_id` and `client_name` for organizational context
* Information about the `created_by_user` (who made the update)
* The `version_timestamp`, indicating precisely when this version was created

### Retrieval

When you open the "Version History" dialog, Neo Agent queries this log table, filtering by the current `workflow_id`, `environment`, and `client_id`, and orders the results by `version_timestamp` in descending order to show the newest versions first.

## Key benefits

<CardGroup cols={2}>
  <Card title="Audit trail" icon="file-text">
    Maintain a clear record of all modifications, essential for change management and compliance.
  </Card>

  <Card title="Rollback capability" icon="rotate-left">
    If a new workflow configuration introduces issues, you can easily revert to a previously known good state by previewing an older version and then applying it.
  </Card>

  <Card title="Experimentation" icon="flask">
    Feel more confident experimenting with workflow changes, knowing you can always go back.
  </Card>

  <Card title="Collaboration" icon="users">
    Understand the evolution of a workflow, especially when multiple team members are involved in its development and maintenance.
  </Card>
</CardGroup>

## Best practices

<AccordionGroup>
  <Accordion title="Regular review">
    Regularly review version history, especially after making significant changes, to ensure automations are behaving as expected.
  </Accordion>

  <Accordion title="Use for troubleshooting">
    If you encounter an issue, the version history is your first stop for diagnosis and potential rollback.
  </Accordion>

  <Accordion title="Document changes">
    When making significant changes, consider adding comments or notes about what was changed and why.
  </Accordion>

  <Accordion title="Test before applying">
    Always use the preview function to review older versions before applying them to understand the differences.
  </Accordion>
</AccordionGroup>

<Tip>
  Regularly review version history, especially after making significant changes, to ensure automations are behaving as expected. If you encounter an issue, the version history is your first stop for diagnosis and potential rollback.
</Tip>
