How tasks fit in
Tasks belong to an agent. When you run a task, you provide the task input defined by its schema and either a source or a credential. Deck creates a session and a task run that executes the work.Creating tasks
Tasks can be created in the Console with prompting or through the API. Once created, you reference them by ID in your API calls.Writing the prompt
Theprompt field tells the agent what to accomplish on the source. Describe the goal, not the steps to get there.
A task runs across every source that supports it. The same “fetch my latest bill” task works on any utility provider, so the prompt should be source-agnostic. Don’t reference specific websites, page layouts, or UI elements.
Your prompt gets combined with Deck’s agent harness, a built-in set of guidance that tells the agent how to navigate sites, handle authentication, recover from errors, and use its tools. When your prompt includes detailed navigation instructions, they can conflict with the harness or restrict tools the agent would otherwise use to complete the task. Keep your prompt focused on the outcome and let the harness handle execution.
- Good
- Bad
Read vs. write
Tasks can be read operations (fetching data) or write operations (performing actions).| Type | Examples |
|---|---|
| Read | Fetch account balance, list transactions, download statements |
| Write | Submit a form, make a payment, cancel a reservation |
Input and output schemas
Every task defines a contract through JSON Schema:- Input schema validates what you send when running the task. Deck rejects requests that don’t match before the agent starts.
- Output schema defines the structure of the data the agent returns. Regardless of how the source renders its data, Deck returns a consistent shape.
Designing the input schema
Only include fields that change between runs. The input should capture what your application needs to parameterize, not how the source works. Keep it source-agnostic so the same task runs against any supporting source.- Good
- Bad
Accepting file inputs
File inputs are available on Enterprise plans. The
extraction purpose additionally requires the extraction and storage add-ons.File inputs are in preview and not yet generally available.
purpose selects how Deck handles the file, with data carrying the file as base64. Two purposes are supported:
purpose | What Deck does |
|---|---|
attachment | The agent receives the file at run time and uses it on the source. |
extraction | Deck extracts structured JSON from the file directly. The agent is skipped. |
Designing the output schema
Design the output for what your application needs, not what a specific source displays. The schema should be generic enough to work across all sources that support the task. Fields come backnull when a source doesn’t have that data.
- Good
- Bad
Tokenizing sensitive fields
Available on Enterprise plans.
tokenized array on the input schema when you create the task. Each entry must match a property defined in properties.
card_number, cvv, and cardholder_name are tokenized; expiration is sent normally. When you run the task, pass every field as usual. Deck tokenizes the marked values when the run is created, storing them in a secure vault, and restores the originals when the run is dispatched for execution so the agent can use them on the source.
The run stores tokens in place of the real values, never the values themselves. In API responses, tokenized fields are removed from the run’s input entirely, and a tokenized array lists which field names were removed. You can’t query the original values back through the API.
Task statuses
| Status | Meaning |
|---|---|
learning | The agent is learning how to perform the task. You can run it, but expect lower success rates. |
test | The agent understands the task but is still improving. Higher success rates than learning. |
live | Production-ready. The agent fully understands the task. |
learning → test after 3 successes, then test → live after 3 more. Check status on the task object to see where it currently sits.
If you update a task, it may move back to learning or test while the agent adapts to the changes.
Resetting a task
Once a task has progressed totest or live, the agent reuses what it has learned on subsequent runs. If the task is struggling to deliver successful results or you want the agent to start over, you can reset the task back to learning.
Reset a task from the Console on the task detail page, or call POST /tasks/{task_id}/reset. The task’s status returns to learning, and on the next run the agent learns how to perform the task again. Expect lower success rates until it progresses back to test or live.
Deep dives
Storage
Capture files during task execution and extract structured data.
Task runs
What happens when you execute a task.