> ## 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.

# Run attributes

> Attach key/value facts to a Run, like where data came from or how many items were processed

## Overview

Run attributes are key/value facts about how a Run went. Your automation sets them while it runs, and the caller can pass initial ones when it starts the Run. Intuned stores them with the Run and each Attempt and returns them wherever you read Run results.

Use attributes for small, structured facts that describe the Run rather than its output:

* **Where the data came from** — `source: "cache"` or `source: "live"`
* **How the Run went** — `pagesScraped: 12`, `aiFallback: true`, `stage: "checkout"`
* **Who or what started it** — `trigger: "scheduled"`, `batch: "2026-10-25"`

Your API's return value is still the place for the data you extract. Attributes describe the Run.

> [!WARNING]
>
> Attributes are operational metadata. Never put personal or regulated data in them (names, emails, patient or financial records). Unlike Run results, attributes are not written to customer-data storage.

## Set attributes from your automation

Call `setAttribute` (TypeScript) or `set_attribute` (Python) anywhere in your API code. Setting a key again overwrites it. `deleteAttribute` / `delete_attribute` removes a key.

```typescript TypeScript theme={null}
import type { BrowserContext, Page } from "playwright";
import { setAttribute, deleteAttribute } from "@intuned/runtime";

export default async function handler(
  params: any,
  page: Page,
  _context: BrowserContext
) {
  setAttribute("source", "live");
  setAttribute("startedAt", new Date());

  const items = await scrapeItems(page);
  setAttribute("itemsProcessed", items.length);
  setAttribute("categories", ["shoes", "bags"]);

  deleteAttribute("trigger"); // remove an initial attribute
  return items;
}
```

```python Python theme={null}
from datetime import datetime, timezone

from intuned_runtime import delete_attribute, set_attribute


async def automation(page, params, **_kwargs):
    set_attribute("source", "live")
    set_attribute("started_at", datetime.now(timezone.utc))

    items = await scrape_items(page)
    set_attribute("items_processed", len(items))
    set_attribute("categories", ["shoes", "bags"])

    delete_attribute("trigger")  # remove an initial attribute
    return items
```

Attributes are reported whatever the outcome: a successful Attempt, a failed one, and a canceled one all report the attributes set so far. That makes them useful for recording how far a failed Attempt got.

### Values and limits

| Rule | Limit |
| - | - |
| Keys | Start with a letter, then letters, digits, or `_`. Up to 64 characters. |
| Values | A string (up to 255 characters), a finite number, a boolean, a date, or a list of up to 20 strings (each up to 255 characters) |
| Dates | Sent as RFC 3339 strings, for example `2026-10-25T14:30:00.000Z`. In Python, use a timezone-aware `datetime`. |
| Per Run | Up to 64 attributes, serializing to at most 16 KB |

`setAttribute` / `set_attribute` throws an error when a key, a value, or a limit is invalid, so a mistake shows up while you develop instead of being dropped silently.

## Pass initial attributes when starting a Run

The caller can start a Run with initial attributes. Every Attempt starts with them, and your code can overwrite or delete them.

**Standalone Run**

Add `attributes` to the body of the [Run start](https://intunedhq.com/docs/client-apis/api-reference/projectsruns/run-api--start.md) request:

```bash theme={null}
curl -X POST "https://app.intuned.io/api/v1/workspace/<workspace-id>/projects/<project-name>/run/start" \
  -H "x-api-key: <api-key>" \
  -H "content-type: application/json" \
  -d '{
    "api": "list",
    "parameters": {},
    "attributes": { "trigger": "manual", "batch": "2026-10-25" }
  }'
```

**Job payload**

Add `attributes` to a [payload item](https://intunedhq.com/docs/main/02-features/jobs-batched-executions.md#payload-configuration). Each Run created from that item starts with them:

```json theme={null}
"payload": [
  {
    "apiName": "list",
    "parameters": {},
    "attributes": { "trigger": "scheduled" }
  }
]
```

Initial attribute values must be strings, numbers, booleans, or lists of strings. Any other value type rejects the request with a `400`.

## How attributes work across Attempts

* **Each Attempt starts fresh.** It starts with a copy of the initial attributes, not with what a previous Attempt set. A retry doesn't see the failed Attempt's changes.
* **Each Attempt keeps its own.** You can see what every Attempt set on its Attempt details.
* **The Run reports its final Attempt's attributes.** Attributes are not merged across Attempts.
* **Deleted means gone.** If your code deletes every attribute, including the initial ones, the Run reports none.
* **Canceled before it ran.** A Run that is canceled before any Attempt reports keeps its initial attributes.
* **AuthSession Runs.** Validate and create Runs report the attributes of the Attempt their result comes from: the passing check, or the successful create when the AuthSession was recreated.

## Where attributes show up

| Where | What you get |
| - | - |
| Run and Attempt details in the dashboard | An **Attributes** tab with the Run's or Attempt's attributes |
| [Run result](https://intunedhq.com/docs/client-apis/api-reference/projectsruns/run-api--result.md) API | An `attributes` field, left out when the Run reported none |
| [Sinks](https://intunedhq.com/docs/main/02-features/runs-single-executions.md#get-results-without-polling) (webhook and S3) | `apiInfo.attributes` in each delivered payload |
| [Job result file](https://intunedhq.com/docs/main/02-features/jobs-batched-executions.md#job-result-file-schema) | `apiInfo.attributes` on each line |
| CLI | `intuned platform runs get` and `intuned platform attempts get` print them. Locally, `intuned dev run api` prints them and writes them to the `--output-file` |

## Limitations

* **Not for customer data.** Attributes are stored inline as operational metadata. Keep personal and regulated data in your API's result.
* **Small values only.** The limits above are enforced when your code sets an attribute. Use the API result for anything larger.
* **No merging across Attempts.** The Run reports only its final Attempt's attributes.
* **Requires a recent Runtime SDK.** `setAttribute` and `set_attribute` are available in the latest `@intuned/runtime` and `intuned-runtime`.

## Related resources

> **[setAttribute (TypeScript)](https://intunedhq.com/docs/main/05-references/runtime-sdk-typescript/run-attributes.md)**
>
> Runtime SDK reference

> **[set\_attribute (Python)](https://intunedhq.com/docs/main/05-references/runtime-sdk-python/run-attributes.md)**
>
> Runtime SDK reference

> **[Runs (single executions)](https://intunedhq.com/docs/main/02-features/runs-single-executions.md)**
>
> Start Runs and get their results

> **[Jobs (batched executions)](https://intunedhq.com/docs/main/02-features/jobs-batched-executions.md)**
>
> Batch and scheduled Runs


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.