Package Dependencies & Detection

A deployment package can declare the packages it needs. Deploy PyCharm Community and Athena installs Python 3.14 first, but only on machines that don't already have it. This page covers the package version label, detection rules that tell Athena whether a package is already installed, the Depends on list, the Deploy package step type, Force reinstall, and the per-agent package tree you see in deployment results. For step basics, start with Deployment Package Steps.

One deployment, one bundle

When you deploy a package that has dependencies, Athena combines the whole tree into a single ordered list of steps and sends it to each agent as one deployment. The agent runs those steps in order, the same way it runs any package. Nothing extra crosses the network, so dependencies work the same way on air-gapped networks. A package with no dependencies and no detection rule deploys exactly as it did before.

Where to set it up#

Open Deployments and click View All Packages (/deployments/packages), then create or edit a package. The editor has a Version, detection and dependencies section with these fields:

Editor fieldWhat it does
VersionAn optional label, such as 3.14.0. When another package pins this one to a version, the two must match.
Detection ruleHow this package proves it is already installed (see Detection rules).
Depends onPackages deployed first, in list order, before this package's own steps. This applies to every way the package is deployed. Pick a package from Select a package… and click Add dependency.
Used byRead-only. Lists the packages that use this one, either as a dependency (depends on it) or through a Deploy package step. Shows Not used by other packages. when nothing does.

Detection rules#

A detection rule is a check that runs on the endpoint. If the check passes, Athena treats the package as already installed. Detection rules run in PowerShell on Windows agents. The editor offers these types:

Detection rule (editor)REST detectionTypeInstalled when…Fields
None0No rule. The package always runs.—
Registry key exists1The registry key exists.Registry key (detectionPath), e.g. HKLM\SOFTWARE\Python\PythonCore\3.14\InstallPath
Registry value exists2A named value exists under the key.Registry key + Value name (detectionValueName)
File exists3A file matching the path exists.File path, e.g. %ProgramFiles%\JetBrains\PyCharm Community*\bin\pycharm64.exe
File version is at least4The first matching file's file version is at least the minimum.File path + Minimum file version (detectionMinVersion), e.g. 3.14.0.0
Detection script5The PowerShell script exits with code 0. Any other exit code means the package is missing.PowerShell detection script (detectionScript), up to 8,000 characters

Detection runs once per package per deployment#

Athena checks detection once, just before the package's first step, and remembers the answer for that package's remaining steps in the same deployment. This matters for multi-step installers. If step 1 installs the software, step 2 still runs, because the decision was made before step 1. A step's own condition script, if it has one, is still checked as well; the step runs only when both allow it.

Re-deploying an installed package#

A package's detection rule also applies when you deploy that package itself. If the rule says it is already installed on a machine, its steps are skipped there and the result reads Skipped: already installed. That way a rollout doesn't re-run a silent installer over an existing install, which can hang until the step times out. A package with no detection rule always runs.

To run the steps anyway, tick Force reinstall (run even if already installed) when you deploy. The option is on the package's deploy page and in the deploy dialog on the Deployments page. Force reinstall applies only to the package you are deploying. Its dependencies still follow their own Run setting. The choice is saved with the deployment, so a scheduled deployment honours it when it starts.

WhereHow to force a reinstall
ConsoleTick Force reinstall (run even if already installed) in the deploy form.
REST"forceReinstall": true in the body of POST api/deployment-packages/{id}/deploy.
PowerShellStart-AthenaDeploymentPackageDeployment -ForceReinstall

Depends on#

Each entry in Depends on is deployed before the package's own steps, in list order. Each entry has three settings:

SettingREST fieldDefaultMeaning
VersionpinnedVersionLatest (empty)Leave empty to use the package as it is now. Enter a version to require that exact Version label (case-insensitive). If the child's label has changed, the deployment fails with a message naming both versions.
RunrunConditionOnly if missing (0)Only if missing runs the child only when its detection rule says it isn't installed. Always (1) runs it every time.
Continue on failurecontinueOnFailureOffOff: if the child fails, the parent stops. On: the parent carries on with its next steps.
"Only if missing" needs a detection rule

If a child is set to Only if missing but has no detection rule, it always runs. The editor shows a warning such as Python 3.14 has no detection rule, so it will always run., and the dry-run plan lists the same warning. Give the child a detection rule to make the setting take effect.

