# Launch apps and run actions from a task

Launch apps from a Truetask task on your paired computers, add a studio's own Python actions, decide who runs them, and reach a studio network.

URL: https://docs.truetask.io/helper/apps-and-actions

Truetask Helper launches apps such as Maya, Nuke, Blender or Excel from a task on a paired computer, and runs a studio's own actions, written as small Python files.
Each of those is an action the computer offers: every computer offers a few of its own, and a studio adds the rest.
You start them from a task's menu, a board's **Run** button, an automation, an agent or the API.

## Launch an app from a task

On your own computer, Truetask Helper finds the apps people launch from a task, where their installers put them, one entry per installed version:
Maya, Nuke, Houdini, Blender, Photoshop, After Effects, DaVinci Resolve, Excel, Word, PowerPoint, Numbers and LibreOffice.
Each app shows with its own icon, in the Helper window and on the menus that launch it.

Right-click a task and open **Run**, or use the board's **Run** button.
Under the automations you can run on demand, each computer you may use has its own groups:

- **Apps on** the computer: one **Launch** row per app.
- **Actions on** the computer: the studio's actions that fit a task, or the board.

A computer that is offline keeps its rows, disabled, saying it is offline.
Pick a row and a toast follows the job: starting, started, or that the computer did not pick it up.
A launch nobody picks up within a minute is dropped, so an offline computer never opens an app long after you asked.

An app launched for a task starts with a clean environment: the session basics, a plain `PATH`, the studio's own variables, and these.

| Variable | Value |
| --- | --- |
| `TRUETASK_URL` | The workspace |
| `TRUETASK_TASK_ID`, `TRUETASK_TASK_KEY`, `TRUETASK_TASK_TITLE` | The task it was launched for |
| `TRUETASK_BOARD_ID`, `TRUETASK_BOARD_NAME` | That task's board |
| `TRUETASK_REQUESTED_BY` | Who asked |
| `TRUETASK_JOB_ID`, `TRUETASK_HELPER_ID` | This job and this computer |
| `PYTHONPATH` | The `truetask` Python package first, then the studio's own path |

Inside the app, `truetask.current_task()` answers which task it was launched for.
Nothing of the Helper's own environment reaches the app.

Launching apps and opening files happen only on a computer paired for **Just me**.
A shared computer never opens a window.

### Add or hide an app

In the Helper window, open the **Apps** tab.

- **Add an app** picks a program on this computer and asks what to call it.
  A running Helper offers it within seconds.
- The cross on a row takes an app off the list.
  The app stays on the disk; tasks just cannot open it on this computer.
- **Removed apps** lists what you took off, with **Put back**.

Each row shows the app's full path, and **From Truetask** or **Added here** for an app that did not come from the Helper's own search.

From a terminal: `truetask-helper apps add <program>`, `truetask-helper apps remove <id>` and `truetask-helper apps restore <id>`.

### Apps defined for every computer

A workspace admin can define an app once for all computers, such as a studio's own build of Unreal.
Open the **Truetask Helper** card in Integrations and choose **Add an app** under **Apps**; a workspace with no apps yet keeps it folded under **Storage and apps**.

| Field | What it takes |
| --- | --- |
| **Name** | What the menus show. |
| **How it opens** | **A new copy for each task**, with the task's context in its environment, or **Files open in the copy already running**, the way a double click would. |
| **macOS**, **Windows**, **Linux** | Where each system installs it. A `*` stands for the part with the version, such as `UE_*`, so one entry finds every installed version. A path can start with `{apps}` for the Applications folders, `{pf}` for Program Files or `{home}`. |

Every computer that has the app offers it within half a minute, beside the apps it finds itself.
The app's page lists the computers it was **Found on**.
Removing it stops computers offering it; the apps they find themselves stay.

## What every computer offers

A computer's page in Integrations lists **What it can do** on its **Actions** tab.

| Action | What it does | Where |
| --- | --- | --- |
| **Open a file or folder** | Opens a file or folder on that computer in its default app. | Your own computer |
| **Launch an app** | Starts an app on that computer with the task's context. | Your own computer, once it found an app |
| The studio's actions | Whatever the actions folder holds. | Any computer |

