> For the complete documentation index, see [llms.txt](https://documentation.ocsinventory-ng.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.ocsinventory-ng.org/user-docs/deployment.md).

# Deployment

OCS Inventory provides a simple and efficient solution for managing software installations, updates, and script execution on remote machines.

The deployment feature is built around four key components.

## Actions

Actions define what the deployment will achieve. For example:

* Executing a script is an action.
* Storing a file on the agent's filesystem is also an action.

Actions within a package can be **ordered**, giving you control over the sequence in which they are executed. This enables you to customize the package execution process to suit your specific requirements, ensuring that dependent actions are performed in the correct order.

## Packages

A package consists of one or more **Actions**, along with metadata that describes its purpose, the targeted operating systems, and other relevant details.

## **Assignments**

Assignments link a package to a specific asset or group for deployment. Assigning a package marks it for deployment on the selected target.

## Results

Results are generated for each assignment of a package.\
They record the **status** of the package, reported by the agent after execution, along with any **comments** that include the latest error linked to that deployment.

***

## Deployment workflow

```mermaid
sequenceDiagram
    autonumber

    participant Backend API
    participant Agent 3.X

    Agent 3.X->>Backend API: Sends inventory

    Backend API->>Agent 3.X: Response with package notification

    Agent 3.X->>Backend API: Requests package download
    Backend API-->>Agent 3.X: Provides package for download

    Note over Agent 3.X: Extracts package and executes actions

    Agent 3.X->>Backend API: Sends deployment result
```

OCS agents communicate their inventory with the OCS server on a regular basis. If an asset is assigned a package for deployment, the following workflow takes place:

1. **Notification**:

   During its next inventory communication, the server notifies the agent that a package is available for deployment.
2. **Package download**:

   The agent downloads the package onto the device.
3. **Package execution**:

   The package is extracted, and the actions defined within it are executed on the system.
4. **Result reporting**:

   After the deployment, the agent sends a result back to the server. This result indicates whether the actions were successfully executed or if any issues occurred.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://documentation.ocsinventory-ng.org/user-docs/deployment.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
