Returns the input files attached to a task.
Convenience helper around get that extracts and normalizes the
inputContent.files[] array.
Returns the parsed output of a task regardless of whether it came from a canvas execution or a workflow execution.
Returns null if the task has no output yet.
Lists tasks with optional filters and pagination.
Patches a task's output content with a deep merge against the existing content.
⚠️ Merge semantics, not replace. The server iterates the keys of the
provided payload and overlays them onto the current outputContent.content:
If you only need to update a single (possibly nested) field, prefer patchOutputField which handles building the nested payload for you.
Patches a single field of a task's output content using a dot-notation path.
Internally builds a nested object that mirrors the path and submits it via patchOutputContent, relying on the server's deep-merge to leave sibling fields untouched.
Path syntax:
foo.bar.baz — nested object keysitems.0.price — numeric segments are treated as array indices⚠️ Use updateOutputContent for any change inside arrays. The
server's deep-merge replaces an entire array whenever the patched array's
length differs from the current one. This method only sends a sparse
single-element array (e.g. [{ price: 7 }]), so an array index path will
truncate the rest of the items. It is safe for object paths only
(e.g. profile.email).
// Existing: { profile: { name: 'A', email: 'a@x' } }
await tela.tasks.patchOutputField(id, 'profile.email', 'b@x')
// Result: { profile: { name: 'A', email: 'b@x' } }
// ❌ Do NOT use patchOutputField for array indices:
// await tela.tasks.patchOutputField(id, 'items.0.price', 7)
// → server replaces items[] with the single-element sparse array.
// ✅ Use updateOutputContent instead:
await tela.tasks.updateOutputContent(id, (current) => {
current.items[0].price = 7
})
Re-runs a task. Returns the new execution metadata.
Note: the server only allows re-running tasks in failed status. Calling
this on a task in any other state will result in a 400 response.
Reverts approval on multiple tasks (sets them back to validating).
Only tasks currently in completed status are eligible.
Updates one or more fields of a task.
Only name, status, tags, and outputContent may be updated.
Read-modify-write helper for safely updating any part of a task's output content — including array elements.
Fetches the current output, hands you a deep clone via the updater
callback (which can mutate it in place or return a new value), then
submits the full updated content via patchOutputContent. Because
the entire arrays are sent back, the server's "replace on length mismatch"
array behavior never triggers — array element edits, additions, removals,
and reorders all work correctly.
Use this whenever:
For simple top-level patches without needing the current value, prefer patchOutputContent.
await tela.tasks.updateOutputContent<MenuOutput>(id, (current) => {
current.menu.items[2].price = 9.99
})
await tela.tasks.updateOutputContent<TodoOutput>(id, (current) => {
current.todos.push({ text: 'new task', done: false })
})
Tasks API resource.
Example