A pin is a safety check, not a rollback. Athena keeps only the current contents of each package, so pinning 3.14.0 stops a deployment if the child has since been relabelled. It can't deploy an older copy.

The Deploy package step#

To run another package in the middle of a package's steps, add a step of type Deploy Package (REST stepType 13). At that position, the chosen package's steps run in place of the step, then the next step continues. For example, install the tool → deploy the plugin package → configure the tool. The step editor shows Package to deploy *, Version (Latest or a pinned label) and Run (Only if missing / Always). The step's Continue on Error checkbox works like Continue on failure.

Use Depends on for prerequisites that must be in place first. Use a Deploy package step when the child belongs at a specific point in the sequence.

How the tree is combined#

SituationWhat happens
The same package appears twice in one treeIt runs once, at its first position. Later references reuse that result, and the results tree shows runs once - result shown above. If any reference requires stop-on-failure, the single copy stops on failure (the strictest setting wins).
Continue on failure on a childAlso applies to that child's own dependencies and Deploy package steps.
A child contains a Reboot stepThe child's reboot moves to the end of the whole deployment, and multiple child reboots are combined into one. The parent's remaining steps run first, then the machine restarts once. Athena can't resume a deployment after a reboot, so a child that needs a restart before the parent's next step isn't supported. Exit code 3010 counts as success only if the child's step lists it in its success exit codes.
FilesFiles from every package in the tree are delivered into one folder on the endpoint. Identical files are shared. Two different files with the same name are rejected, and the message names both packages. Rename one of them.
Run-as credentialsEach child step keeps its own run-as identity. The deploying user still needs permission to use credentials, as for any credentialed step.

Save-time checks#

Athena checks the tree when you save the package and again when you deploy it, because a package edited later can break a tree that was valid when it was saved. A failed check refuses the save or deployment with a message:

ProblemExample message
LoopDependency loop: PyCharm Community -> Python 3.14 -> PyCharm Community. (dependencies and Deploy package steps are checked together)
Too deepA tree may go at most 5 levels below the package being deployed.
Same package listed twiceA package is listed more than once under Depends on.
Pinned version mismatch'PyCharm Community' is pinned to 'Python 3.14' version 3.14.0, but 'Python 3.14' is now version 3.14.1.
File-name clash'A' and 'B' both contain a different file named 'setup.exe'. Rename one of them - every package in a tree is delivered into one folder.

Over REST, these are HTTP 400 responses with the message in the standard response envelope.

Permissions#

Deleting a package that others use#

You can't delete a package while another package uses it as a dependency or through a Deploy package step. In the console, a toast names the dependents. Over REST, DELETE api/deployment-packages/{id} returns HTTP 409 with a message like 'Python 3.14' cannot be deleted: it is used by 'PyCharm Community'. Remove it from those packages first., and the dependents are listed in data.

Agent requirements#

Some agents can't run a package tree or detection rule. Athena refuses those agents when the deployment starts, and their result shows the reason. Other targets in the same deployment continue as normal.

AgentBehaviour
Windows agent 1.1.0 or laterFully supported.
Agents older than 1.1.0Refused: cannot receive a package with dependencies or a detection rule (needs 1.1.0 or later). Update the agent first.
Linux agentsDetection rules run in PowerShell, which Linux agents don't use for step conditions. Trees with no detection checks deploy to Linux normally. If the package being deployed has a detection rule, deploy it with Force reinstall. If a child is set to Only if missing and has a detection rule, set that child to Always.

Reading results: the package tree#

For a deployment that uses dependencies or detection, Active Deployments and Deployment History show a Package tree. The tree shows the deployed package with its children nested in run order. Each node shows a status per agent, and Show logs expands the step output for that node.

Node statusMeaning
InstalledAll of the package's steps ran and none failed.
Skipped: already installedIts detection rule found it installed, so none of its steps ran.
SkippedIts steps were passed over by their own conditions.
FailedOne of its steps failed or was cancelled.
Not runThe agent stopped before reaching it, usually because an earlier step failed.
Running / PendingStill in progress, or not started yet.

Agents don't send a separate report for a step they skip. Athena works out which steps were skipped from the order of the steps that were reported. In step results, a skipped step shows Condition not met: already installed (detection said installed) or Condition not met (its own condition was false). A step the agent never reached shows Not run: an earlier step failed. Over REST, GET api/deployment-packages/executions/{executionId} returns the same tree as resultTree, with nested children and per-agent agentResults.