![Truetask Helper computer page on its Actions tab, with the apps it found, the storage it sees and What it can do](https://docs.truetask.io/screenshots/helper-computer-actions.webp)

Truetask also asks a computer, behind the scenes, to list folders for the folder picker, to open your own system folder dialog, to open a task in a coding tool, and to carry a call into a studio network.
None of those is in a menu.

## Write your own actions

A studio action is a small Python file in the workspace's actions folder on a computer.
Truetask Helper reads the folder again within a couple of seconds of a file changing and offers what it found to that workspace.

To open the folder, go to the Helper window's **Apps** tab, open **Storage and studio actions** and click **Open folder** next to **Studio actions**.
`truetask-helper status` names each workspace's folder, and `truetask-helper actions` lists what it found and why a file was skipped.

```python
import truetask

@truetask.action(name="Export the report", applies_to="task")
def export_report(run):
    """Writes the task's report to the shared drive."""
    task = run.client.task(run.task["id"])
    run.progress(0.5, "Writing the PDF")
    path = write_pdf(task)
    run.client.comment(task["id"], "The report is at " + path)
    return {"path": path}
```

The `truetask` package needs nothing outside Python's standard library and runs on Python 3.7 and later, so it works in the Python a DCC ships, such as mayapy, Nuke's or hython.
Every Helper carries its own copy and puts it on the path of the actions it runs, so nothing needs installing.

A file whose name starts with `_` is a module the actions share, never read for actions on its own.
Keep the top of a file light and import a DCC's modules inside the function: the Helper reads the folder with its default Python.

### What `@truetask.action` takes

| Option | What it does |
| --- | --- |
| `name` | What menus show. The function's name in words by default. |
| `description` | One sentence. The docstring's first line by default. |
| `inputs` | What the action asks for (below). |
| `outputs` | The keys of the dict it returns, or dicts with `key` and `label`. An automation's later steps are offered them. |
| `applies_to` | `"task"`: offered in a task's menus. `"board"`: on the board's **Run** button. `"any"`, the default: both. |
| `interactive` | `True` when it opens a window. A shared computer never offers it. |
| `interpreter` | The name of one of the Helper's interpreters, such as `"maya"`. The default Python when empty. |
| `folder` | `True` when the action works in a folder (below). |

The action's id is the function's name, unique in the folder.

### Inputs

Each input is a key, or a dict:

```python
inputs=[
    {"key": "format", "type": "choice", "options": ["mov", "mp4"], "default": "mov"},
    {"key": "frames", "label": "Frame range", "type": "text", "required": True},
]
```

Types are `text`, `number`, `boolean`, `path` and `choice`.
A `path` input takes a full path, or a stored path on a storage root such as `projects:shows/alpha/sh010.nk`, which the action receives as this computer finds it.
See [Working folders and storage](https://docs.truetask.io/helper/folders#storage-roots).

Menus offer only actions that need nothing.
An action with a required input runs from automations, agents and the API.

### The run

The function gets a `run`.

| Attribute | What it is |
| --- | --- |
| `run.inputs` | The job's inputs, with defaults filled in |
| `run.task` | The task it runs for (`id`, `key`, `title`, `board_id`, `board_name`), or `None` |
| `run.board` | The board: the task's, or the one it was asked from |
| `run.requested_by` | Who asked |
| `run.progress(fraction, message)` | How far along it is, from 0 to 1, and what it is doing |
| `run.log(message)` | A line for the Helper's log |
| `run.client` | The API as the person who asked |
| `run.roots` | The storage roots this computer finds, by name |
| `run.folder` | The folder an action declared with `folder=True` runs in |
| `run.local(path)` / `run.portable(path)` | A stored path as this computer finds it, and back |

Return a dict of outputs, or nothing.
An exception fails the job with its message, and the full traceback goes to the Helper's log.

`run.client` carries a token made for this job alone: it acts as the person who asked, reaches only the job's board, and stops working when the action ends.

Cancelling a job stops the action and everything it started, at its next progress report or within 20 seconds.

### An action that works in a folder

An action declared with `folder=True` runs in the board's working folder on that computer, and that folder is its current directory.
Run from a menu, it first opens a small dialog named after the action and the computer, with the **Folder** filled in from the board's binding, **Choose...** to browse for another, and **Run**.
When the board has no folder there yet, a board admin can tick **Also bind it as the board's folder** on that computer.

See [Working folders and storage](https://docs.truetask.io/helper/folders).

### Interpreters

Actions run with `python3`, or the `py` launcher on Windows, unless the Helper's `config.json` names another.
An action can ask for one of the `interpreters` listed there by name, such as a DCC's own Python.
See [Install and update](https://docs.truetask.io/helper/install#where-it-keeps-its-files).

> **Who can write the folder can run code**
>
> Whoever can write to the actions folder can run code on every computer whose Helper reads it, as the person who runs that Helper.
> Keep the folder writable by the people who maintain the pipeline, and no one else.
> The workspace never sends code: a job names an action the folder declared and gives its inputs.

## Who may run what

A computer paired for **Just me** runs only its owner's jobs, and their agents'.

On a computer paired for **The workspace**, workspace admins may run every action.
On the computer's **Actions** tab, an admin sets **Who may run** each action:

| Choice | Who |
| --- | --- |
| **Admins** | Workspace admins only. The default. |
| **Everyone** | Every member of the workspace, never a guest. |
| **Chosen** | The people and teams you pick, and the admins. |

**Their agents too** lets those people's agents run the action as well.
It is off until an admin ticks it.

## In an automation

The **Run on a computer** step asks one of your paired computers to run an action, waits for it, and hands its outputs to the steps after it.
See [Actions and logic](https://docs.truetask.io/automations/actions).

A step runs on a computer only once whoever looks after that computer allows it: its owner, or a workspace admin for a shared one.
The step says **Not allowed on** the computer **yet** with **Allow**, and after any change to its action or inputs, **Changed since it was allowed** with **Allow again**.
Its jobs then run as whoever allowed it.

The computer's **Actions** tab lists the **Automations that run here**, with who allowed each, and the cross on a row stops it running there.

## Agents and actions

An agent runs actions through the Truetask MCP tools, with the same rules a person meets.

- On its owner's own computers, it runs every action.
  Pairing a computer for yourself is what lets your agents use it.
- On a shared computer, it runs only an action an admin opened with **Their agents too**, and only one its owner may run as well.
- It never reaches another person's own computer.

An agent turned away is told which switch is off.

An agent in an automation's **Agent** step also needs its owner to allow that step on their computers, since whoever edits the automation writes the agent's prompt.
The step says whether the agent **May use your computers**, and asks again after the agent or the prompt changes.

## Reaching a studio network

A computer can carry the workspace's calls to hosts only it can reach: a render farm's web service (as the [Deadline plugin](https://docs.truetask.io/plugins/deadline) uses), a licence server, an internal wiki.
A call to one of those hosts goes out from that computer instead of from the workspace, so a [plugin](https://docs.truetask.io/plugins/) or a feature reaches something on the studio's own network.

The list is the whole boundary, so only a workspace admin writes it.
On the computer's page, open **Network** and add each host under **What it reaches for the workspace**.
It is empty until an admin fills it in, takes plain host names only, never a wildcard, and every call carried through the computer goes to the audit log.

## The audit log

The [audit log](https://docs.truetask.io/admin/security) records, with who asked:

- every job on a shared computer;
- every change to who may run an action;
- every change to **Run my agents here** and to a computer's agent settings;
- every change to the hosts a computer reaches, and every call carried through one.

## Related

- [Truetask Helper](https://docs.truetask.io/helper/)
- [Working folders and storage](https://docs.truetask.io/helper/folders)
- [Actions and logic](https://docs.truetask.io/automations/actions)
- [MCP: connect any AI tool](https://docs.truetask.io/agents/mcp)
