Task volumes
Every execution starts on a clean machine: whatever the skill writes to disk is gone when it ends. A volume is an organization folder that Kadu mounts before the skill runs and saves after, so the next execution finds the files where the previous one left them.
Use a volume when the task needs to remember something from one execution to
the next: what was already published, the last record processed, drafts that
another task will continue. The case behind the feature is a newsletter. The
skills write posts to posts/, the week's news to news/ and video scripts to
videos/data/*.json, and keep a .ghost-published.json with what was already
published. That file is what stops the newsletter email from going out twice.
| Use | For |
|---|---|
| Volume | state in files that must last between executions, including executions of different tasks |
| Input and output files | what a person attaches when running the task and what the execution delivers to them |
.execution-files/state/ | intermediate files of a conversational task, only between rounds of the same conversation |
dependencies services | a scratch database that starts empty and goes away with the execution |
In two parts​
The volume is created by the organization and used by the task:
- Create. Declare the volume in the
kadu.yamlat the root of the Playbook, or create it in Settings → Volumes (Volumes). - Use. Each task that needs it declares the name in
task.volumes, in theSKILL.mdfrontmatter.
The repository only picks names. Which organization the volume belongs to, and which environment, is decided by Kadu when the task runs. The content never comes from the repository and never goes through the console, the API or MCP: they show only the structure (paths, sizes, dates and the execution that wrote each file).
Declare in kadu.yaml​
volumes:
- name: newsletter # the name tasks use
label: Newsletter content # optional: the name in the console
workspace: conteudo # optional: only this plugin's tasks mount it
quota_mb: 500 # optional: default 1024 (1 GiB), maximum 10240
- name: newsletter
environment: Sandbox # optional: a volume for this environment only
quota_mb: 100
| Field | Rule |
|---|---|
name | Required. Lowercase letters, digits and hyphens, starting with a letter or digit, up to 63 characters. Together with environment, it is the volume's identity. |
label | Optional. Name shown in the console. |
environment | Optional. Exact name of an environment. Without it, the volume is shared by all environments. |
workspace | Optional. The plugin whose tasks may mount the volume. Without it, any task in the organization can. |
quota_mb | Optional. Volume quota in MB, from 1 to 10240. Default: 1024. |
The execution's environment comes first. With a shared newsletter volume
and another newsletter volume for the Sandbox environment, an execution in
Sandbox mounts the Sandbox one, and executions in other environments mount the
shared one. That is how you test a task without touching production state.
Leaving the file does not delete. This is the only kadu.yaml section in
which removal does not delete what the repository created. A volume that leaves
the list (or a volumes: []) keeps existing, with its content. It only
stops being owned by the repository, and the sync warns. The volume is
organization data, and a typo in the YAML must not take months of state with
it. To delete it, remove the volume from the file and then delete it in
Settings → Volumes.
See The kadu.yaml for the other sync rules.
Declare in the task: block​
---
name: escrever-post
description: Researches, writes and publishes a newsletter article
task:
label: "Write newsletter post"
workspace: Content
activity: Newsletter
model: tier-3
required_secrets:
- GHOST_URL
- GHOST_ADMIN_API_KEY
volumes:
- name: newsletter
mode: rw # ro (default) | rw
mount: newsletter # optional: shortcut in the working folder
commit: always # always (default) | on_success
---
| Field | Rule |
|---|---|
name | Required. The name of an organization volume. |
mode | ro (default): read-only, nothing is saved. rw: read and write, saved at the end. |
mount | Optional. Relative path in the skill's working folder where Kadu creates a shortcut (symlink) to the volume. It cannot start with .claude, .execution-files or .git, nor contain ... |
commit | rw only. always (default): also saves when the skill fails or the execution is cancelled. on_success: saves only when the skill succeeds. |
| Rule | Detail |
|---|---|
| Limit | At most 5 volumes per task |
| Malformed item | An unknown key, mode or commit outside the list, an invalid mount, or a repeated name or mount discards the whole list, with a warning. The stored value stays |
| Absent | volumes missing from the frontmatter keeps what was stored; volumes: [] clears it |
| Volume that does not exist | Sync warning (volume "…" não existe); the execution fails when it starts |
The whole list is dropped over one bad item on purpose: mounting only some of the volumes would make the skill run without the state it expects and fail far from the cause.
In the skill: the variables​
| Variable | Content |
|---|---|
KADU_VOLUMES_DIR | The folder with all of the execution's volumes (.execution-files/volumes/) |
KADU_VOLUME_<NAME> | Each volume's folder. The name is uppercased, with - replaced by _: newsletter → KADU_VOLUME_NEWSLETTER, notas-2026 → KADU_VOLUME_NOTAS_2026 |
With mount: newsletter, ./newsletter/posts and $KADU_VOLUME_NEWSLETTER/posts
are the same folder. Prefer the variable in scripts and the shortcut in text
meant for the model.
source /tmp/agent_state.sh
NL="$KADU_VOLUME_NEWSLETTER"
mkdir -p "$NL/posts" "$NL/news" "$NL/videos/data"
# The manifest of what was already published. On the first execution the volume is empty.
MANIFEST="$NL/.ghost-published.json"
[ -f "$MANIFEST" ] || echo '{}' > "$MANIFEST"
if jq -e --arg slug "$SLUG" 'has($slug)' "$MANIFEST" >/dev/null; then
append_log "Post $SLUG already published: the email does not go out again"
else
# ... publish to Ghost ...
# Write the manifest RIGHT after publishing, to a new file and with mv,
# so a half-written JSON is never left behind.
jq --arg slug "$SLUG" --arg at "$(date -u +%FT%TZ)" '. + {($slug): $at}' \
"$MANIFEST" > "$MANIFEST.tmp" && mv "$MANIFEST.tmp" "$MANIFEST"
fi
The volume is empty on the first execution. The skill creates the folders and files it needs, and treats their absence as "nothing done yet".
What happens in the execution​
- Mount. Before the skill starts, Kadu checks the organization, the
workspace and the write lock, and downloads each volume to
.execution-files/volumes/<name>/. Anrovolume arrives without write permission. A failure here fails the execution before the skill runs. - Run. The skill works on the files as in any folder. The agent never receives the storage credential: it only sees the folder.
- Save. After the skill, for each
rwvolume, Kadu compares the folder with what was downloaded and uploads the new and changed files, and only then deletes the ones that are gone. With no change, nothing is uploaded. Each volume's outcome shows in the execution's Volumes card (Follow an execution).
Saving takes only regular files into account. Symlinks, pipes and devices inside the volume are ignored, with a warning in the log. Empty folders are not kept.
When to save: commit​
commit | The skill succeeded | The skill failed | The execution was cancelled |
|---|---|---|---|
always (default) | saves | saves | saves |
on_success | saves | discards | discards |
Choose by the effect on external systems, not by how "clean" the state is. In
the newsletter, a published post and a sent email are not undone if a later
step fails. With on_success, the updated .ghost-published.json would be
discarded, and the next execution would send the email again. That is why the
default is always.
Use on_success when a failed execution would leave the volume worse than it
was, and nothing outside the volume changed: an index rebuilt from scratch, a
batch of files that is only valid when complete.
Concurrency: one writer at a time​
rwlocks the volume. Only one execution at a time writes to a volume, even across different tasks. Another execution that needs it inrwwaits Queued and starts on its own when the previous one ends. It is not refused.rodoes not lock. Anroexecution runs in parallel with the one that writes and may read the volume in the middle of a save, with part of the new files. If that matters, mount it asrwtoo, even without writing.- Schedules are queued. A scheduled run of a task whose volume is held by another execution is queued instead of skipped. The task's own rule still applies: if it already has an active or queued execution, the time slot is skipped (Executions).
Tasks that write the same volume therefore run one after the other. A short cron on one of them delays the others.
Conversational tasks​
In a conversational task, each round is an execution and mounts the volume as it is now, not as it was when the previous round ended. If another task wrote to the volume between the two rounds, the new round sees the change.
The volume content is not part of the conversation's saved session. The
session carries only .execution-files/input/, output/ and state/.
Continuing an old round does not take the volume back in time.
| Folder | Lasts | Seen by |
|---|---|---|
.execution-files/state/ | between rounds of the same conversation | only the child round of that conversation |
| Volume | until it is deleted | every execution of every task that mounts it |
Limits​
| Limit | Value |
|---|---|
| Volumes per task | 5 |
| Size of one file | 100 MB |
| Files per volume | 10,000 |
| Volume quota | 1 GiB by default, up to 10 GiB (quota_mb: 10240) |
| Sum of the organization's volumes | 10 GiB |
| File path | relative, UTF-8, up to 1,024 bytes, without .., \ or control characters |
| Deleted volume | the content is kept for 30 days, then deleted for good |
A save that would exceed a limit is refused as a whole, before any file is uploaded: the volume stays as it was and the execution fails with the reason. Downloading and saving the volume count toward the execution's 60 minutes.
When something goes wrong​
| What happens | Effect |
|---|---|
Volume that does not exist (volume_not_found) | The execution fails when it starts, with "Task volume unavailable" |
Volume restricted to another workspace (volume_not_allowed) | Same |
| Failure downloading the volume | The execution fails before the skill runs |
| A task secret's value in a changed file | Nothing from that volume is saved, and the execution fails with "Could not save the Task volume" |
| Limit exceeded (file, number of files, quota, organization cap) or invalid path | Same, with the reason in the Volumes card |
| Failure in the middle of the upload | The execution fails. The volume keeps part of the new files and is marked incomplete until the next complete save. It can still be mounted |
| The execution's machine dies abruptly | The save step does not run: everything that execution wrote is lost, and the volume stays as it was before it |
The messages come in the execution language
(the task's locale, the one of whoever triggered it, or the organization default).
A save failure fails the execution even when the skill succeeded: the next execution would not find what this one left, and it is better to know now. Saving is not atomic across files. Independent files (one per post, one JSON per video) tolerate this better than a single file that references others.
Security​
- The volume content is input to the next execution. Text that came from outside (a news article, an email, a web page) and was written to the volume may carry instructions for the model (prompt injection). Treat what you read from the volume as data, validate JSON before using it and do not follow instructions found in the files.
- Never write a secret to a volume. Kadu looks for the value of each of the task's secrets in the changed files and, if it finds one, refuses to save that whole volume and fails the execution. Read the secret from the environment on every execution.
- File names show in the console and in the API. The content does not, but the path does. Do not put a tax ID, email or customer name in a file name.
- Mount only what the task uses, and as
rowhenever possible. A task that only reads should not be able to damage the other tasks' state.
Starting with a volume that already has data​
The volume starts empty. To bring existing state into it (a repository's
content, the manifest that lives on some machine today), write a one-off task
that mounts the volume as rw and copies the files into it, or ask Kobana
support to load it.
Through the API and MCP​
/v1/volumes creates, lists, updates and deletes volumes,
/v1/volumes/{id}/files lists the structure and /v1/volumes/{id}/syncs the
save history, always without the content (reference). In
MCP, the kadu_volumes_* tools (Configuration).