REST API#

EndpointPurposePermission
POST / PUT api/deployment-packages[/{id}]Create or update a package. The body also accepts version, the detection* fields, dependencies[], and on steps targetPackageId, pinnedVersion and runCondition.packages.manage
GET api/deployment-packages/{id}Returns the package with its dependencies and usedBy.packages.view
GET api/deployment-packages/{id}/planDry run. Returns the combined plan (nodes, steps and warnings) without sending anything. Add ?forceReinstall=true to plan a forced reinstall. An invalid tree returns 400 with the reason.packages.view
GET api/deployment-packages/{id}/used-byPackages that use this one. via is Dependency or Step.packages.view
DELETE api/deployment-packages/{id}Returns 409 while other packages use it.packages.manage
POST api/deployment-packages/{id}/deployDeploy. Accepts forceReinstall.packages.execute

Enumerations are sent as numbers. A minimal update body that adds Python as a dependency, run only if missing:

{
  "name": "PyCharm Community",
  "folderName": "pycharm",
  "detectionType": 3,
  "detectionPath": "%ProgramFiles%\\JetBrains\\PyCharm Community*\\bin\\pycharm64.exe",
  "dependencies": [
    { "dependsOnPackageId": "<python-package-id>", "pinnedVersion": null, "runCondition": 0, "continueOnFailure": false }
  ],
  "steps": [ /* the package's steps - an update replaces the whole list */ ]
}

PowerShell#

The Athena PowerShell module supports dependencies from version 2.13.0:

Cmdlet / parameterPurpose
New-AthenaDeploymentPackageDependency -PackageId [-PinnedVersion] [-RunCondition OnlyIfMissing|Always] [-ContinueOnFailure]Builds a Depends on entry locally, without calling the server. Pass it to -Dependency.
New- / Set-AthenaDeploymentPackage -Version -DetectionType -DetectionPath -DetectionValueName -DetectionMinVersion -DetectionScript -DependencySet the version, detection rule and dependencies. -DetectionType is None, RegistryKey, RegistryValue, FileExists, FileVersion or Script. Set- keeps every field you don't pass. -Dependency @() clears the list.
New-AthenaDeploymentPackageStep -StepType DeployPackage -TargetPackageId [-PinnedVersion] [-RunCondition]A Deploy package step. These three parameters are refused on other step types.
Get-AthenaDeploymentPackagePlan -Id [-ForceReinstall]The dry-run plan. An invalid tree is reported as an error with the server's reason.
Get-AthenaDeploymentPackageUsedBy -IdPackages that use this one.
Remove-AthenaDeploymentPackage -Id [-Force]Delete a package (supports -WhatIf). A package in use is refused, and the error names every dependent.
Start-AthenaDeploymentPackageDeployment -ForceReinstallDeploy even if the package's detection rule says it is installed.
# Python 3.14: detected by its registry key
$pyStep = New-AthenaDeploymentPackageStep -Name "Install Python" -StepType InstallApplication `
    -FileName python-3.14.0-amd64.exe -Arguments '/quiet InstallAllUsers=1 PrependPath=1' -SuccessExitCodes '0,3010'
$python = New-AthenaDeploymentPackage -Name "Python 3.14" -FolderName python-3.14 -Version 3.14.0 `
    -DetectionType RegistryKey -DetectionPath 'HKLM\SOFTWARE\Python\PythonCore\3.14\InstallPath' -Steps $pyStep

# PyCharm: depends on Python (installed first, only if missing)
$pcStep = New-AthenaDeploymentPackageStep -Name "Install PyCharm" -StepType InstallApplication `
    -FileName pycharm-community.exe -Arguments '/S'
$pycharm = New-AthenaDeploymentPackage -Name "PyCharm Community" -FolderName pycharm `
    -DetectionType FileExists -DetectionPath '%ProgramFiles%\JetBrains\PyCharm Community*\bin\pycharm64.exe' `
    -Steps $pcStep -Dependency (New-AthenaDeploymentPackageDependency -PackageId $python.Id)

# Preview what one deployment would run, and check for warnings
$plan = Get-AthenaDeploymentPackagePlan -Id $pycharm.Id
$plan.Nodes | Format-Table Key, ParentKey, PackageName, Version, Via, Gated
$plan.Warnings

Upload each package's installer file before deploying, as described in Files and rebuilding.