Skip to main content

Documentation Index

Fetch the complete documentation index at: https://intunedhq.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

What are Web Tasks?

The Web Tasks API lets you describe a web task in plain English and have it executed for you—scraping a directory, filling a multi-page form, downloading a batch of files, or pulling data out of a table. You send a task description, a starting URL, any parameters it needs, and the shape of the output you want back. The API runs the task and returns the result. Under the hood, the AI decides which parts of the task benefit from being code, writes that code on the fly, and reuses it on later runs. Across repeat calls with the same reuseKey, executions get faster, cheaper, and more consistent—because each run executes saved code instead of re-exploring the site from scratch. Web Tasks are workspace-scoped. Unlike Projects, you don’t create, deploy, or maintain anything. You call the API and get a result.

When to use Web Tasks

Use Web Tasks when:
  • The task benefits from generated code—crawling pages, extracting data across many entities, repeated multi-step actions.
  • You’ll run the same task (or variations of it) more than once. The payoff comes from reuse.
  • You want the API to write and maintain the automation for you instead of owning the code yourself.
Use a Project instead when:

Core concepts

Start and result

Web Tasks use a two-call lifecycle, same as other long-running Intuned APIs:

Request fields

FieldRequiredDescription
taskYesNatural-language instruction describing the task.
startUrlNoOptional hint telling the agent where to start in the browser. If omitted, the agent decides from the task description.
parametersNoStructured inputs that may change between runs (for example, { "batch": "S24" }).
outputSchemaNoJSON Schema (draft 2020-12) for the desired result shape. If omitted, the system infers a format from the task.
reuseKeyNoLabel that ties this run to a reusable automation. See Reuse and the reuseKey. If omitted, the server generates one for you.
modelNoModel the agent runs with: haiku, sonnet, or opus. Defaults to haiku. Heavier models help on harder tasks at higher cost.

Status model

A Web Task moves through these states:
  • pending — created, not yet executing.
  • started — executing.
  • completed — finished. The response includes an outcome of success or failed.
Failed tasks are still completed—the outcome distinguishes them. Failed runs never update saved reusable code.

Result delivery

The server decides how to return the result:
  • Inline — small outputs (booleans, short text, small arrays, small objects) come back directly in the response under result.data.
  • File — large outputs come back as a downloadable URL under result.file, often with a preview (row count and a small sample). File URLs are signed and expire after 7 days.
You don’t choose the mode upfront.

Cost

Final responses include cost when available:
  • cost.aiUsd — AI/model cost in dollars.
  • cost.compute — runtime compute usage in hours.

Reuse and the reuseKey

reuseKey is the mechanism that makes Web Tasks get cheaper and faster over time. With a reuseKey, the system loads any code saved under that key and tries to run it. If the existing code works, it returns the result. If not, the AI repairs or updates the code. On success, the improved code is saved back under the same key. On failure, the previous code is left untouched. Without a reuseKey, the server still creates a reusable bundle for the run. It auto-generates a wtr_-prefixed key, saves code under it, and returns it on the result as reuse.key. Pass that key on later calls when you want to reuse the same automation. Same reuseKey means the same reusable automation, regardless of URL or parameters. If you want different automations, use different keys (yc_companies, wellfound_companies, shopify_products). For the full execution model and reuse rules, see How Web Tasks work.

Example

The simplest path is the SDK run() helper, which submits the task and polls for the result for you. Default poll interval is 5 seconds; you can pass an optional timeout.
import { IntunedClient } from "@intuned/client";

const client = new IntunedClient({
  apiKey: "<YOUR_API_KEY>",
  workspaceId: "<YOUR_WORKSPACE_ID>",
});

const result = await client.webTasks.run(
  {
    task: "Scrape companies from the YC directory",
    startUrl: "https://www.ycombinator.com/companies",
    parameters: { batch: "S24" },
    reuseKey: "yc_companies",
  },
  { pollIntervalMs: 5000, timeoutMs: 10 * 60 * 1000 },
);

console.log(result.status, result.outcome);
If you can’t use the SDK, call the endpoints directly:
# Start a task
curl -X POST "https://api.intuned.io/{workspaceId}/web-tasks/start" \
  -H "x-api-key: $INTUNED_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "task": "Scrape companies from the YC directory",
    "startUrl": "https://www.ycombinator.com/companies",
    "parameters": { "batch": "S24" },
    "reuseKey": "yc_companies"
  }'

# Poll for the result
curl "https://api.intuned.io/{workspaceId}/web-tasks/{webTaskId}/result" \
  -H "x-api-key: $INTUNED_API_KEY"
A successful response looks like:
{
  "webTaskId": "wt_123",
  "status": "completed",
  "outcome": "success",
  "result": {
    "type": "inline",
    "data": [
      { "name": "ExampleCo", "batch": "S24", "url": "https://www.ycombinator.com/companies/exampleco" }
    ]
  },
  "reuse": {
    "key": "yc_companies",
    "used": false,
    "created": true,
    "updated": true
  },
  "cost": {
    "aiUsd": 0.42,
    "compute": { "unit": "hours", "amount": 0.023 }
  }
}

Limits

  • Each workspace can run up to 10 Web Tasks concurrently.
  • Same-reuseKey runs are serialized: runs that share a reuseKey execute one at a time so two runs don’t update the same code concurrently. Runs with different keys can run in parallel.
  • Failed runs return outcome: "failed" with an error.code. Possible codes: workspace-rate-limited, unauthenticated, no-ai-credits-left, timeout, rejected, internal-error.
  • No webhooks, AuthSessions, or queue inspection in v1.

Next steps

How Web Tasks work

Execution model and reuse rules in detail

API reference

Start and result endpoints

CLI reference

Run Web Tasks from the intuned platform webtasks commands