Skip to content

Manage Cloud applications

Info

Learn the concepts and fundamentals of applications in the Explanation page.

A Nextmv application is an entity that contains a decision model as executable code.

This how-to guide explains how to interact with applications using the Application class. Go the reference section to see all the available parameters for each method.

Create an app

Use the Application.new method to create a new application.

import os

import nextmv
from nextmv import cloud

client = cloud.Client(api_key=os.getenv("NEXTMV_API_KEY"))
app = cloud.Application.new(client=client)

nextmv.write(app.to_dict())
uv run main.py
{
  "id": "app-w1mzyb4t",
  "name": "app-w1mzyb4t",
  "description": "",
  "type": "custom",
  "default_instance": "",
  "default_experiment_instance": "",
  "subscription_id": "",
  "locked": false,
  "created_at": "2026-07-22T20:58:07.769903Z",
  "updated_at": "2026-07-22T20:58:07.769903Z"
}

The call above will create a random ID, and use the same identifier for the app's name. The name of the application is used as a human-readable label. You can use the id and/or name keyword arguments to specify a custom ID and name for the application. For example:

import os

import nextmv
from nextmv import cloud

client = cloud.Client(api_key=os.getenv("NEXTMV_API_KEY"))
app = cloud.Application.new(
    client=client,
    id="quirky-rabbit",
    name="A quirky rabbit",
)

nextmv.write(app.to_dict())
uv run main.py
{
  "id": "quirky-rabbit",
  "name": "A quirky rabbit",
  "description": "",
  "type": "custom",
  "default_instance": "",
  "default_experiment_instance": "",
  "subscription_id": "",
  "locked": false,
  "created_at": "2026-07-22T20:58:31.429643Z",
  "updated_at": "2026-07-22T20:58:31.429643Z"
}

When working with Nextpipe and decision worklows, you must specify that an application is of type "workflow" at the time of creation. Use the is_workflow keyword argument to create a workflow application:

import os

import nextmv
from nextmv import cloud

client = cloud.Client(api_key=os.getenv("NEXTMV_API_KEY"))
app = cloud.Application.new(
    client=client,
    id="quirky-rabbit-workflow",
    is_workflow=True,
)

nextmv.write(app.to_dict())
uv run main.py
{
  "id": "quirky-rabbit-workflow",
  "name": "quirky-rabbit-workflow",
  "description": "",
  "type": "pipeline",
  "default_instance": "",
  "default_experiment_instance": "",
  "subscription_id": "",
  "locked": false,
  "created_at": "2026-07-22T20:59:40.777020Z",
  "updated_at": "2026-07-22T20:59:40.777020Z"
}

In automated workflows, you don't have to check if an application exists before creating it. Use the exist_ok keyword argument to avoid an error if the application already exists:

import os

import nextmv
from nextmv import cloud

client = cloud.Client(api_key=os.getenv("NEXTMV_API_KEY"))
app = cloud.Application.new(
    client=client,
    id="quirky-rabbit",
    exist_ok=True,
)

nextmv.write(app.to_dict())
uv run main.py
{
  "id": "quirky-rabbit",
  "name": "A quirky rabbit",
  "description": "",
  "type": "custom",
  "default_instance": "",
  "default_experiment_instance": "",
  "subscription_id": "",
  "locked": false,
  "created_at": "2026-07-22T20:58:31.429643Z",
  "updated_at": "2026-07-22T20:58:31.429643Z"
}

Get an app

Use the Application.get method to retrieve an existing application by its ID.

import os

import nextmv
from nextmv import cloud

client = cloud.Client(api_key=os.getenv("NEXTMV_API_KEY"))
app = cloud.Application.get(client=client, id="quirky-rabbit")

nextmv.write(app.to_dict())
uv run main.py
{
  "id": "quirky-rabbit",
  "name": "A quirky rabbit",
  "description": "",
  "type": "custom",
  "default_instance": "",
  "default_experiment_instance": "",
  "subscription_id": "",
  "locked": false,
  "created_at": "2026-07-22T20:58:31.429643Z",
  "updated_at": "2026-07-22T20:58:31.429643Z"
}

You can list all applications in the account using the list_applications function. The same information is displayed as for the individual applications, but as a list of objects.

import json
import os

from nextmv import cloud
from nextmv.cloud import list_applications

client = cloud.Client(api_key=os.getenv("NEXTMV_API_KEY"))
apps = list_applications(client=client)

print(json.dumps([app.to_dict() for app in apps], indent=2))
uv run main.py
[
  {
    "id": "quirky-rabbit-workflow",
    "name": "quirky-rabbit-workflow",
    "description": "",
    "type": "pipeline",
    "default_instance": "",
    "default_experiment_instance": "",
    "subscription_id": "",
    "locked": false,
    "created_at": "2026-07-22T20:59:40.777020Z",
    "updated_at": "2026-07-22T20:59:40.777020Z"
  },
  ...
  {
    "id": "quirky-rabbit",
    "name": "A quirky rabbit",
    "description": "",
    "type": "custom",
    "default_instance": "",
    "default_experiment_instance": "",
    "subscription_id": "",
    "locked": false,
    "created_at": "2026-07-22T20:58:31.429643Z",
    "updated_at": "2026-07-22T20:58:31.429643Z"
  }
]

For automated workflows, you can check if an application exists with the Application.exists method. The method returns True if the application exists, and False if it does not.

import os

import nextmv
from nextmv import cloud

client = cloud.Client(api_key=os.getenv("NEXTMV_API_KEY"))
exists = cloud.Application.exists(client=client, id="quirky-rabbit")

nextmv.write({"exists": exists})
uv run main.py
{
  "exists": true
}

Update an app

You can update different attributes of an application using the Application.update method, such as its:

  • Name
  • Description
  • Default instance ID
  • Default experiment instance ID

Please note that you cannot update the type of an application or its ID after it has been created.

import os

import nextmv
from nextmv import cloud

client = cloud.Client(api_key=os.getenv("NEXTMV_API_KEY"))
app = cloud.Application.get(client=client, id="quirky-rabbit")
app = app.update(description="This application inspects the quirks of rabbits")

nextmv.write(app.to_dict())
uv run main.py
{
  "id": "quirky-rabbit",
  "name": "A quirky rabbit",
  "description": "This application inspects the quirks of rabbits",
  "type": "custom",
  "default_instance": "",
  "default_experiment_instance": "",
  "subscription_id": "",
  "locked": false,
  "created_at": "2026-07-22T20:58:31.429643Z",
  "updated_at": "2026-07-22T21:14:19.399410Z"
}

Delete an app

Warning

Deleting an application is irreversible. All the app's data, such as its runs, instances, and experiments, will be permanently deleted.

Delete an application using the Application.delete method.

import os

from nextmv import cloud

client = cloud.Client(api_key=os.getenv("NEXTMV_API_KEY"))
app = cloud.Application.get(client=client, id="quirky-rabbit")
app.delete()
uv run main.py