Tasks: Outputs & Webhooks
Save files written to /outputs as Assets, filter which files to keep with glob patterns, track output uploads and file limits, and receive signed completion webhooks.
Saving task output files to Assets, filtering outputs, handling file limits, and receiving webhooks or email notifications for Serverless Tasks.
Writing your script: outputs
Section titled “Writing your script: outputs”Anything your program writes to /outputs is uploaded automatically after the container exits and becomes downloadable from the task’s page in the console. In Script mode your script also starts with /outputs as its working directory; in Project mode the working directory is your project folder instead.
- Script mode: relative writes (
open("result.csv", "w")) already land in/outputs— no path handling needed. - Project mode: relative writes land in the project folder, and files that are new there are moved to
/outputswhen the program exits. Write to/outputs/...explicitly for anything that must survive a Stop or a max run time. _task.logis added automatically: a tail of the run’s log, archived alongside your files.- To keep only some of the files, choose them in the Output card of the submit form — see Choosing which files to save. By default everything is kept.
- When the run ends, everything in
/outputs(or only the files you chose to save) becomes an asset in your workspace — kept until you delete it, and billed as storage if it lives in managed storage. Each run becomes its own asset — re-running the task creates a new one (-2,-3, and so on). Only_task.logfollows the log retention policy. - The upload resumes after interruptions and retries automatically for up to ~3 days (about 6 hours if the task ended on a platform fault or because credit ran out); the console shows how far it has got (see Saving outputs). If you don’t need the files, Discard outputs on the task page stops the transfer and releases the storage.
| Output limit | Value |
|---|---|
| Max size per file | 5 GiB — where /outputs is billed as a volume, this cap doesn’t apply |
| Max number of files | Usually 2,000 (see Over the file limit) |
| Output disk budget | 20 GiB — where /outputs is billed as a volume, it starts at 20 GiB and grows as the task writes, up to the task’s share of the node’s disk |
Choosing which files to save
Section titled “Choosing which files to save”In the Output card, click All files next to /outputs. Turn on any mix of Images, Videos, Model files and Data & logs, add your own patterns, or type a path under Check a path to see whether it would be saved. The example tree under /outputs marks what each choice keeps.
Your own patterns are globs, the same syntax as watched-folder include rules. Only files under /outputs that match are uploaded; the rest are deleted when the task ends. From code, pass the patterns as output_include (SDK and MCP) or --output-include (CLI).
| Pattern | Saves |
|---|---|
*.safetensors | Every .safetensors file, in any subfolder |
samples/*.png | PNGs directly inside samples/ — not in its subfolders |
samples/**/*.png | PNGs anywhere under samples/ |
checkpoints/ | Every folder named checkpoints, at any depth, with everything inside (/checkpoints/ only the one at the top) |
- Patterns are relative to
/outputs: writesamples/*.png, not/outputs/samples/*.pngor./samples/*.png. - A pattern that matches a folder saves everything inside it.
out/*also matches the folderout/sub, so it saves all ofout. - Matching is case-sensitive (
*.pngdoesn’t matchA.PNG). Brackets and braces ([abc],{png,jpg}) aren’t supported — add one pattern per alternative (*.png,*.jpg) and use?for a single character. Separate folders with/, not\. A leading!is reserved. - In the submit form you can type several patterns separated by commas. From code, pass a list (or repeat
--output-include) — there a comma is part of the pattern. _task.logis still added.- Files you don’t save still take up
/outputswhile the task runs — they count toward the output disk budget, and toward the disk charge where/outputsis billed as a volume. They are deleted, not uploaded, when the task ends. - If no file matches, the task still succeeds and no output asset is created; the task page shows that nothing matched the filter.
- The file-count limit applies to the files that match.
Saving outputs
Section titled “Saving outputs”Outputs are saved after the run ends. Until they’re in Assets, the console shows how far saving has got:
- Tasks list and task page — a progress banner with the files, the size and the time left. A succeeded task’s status badge shows Uploading until then.
- Assets page — a Saving outputs section lists each task that is still saving. While the Assets page is open, a notification appears when a task’s outputs are saved.
- Delete is disabled on a task while its outputs are being saved.
- A failed upload attempt is retried automatically. The banner then says when the next attempt is, for example Retrying upload · 48/126 files · next try in 3 min.
Outputs usually appear in Assets within seconds after the upload finishes. For some runs they appear about 2 minutes after the last file, and in rare cases up to about 30 minutes after the task ends.
Once they’re saved, the task page shows Saved to Assets as <asset name> · <time> · never auto-deleted, with an Open asset button. For a partial save, the time is replaced by how many files were saved (N of M files). Outputs saved to your connected bucket show the bucket path instead, still with Open asset.
Compute stops when your script ends; where /outputs is billed as a volume, it keeps billing as storage until saving finishes — see Task billing & refunds.
Over the file limit
Section titled “Over the file limit”A task saves a limited number of output files — usually 2,000. When files are left out because of the limit, the task page usually says how many and names the limit.
Going over the limit doesn’t lose the whole run. Usually, the files closest to /outputs are kept first — shallower folders before deeper ones, then in path order — and the rest aren’t saved. The task then shows an amber notice, for example “Only 2,000 of 2,431 output files were saved — 431 were over the 2,000-file limit.” Files a project couldn’t move to /outputs are listed only in the log.
To keep everything, zip many small files into one archive before the script exits, or narrow the task’s output include filter, then re-run the task.
Webhooks
Section titled “Webhooks”Add a webhook to be notified when a task reaches a terminal state:
| Event | When |
|---|---|
task.succeeded | Script exited with code 0 |
task.failed | Script failed — non-zero exit, OOM, eviction, install failure, or a platform fault |
task.timed_out | Max run time reached |
task.outputs_ready | The output upload ended: every file was uploaded (completed), the upload ended before every file was saved — it ran out of time or couldn’t continue (failed) — or you discarded the rest (discarded). It comes before the files are registered in Assets, and not every task sends it. |
task.outputs_saved | The outputs were saved to Assets. Sent once per task, right after they are registered, even when no file was saved. |
The output events come after the terminal event — outputs can still be uploading when task.succeeded arrives. Apart from them, only terminal states send an event. A manual Stop sends no terminal event, but the output events still arrive for its outputs.
The payload envelope matches inference webhooks:
{ "id": "evt_3f9c1a2b4d5e6f70", "type": "task.succeeded", "created_at": 1780000000, "data": { "id": "task_abc123", "name": "nightly-batch-embed", "status": "succeeded", "fault_class": "none", "exit_code": 0, "failure_reason": null, "namespace_name": "my-workspace", "gpu_model": "RTX 4090", "created_at": 1779996400, "finished_at": 1779999998, "total_cost": "0.42000000" }}fault_class—none(succeeded),user, orplatform. This is what decides whether anything is refunded.total_cost— the final, trued-up charge in credit.- Terminal payloads also carry
output_upload_state— where the output transfer stands at that moment. Wait fortask.outputs_savedbefore fetching files programmatically.
task.outputs_saved has its own data:
{ "id": "evt_5e6f708192030405", "type": "task.outputs_saved", "created_at": 1780001000, "data": { "id": "task_9f8e7d6c5b4a3210", "name": "batch-inference", "status": "succeeded", "namespace_name": "my-workspace", "asset_id": "asset_1a2b3c4d5e6f7081", "asset_name": "batch-inference", "files_saved": 2000, "files_not_saved": 37, "bytes_saved": 4831838208, "finished_at": 1780000390 }}status— the task’s own terminal status, so this event alone tells you how the run ended.asset_id/asset_name— the asset the outputs became. Both arenullwhen no file was saved.files_not_saved— files that weren’t stored: files over the file limit, plus files still incomplete when the upload ended. Only tasks that also sendtask.outputs_readycount them; for other tasks it is0.
task.outputs_ready carries id, name, status, namespace_name, output_upload_state, output_files_declared, output_files_completed, output_bytes_completed, created_at and finished_at.
Deliveries carry the same X-Meshive-Signature HMAC header as every other Meshive webhook — verify it exactly as described in Webhooks → Verifying the signature. Retries, idempotency (dedupe on the event id), and security rules are also identical.
No webhook, or one that can’t be reached? You get an email. When a task has no webhook for its event — no webhook_url on the task and no workspace endpoint subscribed to that event — the person who submitted it gets one email when it succeeds, fails, times out, or is stopped because the credit balance ran out. If the task has webhooks but none of them accepted the event after all retries, the same email goes out with the reason the delivery failed. A task you stop yourself sends no email.