Zod schema type for task input variables
Zod schema type for task output results
InternalCreates a new Workstation instance.
Use Workstation.get instead.
The unique identifier for this workstation (application ID).
The prompt version configuration for this workstation.
Creates a new task for this workstation and returns a promise-like object.
The returned object can be awaited directly to get the Task instance, or you can
access .result to get the final task output directly.
Input variables for the task (must match the input schema)
Optional task parameters (label, tags, skipResultValidation)
A promise-like object that resolves to the Task instance
Retrieves an existing task by its ID.
This is useful for resuming monitoring of a task that was created earlier.
The task ID to retrieve
Optional configuration
OptionalskipResultValidation?: booleanWhether to skip output validation
A promise that resolves to the Task instance
Asynchronously iterates through all tasks matching the specified filters.
This generator automatically handles pagination, fetching additional pages as needed. Each iteration yields a task and the current page metadata.
Query parameters
Optionalfilters?: {Optional filters to apply (ID, name, status, dates, etc.)
Optionaloptions?: {Optional initial pagination and sorting options
// Iterate through all pending tasks
for await (const [task, meta] of workstation.iterateTasks({
filters: { status: ['pending'] },
})) {
console.log(`Task ${task.id}: ${task.status}`)
console.log(`Page ${meta.currentPage} of ${meta.totalPages}`)
}
// Process tasks in batches
for await (const [task, meta] of workstation.iterateTasks({
options: { limit: 50 },
})) {
await processTask(task)
}
Lists tasks for this workstation with optional filtering and pagination.
Returns a page of tasks matching the specified filters, along with metadata for pagination.
Query parameters
Optionalfilters?: {Optional filters to apply (ID, name, status, dates, etc.)
Optionaloptions?: {Optional pagination and sorting options
OptionalrawQuery?: Record<string, any>Raw query object (internal use, overrides filters/options)
A promise that resolves to an object containing tasks and pagination metadata
// Get first 10 completed tasks
const { tasks, meta } = await workstation.listTasks({
filters: { status: ['completed'] },
options: { limit: 10, offset: 0 },
})
// Sort by creation date
const { tasks, meta } = await workstation.listTasks({
options: {
order: { by: 'createdAt', direction: 'desc' },
limit: 20,
},
})
StaticgetRetrieves a workstation by application ID and optionally validates schemas.
This is the recommended way to create a Workstation instance.
Configuration options
The BaseClient instance for API communication
The unique ID of the workstation
Optional input schema function
Optional output schema function
Whether to skip schema validation (defaults to false)
OptionalskipSchemaValidation?: booleanWhether to skip schema validation against the server configuration. Defaults to false.
The BaseClient instance for API communication
A promise that resolves to a Workstation instance
Represents a workstation (prompt application) in the Tela platform.
A Workstation enables creating and managing tasks (async workflow executions) with input/output schema validation using Zod.
Example