Skip to main content

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.

UseFor
Volumestate in files that must last between executions, including executions of different tasks
Input and output fileswhat 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 servicesa 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:

  1. Create. Declare the volume in the kadu.yaml at the root of the Playbook, or create it in Settings → Volumes (Volumes).
  2. Use. Each task that needs it declares the name in task.volumes, in the SKILL.md frontmatter.

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
FieldRule
nameRequired. Lowercase letters, digits and hyphens, starting with a letter or digit, up to 63 characters. Together with environment, it is the volume's identity.
labelOptional. Name shown in the console.
environmentOptional. Exact name of an environment. Without it, the volume is shared by all environments.
workspaceOptional. The plugin whose tasks may mount the volume. Without it, any task in the organization can.
quota_mbOptional. 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
---
FieldRule
nameRequired. The name of an organization volume.
modero (default): read-only, nothing is saved. rw: read and write, saved at the end.
mountOptional. 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 ...
commitrw only. always (default): also saves when the skill fails or the execution is cancelled. on_success: saves only when the skill succeeds.
RuleDetail
LimitAt most 5 volumes per task
Malformed itemAn 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
Absentvolumes missing from the frontmatter keeps what was stored; volumes: [] clears it
Volume that does not existSync 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​

VariableContent
KADU_VOLUMES_DIRThe 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​

  1. Mount. Before the skill starts, Kadu checks the organization, the workspace and the write lock, and downloads each volume to .execution-files/volumes/<name>/. An ro volume arrives without write permission. A failure here fails the execution before the skill runs.
  2. Run. The skill works on the files as in any folder. The agent never receives the storage credential: it only sees the folder.
  3. Save. After the skill, for each rw volume, 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​

commitThe skill succeededThe skill failedThe execution was cancelled
always (default)savessavessaves
on_successsavesdiscardsdiscards

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​

  • rw locks the volume. Only one execution at a time writes to a volume, even across different tasks. Another execution that needs it in rw waits Queued and starts on its own when the previous one ends. It is not refused.
  • ro does not lock. An ro execution 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 as rw too, 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.

FolderLastsSeen by
.execution-files/state/between rounds of the same conversationonly the child round of that conversation
Volumeuntil it is deletedevery execution of every task that mounts it

Limits​

LimitValue
Volumes per task5
Size of one file100 MB
Files per volume10,000
Volume quota1 GiB by default, up to 10 GiB (quota_mb: 10240)
Sum of the organization's volumes10 GiB
File pathrelative, UTF-8, up to 1,024 bytes, without .., \ or control characters
Deleted volumethe 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 happensEffect
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 volumeThe execution fails before the skill runs
A task secret's value in a changed fileNothing 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 pathSame, with the reason in the Volumes card
Failure in the middle of the uploadThe 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 abruptlyThe 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 ro whenever 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).