# Workflow

> Workflows, built from a description or edited step by step, and run from code.

```python
brief = noclick.Workflow.create("Morning brief")
brief.build("Every day at 8, email me today's calendar").wait()
run = brief.run().wait()
```

Your keys read every workflow your account can open in the app, its own and
those shared with it (`access`), and change, build and run the ones they can
edit (one a team workspace's owner pays for is billed to them). NoClick's
builder (the one in the app) builds and changes one from what you describe: a
`WorkflowBuild` you wait on, which may stop to ask something first, and which
can publish the workflow's app too. A run starts where its trigger does, with
the inputs as the trigger's payload. A run started inside `as_user` (or with
`user=`) is recorded for that user and counts toward their spend cap; its
steps still use the app's connections.

A workflow's graph is also a handle you change directly: `graph()` reads its
steps, each `Step` changes with one call (`update`, `connect`, ...), and
`edit()` sends several changes as one batch that lands whole or not at all,
refused with `noclick.Conflict` when the workflow moved on since the version
you read. Every change is a version, listed by `versions()` and undone with
`restore(history_version=...)`.

## noclick.Workflow

```python
class Workflow
```

A workflow built in the NoClick app: its trigger, steps and outputs. Run it
with `run(inputs)`; `inputs` names what its trigger takes. `access` is
your account's: `owner`, `editor` or `viewer` (one shared with it);
building, running, testing and publishing it take edit access, billed to
whoever pays for it (a team workspace's owner; its app stays its owner's);
pausing and deleting it take owning it and paying for it.

It's also a handle to its graph: `graph()` reads its steps whole, each
`Step` changes with one call, and `edit()` sends several changes as one
version, checked against the version you read (`version`) when you say so.
Editing takes edit access, as the app's canvas does: an `editor` edits a
workflow shared with it.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |
| `name` | `str` |  |
| `description` | `str | None` |  |
| `inputs` | `dict[str, Any]` | A JSON schema of what `run` takes: a form's fields, any object for a webhook, empty if nothing. |
| `app_url` | `str | None` | Where to open it in the NoClick app. |
| `access` | `str` | Your account's access: `owner`, `editor` or `viewer`. |
| `folder_id` | `str | None` | The folder of your account's it's in (`Workflow.folders()`); `None` at the top, and for one shared with you. |
| `owner` | `dict[str, Any] | None` | Who owns it, for one shared with you (`{"name": ...}`); `None` for your account's own. Read on a listing. |
| `shared_at` | `Any` | When it was shared with you (`Workflow.shared_with_me()`). |
| `preview` | `dict[str, Any] | None` | Its graph as a picture of it needs it, `{nodes, edges}` in its saved shape (`Workflow.in_folder(..., preview=True)`); `None` when not asked for. |
| `step_types` | `list[str]` | What it's made of, at a glance, in a list too: at most four of its step types, its triggers first, then its agents (one on a coding harness as `agent:<harness>`, `agent:codex`), then the rest, never a note. |
| `created_at` | `Any` |  |
| `updated_at` | `Any` |  |
| `steps` | `list[WorkflowStep]` | Its steps in order, each with its settings, connection and trigger state (read with one workflow, not in a list). |
| `edges` | `list[dict[str, Any]]` | How its steps are wired: `{from, to, kind}`, `kind` `data` or `tools` (a step an agent uses as a tool). |
| `paused` | `bool` | Whether a pause switched its triggers off. |
| `readiness` | `dict[str, Any]` | Whether it's set up to run: `status` (`needs_setup`, `waiting_for_input`, `input_observed`, `configured`, `paused` when its triggers are all switched off, ...), what that status `meaning` is in a sentence, the `issues` in the way (a step whose last run failed among them), the `warnings` that don't stop it running (an agent's tool with no account connected), and `unverified`, the steps no run has completed yet, each `{step, code, message}`. An issue's `code` says whose move it is: `missing_credentials` waits on an account, `left_for_user` on a required setting the step leaves for its person to fill in, and `invalid_config` is a setting a run would refuse. |
| `urls` | `list[dict[str, Any]]` | The URLs it answers at: `{kind, url, step, public}`, `kind` `endpoint`, `app` (its published app) or `mcp` (a hosted MCP server). |
| `latest_build` | `WorkflowBuild | None` | The build `create(..., instructions=...)` or `build()` started here (`None` otherwise). |
| `version` | `int | None` | Its version as this handle last read or wrote it: what `edit(if_version=...)` checks against. Every change to its definition moves it on, and so do NoClick's own records of a trigger's registration. Reading it loads the workflow if nothing has yet. |
| `last_edit` | `WorkflowEdit | None` | What this handle's last edit did (`None` until one): its version, its summary, each op's results and each touched step's verdict. |

### Workflow.create

```python
noclick.Workflow.create(
    name=None, *, instructions=None, description=None, questions=None, folder=None,
    organization_id=None, client=None
) -> Workflow
```

A new workflow in your account. With `instructions` NoClick's
builder starts building it: wait on `latest_build`. A name your
account already has raises `noclick.Conflict` (change that one with
`build`); with none it takes the next free `Untitled` (`Untitled`,
`Untitled 2`, ...), as the app names a blank one.
`questions="assume"`: the builder asks nothing, as `build()` takes
it. `folder` (a `WorkflowFolder` or its id) files it there;
`organization_id` makes it in a team workspace you're in, billed to
whoever pays for it.

Parameters:

- `name` (`str | None`, default `None`)
- `instructions` (`str | None`, default `None`)
- `description` (`str | None`, default `None`)
- `questions` (`str | None`, default `None`)
- `folder` (`WorkflowFolder | str | None`, default `None`)
- `organization_id` (`str | None`, default `None`)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `Workflow` The new workflow; `latest_build` is its build when `instructions` describe it.

Usage:

```python
brief = noclick.Workflow.create(
    "Morning brief", instructions="Every day at 8, email me today's calendar and unread emails",
)
result = brief.latest_build.wait(timeout=900)
print(result.summary, [step.name for step in result.steps])
```

### Workflow.from_name

```python
noclick.Workflow.from_name(name, *, description=None, client=None) -> Workflow
```

A lazy reference to the workflow called `name` in the app. Two
workflows with the same name raise `noclick.Conflict` on first use
(rename one, or use `from_id`), and none raises `noclick.NotFound`
(`create` makes one).

Given `description`, it gets the workflow, then sets its description
when it differs, every time it runs; nothing else about the workflow is
touched. Set it in a setup script or at startup, and take the bare
handle in request handlers.

Parameters:

- `name` (`str`, required)
- `description` (`str | None`, default `None`)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `Workflow` A workflow that loads the first time it's used. Nothing is sent yet.

Usage:

Refer to a workflow by name:

```python
intake = noclick.Workflow.from_name("order-intake")
run = intake.run({"order_id": "o_1042"}).wait()
print(run.outputs)
```

Or get it and set its description:

```python
intake = noclick.Workflow.from_name("order-intake", description="Files each new order in Linear.")
print(intake.description)
```

### Workflow.from_id

```python
noclick.Workflow.from_id(workflow_id, *, client=None) -> Workflow
```

A lazy reference to a workflow by id.

Parameters:

- `workflow_id` (`str`, required)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `Workflow` A workflow that loads the first time it's used. Nothing is sent yet.

Usage:

```python
intake = noclick.Workflow.from_id("2e3a9296-1bf5-4088-a20d-7c31937380c4")
print(intake.name, intake.inputs)
```

### Workflow.get

```python
noclick.Workflow.get(workflow_id, *, client=None) -> Workflow
```

Load a workflow by id now; an unknown id raises `noclick.NotFound`.

Parameters:

- `workflow_id` (`str`, required)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `Workflow` The workflow, loaded.

Usage:

```python
intake = noclick.Workflow.get("2e3a9296-1bf5-4088-a20d-7c31937380c4")
print(intake.name, intake.app_url)
```

### Workflow.list

```python
noclick.Workflow.list(
    *, q=None, search=None, limit=None, credential_id=None, client=None
) -> list[Workflow]
```

Your account's workflows, most recently changed first. `q` is a
case-insensitive prefix of the name; `search`, text its name or
description holds, in any case; `credential_id` keeps those whose
steps use that connected account (`Connection.credential_id`).

Parameters:

- `q` (`str | None`, default `None`)
- `search` (`str | None`, default `None`)
- `limit` (`int | None`, default `None`): Return at most this many.
- `credential_id` (`str | None`, default `None`)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `list[Workflow]` Every matching workflow, fetched page by page (or the first `limit`).

Usage:

```python
for workflow in noclick.Workflow.list():
    print(workflow.name, workflow.updated_at)
```

### Workflow.list_page

```python
noclick.Workflow.list_page(
    *, cursor=None, limit=None, q=None, search=None, credential_id=None, client=None
) -> Page
```

One page of workflows; pass `next_cursor` back as `cursor`.

Parameters:

- `cursor` (`str | None`, default `None`): The `next_cursor` of the page before; omit it for the first page.
- `limit` (`int | None`, default `None`): Return at most this many.
- `q` (`str | None`, default `None`)
- `search` (`str | None`, default `None`)
- `credential_id` (`str | None`, default `None`)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `Page` A page whose `data` holds the workflows and whose `next_cursor` is `None` on the last page.

Usage:

```python
page = noclick.Workflow.list_page(limit=25)
for workflow in page.data:
    print(workflow.name)
```

### Workflow.folders

```python
noclick.Workflow.folders(
    *, organization_id=None, shared_with_me=False, client=None
) -> list[WorkflowFolder]
```

Your account's workflow folders, as the app's Automations page shows
them: the ones it made in its own workspace, the shallowest first, then
by name. A workflow's `folder_id` names the one it's in.
`organization_id`: a team workspace your account's person is in, every
folder there (a teammate's with `access` `viewer`);
`shared_with_me`: the folders others shared with you.

Parameters:

- `organization_id` (`str | None`, default `None`)
- `shared_with_me` (`bool`, default `False`)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `list[WorkflowFolder]` Each folder, with its `parent_id` (`None` at the top) and its `workflow_count`.

Usage:

```python
for folder in noclick.Workflow.folders():
    print("  " * folder.depth + folder.name, folder.workflow_count)
```

### Workflow.in_folder

```python
noclick.Workflow.in_folder(
    folder, *, organization_id=None, preview=False, client=None
) -> WorkflowFolderListing
```

The workflows of one folder (a `WorkflowFolder`, its id, or
`None` for the top) as the app's Automations page lists them, most
recently changed first, each with its `owner` (`None` for your
account's own). `preview=True` adds each one's `preview`. In a team
workspace with `organization_id`.

Parameters:

- `folder` (`WorkflowFolder | str | None`, required)
- `organization_id` (`str | None`, default `None`)
- `preview` (`bool`, default `False`)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `WorkflowFolderListing` The workflows, and how many shared with you your plan left out.

Usage:

```python
for workflow in noclick.Workflow.in_folder(None, preview=True).workflows:
    print(workflow.name, len(workflow.preview["nodes"]))
```

### Workflow.shared_with_me

```python
noclick.Workflow.shared_with_me(*, client=None) -> list[Workflow]
```

The workflows others shared with your account's person, newest share
first, each with its `access`, `owner` (who shared it) and
`shared_at`.

Parameters:

- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `list[Workflow]` Each workflow shared with you.

Usage:

```python
for workflow in noclick.Workflow.shared_with_me():
    print(workflow.name, workflow.owner["name"], workflow.access)
```

### Workflow.update_folder

```python
noclick.Workflow.update_folder(
    folder, *, name=None, description=None, parent=_KEEP, organization_id=None,
    client=None
) -> WorkflowFolder
```

Rename one of your account's folders, change its line, or move it
into another of its folders (`parent`: a `WorkflowFolder`, its id,
or `None` for the top), as the app's rename and drag do. A folder never
goes into itself or one inside it.

Parameters:

- `folder` (`WorkflowFolder | str`, required)
- `name` (`str | None`, default `None`)
- `description` (`str | None`, default `None`)
- `parent` (`WorkflowFolder | str | object | None`, default `_KEEP`)
- `organization_id` (`str | None`, default `None`)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `WorkflowFolder` The folder as it is now.

Usage:

```python
noclick.Workflow.update_folder(reports, name="Weekly reports", parent=None)
```

### Workflow.create_folder

```python
noclick.Workflow.create_folder(
    name, *, description=None, parent=None, organization_id=None, client=None
) -> WorkflowFolder
```

A new folder in your account's workspace, at the top or in
`parent` (a `WorkflowFolder` or its id), as the app makes one. A
name `parent`'s folders already have raises `noclick.Conflict`,
naming that folder (`folder_id`).

Parameters:

- `name` (`str`, required)
- `description` (`str | None`, default `None`)
- `parent` (`WorkflowFolder | str | None`, default `None`)
- `organization_id` (`str | None`, default `None`)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `WorkflowFolder` The new folder.

Usage:

```python
reports = noclick.Workflow.create_folder("Reports")
weekly = noclick.Workflow.create_folder("Weekly", parent=reports)
noclick.Workflow.from_name("Morning brief").move_to(weekly)
```

### Workflow.delete_folder

```python
noclick.Workflow.delete_folder(
    folder, *, organization_id=None, client=None
) -> WorkflowFolder
```

Delete one of your account's folders (a `WorkflowFolder` or its
id), as the app does: the workflows in it move to its parent (the top,
for one at the top) and the folders in it go with it, their workflows
moving to the top. No workflow is deleted.

Parameters:

- `folder` (`WorkflowFolder | str`, required)
- `organization_id` (`str | None`, default `None`)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `WorkflowFolder` The folder as it was.

Usage:

```python
for folder in noclick.Workflow.folders():
    if folder.workflow_count == 0:
        noclick.Workflow.delete_folder(folder)
```

### Workflow.move_to

```python
workflow.move_to(folder, *, organization_id=None) -> Workflow
```

Move it into one of your account's folders (a `WorkflowFolder` or
its id), or out to the top with `None`, as dragging it does in the app.
It takes what changing it takes: owning it and paying for it.

Parameters:

- `folder` (`WorkflowFolder | str | None`, required)
- `organization_id` (`str | None`, default `None`)

Returns: `Workflow` This workflow, read again (`folder_id` is the folder it's in now).

Usage:

```python
brief = noclick.Workflow.from_name("Morning brief")
brief.move_to(noclick.Workflow.create_folder("Reports"))
brief.move_to(None)   # back to the top
```

### Workflow.fork

```python
workflow.fork(*, name=None, organization_id=None) -> Workflow
```

A copy of it, your account's own, as the app's Copy makes one: none
of the accounts its steps used, none of its runs, a `per_user`
variable emptied for you to fill. Named `name`, else "Copy of" its
name; in a team workspace with `organization_id`.

Parameters:

- `name` (`str | None`, default `None`)
- `organization_id` (`str | None`, default `None`)

Returns: `Workflow` The copy, in full.

Usage:

```python
mine = noclick.Workflow.from_name("Their brief").fork(name="My brief")
```

### Workflow.graph

```python
workflow.graph() -> WorkflowGraph
```

Read its definition whole: its name, description and settings, every step with its
settings as stored (never a secret), its notes and edges, at its current `version`.

Returns: `WorkflowGraph` The `WorkflowGraph`; this handle's `version` is now its.

Usage:

```python
brief = noclick.Workflow.from_name("Morning brief")
graph = brief.graph()
for step in graph.steps:
    print(step.id, step.type, step.name, step.settings)
print(graph.edges, graph.version)
```

### Workflow.variables

```python
workflow.variables() -> WorkflowVariables
```

Read its variables with their values, which `graph()` and every other read hold
back (`settings_withheld`, `variables_withheld`).

For the workflow's owner and the teammates who can edit it: signed in, or with one
of their account's own secret keys that names the `workflows:variables` scope (a
key with every scope, `*`, holds it only when it's named too) and acts for no
user. Anyone else raises `noclick.PermissionDenied`: someone who only views the
workflow, a user's session, an app's code, an agent or an MCP connection. Writing a
variable stays its owner's. A step reads a variable as `{{vars.name}}` without
this call.

Returns: `WorkflowVariables` The `WorkflowVariables`: its `definitions` whole, the graph's own
`variables`, and `values` by name.

Usage:

```python
owner = noclick.Client(api_key="nk_live_...")   # a key that names workflows:variables
brief = noclick.Workflow.from_name("Morning brief", client=owner)
for name, value in brief.variables().values.items():
    print(name, "is set" if value else "is empty")
```

### Workflow.state

```python
workflow.state(*, step=None) -> WorkflowState
```

Read what its State step keeps (`step`, else its first), as its interfaces read it.

Parameters:

- `step` (`str | None`, default `None`)

Returns: `WorkflowState` The `WorkflowState`: `values` by key, and the `step_id` keeping them.

Usage:

```python
counter = noclick.Workflow.from_name("Visit counter")
print(counter.state().values.get("visits", 0))
```

### Workflow.set_state

```python
workflow.set_state(key, value, *, step=None) -> WorkflowState
```

Set one key its State step keeps (`step`, else its first), as its interfaces do;
`None` takes the key out. Takes edit access to the workflow.

Parameters:

- `key` (`str`, required)
- `value` (`Any`, required)
- `step` (`str | None`, default `None`)

Returns: `WorkflowState` The `WorkflowState` after.

Usage:

```python
counter = noclick.Workflow.from_name("Visit counter")
counter.set_state("visits", 0)
```

### Workflow.setup

```python
workflow.setup() -> WorkflowSetup
```

Read what the workflow needs from its person before it can run: the accounts to
connect, the values only they know and the variables an agent step's shell asked
for, derived from the workflow as it stands. Code that builds without a person reads
this and connects or fills in each item itself; a build's result carries it too
(`setup`).

Returns: `WorkflowSetup` The `WorkflowSetup`: its `items`, whether it's `ready`, and the setup
`request` still waiting on the person.

Usage:

```python
brief = noclick.Workflow.from_name("Morning brief")
for item in brief.setup().items:
    print(item["kind"], item["label"])
```

### Workflow.lend_connection

```python
workflow.lend_connection(connection) -> dict[str, Any]
```

Let this workflow's automatic runs, which go as its owner, use a connection of your account's own
(`credential:<id>`) that its owner's runs can't, as the app does when a member of its team workspace picks
their own account on a step: it reaches this workflow alone, and no one else reads its secret, but anyone who
can edit the workflow can make it act as you. Your own workflow's steps need no lend.

Parameters:

- `connection` (`str`, required)

Returns: `dict[str, Any]` `lent`, with what to tell the person (`notice`: `title`, `detail`), or false when there was
nothing to lend (yours already, lent before, or one its owner's runs reach).

Usage:

```python
shared = noclick.Workflow.from_name("Team digest").lend_connection("credential:...")
print(shared["lent"], (shared["notice"] or {}).get("title"))
```

### Workflow.take_back_connection

```python
workflow.take_back_connection(connection) -> dict[str, Any]
```

Take back a connection of yours lent to this workflow's runs (`lend_connection`): they can't use it from
now on.

Parameters:

- `connection` (`str`, required)

Returns: `dict[str, Any]` `withdrawn`: whether it was lent.

Usage:

```python
noclick.Workflow.from_name("Team digest").take_back_connection("credential:...")
```

### Workflow.request_setup

```python
workflow.request_setup(*, via='auto') -> WorkflowSetup
```

Send what the workflow needs to the account's owner as ONE request: one message
and one page, where they connect each app and fill in each value, each part landing
on the workflow as they give it. An app the account holds exactly one working
connection of is connected at once, asking nobody. The same list already waiting
isn't sent again (`sent` is None); a different one replaces it. Needs the
`workflows` and `humans` scopes, acting for the whole account.

Args:
via: How it reaches the owner: `"auto"` (the app they last texted NoClick on,
else email), or a list of `web`, `email`, `whatsapp`, `imessage`,
`sms`.

Parameters:

- `via` (`Any`, default `'auto'`)

Returns: `WorkflowSetup` The `WorkflowSetup` as `setup()` reads it, with `sent`: the request's
operation (its `request` naming `delivered_via`), or None.

Usage:

```python
brief = noclick.Workflow.from_name("Morning brief")
done = brief.request_setup()
print("sent" if done.sent else "nothing new to ask", [i["label"] for i in done.items])
```

### Workflow.step

```python
workflow.step(step_id) -> Step
```

A handle to one of its steps by id. Nothing is sent: an edit through it names the
step by its id, and its fields load from the graph the first time you read one (a step
that isn't there raises `noclick.NotFound` then, or when an edit names it).

Parameters:

- `step_id` (`str`, required)

Returns: `Step` The `Step`.

Usage:

```python
brief = noclick.Workflow.from_name("Morning brief")
brief.step("summarize").connect("send_summary")
```

### Workflow.add_step

```python
workflow.add_step(
    type, *, operation=None, settings=None, name=None, id=None, position=None,
    secrets=None, left_for_user=None
) -> Step
```

Add a step of `type` (`automation-gmail`, `agent`, `trigger-cron`) doing
`operation` with `settings`, as one edit. `id` names it (made from its type when
left out); without `position` it's laid out beside the rest. It's judged as the app's
builder judges one: a type, operation or value that can't be is refused with
`noclick.InvalidRequest` naming it, and a setting it can't run without yet is in its
`verdict`. A trigger's schedule or webhook registers once it's added. An agent step's
`secrets` and the settings `left_for_user` (a value only its person knows, left for
them to fill in) are as `Step.update` takes them.

Parameters:

- `type` (`str`, required)
- `operation` (`str | None`, default `None`)
- `settings` (`dict[str, Any] | None`, default `None`)
- `name` (`str | None`, default `None`)
- `id` (`str | None`, default `None`)
- `position` (`Position | None`, default `None`)
- `secrets` (`Any`, default `None`)
- `left_for_user` (`Any`, default `None`)

Returns: `Step` The new `Step`, with its `verdict` and what the edit said about it (`notes`).

Usage:

```python
brief = noclick.Workflow.from_name("Morning brief")
send = brief.add_step(
    "automation-gmail", operation="send_email_message", name="Send the summary",
    settings={"to": "team@acme.com", "subject": "Today", "body": "{{ $('summarize').text }}"},
)
brief.step("summarize").connect(send)
print(send.id, send.verdict)
```

### Workflow.update

```python
workflow.update(
    *, name=None, description=None, settings=None, display_metadata=None,
    interface=None
) -> Workflow
```

Change its name, description or settings (by top-level key; only its owner changes
those, and NoClick's own are refused). A field you leave out is never touched.
`display_metadata` replaces what the app shows of it (its canvas's viewport), never a
version; `interface` its Interface tab's layout as the app draws it, part of its graph.

Parameters:

- `name` (`str | None`, default `None`)
- `description` (`str | None`, default `None`)
- `settings` (`dict[str, Any] | None`, default `None`)
- `display_metadata` (`dict[str, Any] | None`, default `None`)
- `interface` (`dict[str, Any] | None`, default `None`)

Returns: `Workflow` This workflow; it loads again the next time you read a field.

Usage:

```python
brief = noclick.Workflow.from_name("Morning brief")
brief.update(name="Team brief", description="Emails the team the day's calendar at 8.")
```

### Workflow.add_note

```python
workflow.add_note(
    content, *, id=None, color=None, near=None, direction=None, after=None,
    before=None, width=None, height=None
) -> Step
```

Put a note on the canvas: `near` some steps (`direction`: `above`, the
default, `below`, `left` or `right`), or over a stretch of them from `after`
to `before`. `color` is the app's 0 to 20; `width` and `height` its size.

Parameters:

- `content` (`str`, required)
- `id` (`str | None`, default `None`)
- `color` (`int | None`, default `None`)
- `near` (`Sequence[Any] | None`, default `None`)
- `direction` (`str | None`, default `None`)
- `after` (`Any`, default `None`)
- `before` (`Any`, default `None`)
- `width` (`int | None`, default `None`)
- `height` (`int | None`, default `None`)

Returns: `Step` The note: a `Step` of type `stickyNote` (its text is `settings["content"]`).

Usage:

```python
brief = noclick.Workflow.from_name("Morning brief")
note = brief.add_note("Runs at 8 on weekdays; edit the schedule in its trigger.", near=["every_morning"])
print(note.id)
```

### Workflow.move

```python
workflow.move(step, position) -> Step
```

Move a step (or a note) on the canvas to `(x, y)` (or `{"x", "y"}`). Where
things sit is never a version of its own.

Parameters:

- `step` (`Any`, required)
- `position` (`Position`, required)

Returns: `Step` The step, at its new `position`.

Usage:

```python
brief = noclick.Workflow.from_name("Morning brief")
brief.move("send_summary", (640, 120))
```

### Workflow.edit

```python
workflow.edit(
    *, if_version=None, include_graph=False, source=None, origin=None, settle=False
) -> EditBatch
```

Collect several edits and send them as one batch when the `with` block ends:
they're applied in order and land as one version, or none of them do. With
`if_version` (a version you read: `version`, `graph().version`, or the last
edit's) the batch is refused with `noclick.Conflict` when the workflow moved on since,
and the error carries the workflow as it stands (`graph` and `version`), so your code
decides again from what's there. `include_graph=True` has the answer carry the
workflow as written, read as `graph()` reads it.

A batch that can't be undone from its versions alone (one that removes a step holding an
app, conversations or files) may be held for the account's owner when an agent, a
connected app or a deployed app's code sends it: it raises `noclick.ApprovalRequired`,
nothing of it has landed, and NoClick applies it once they approve: its `operation`
settles then, with the batch's answer. The workflow one of your agents runs on is
edited as its canvas edits it: the agent follows its prompt, harness and model, its own
step stays (removing it raises `noclick.InvalidRequest` naming the agent), and a key
that couldn't change the agent can't change it this way either.

`source="canvas"` says the edits are a canvas's saves, as the app's canvas sends them:
each setting `update_step` sends replaces that setting whole and is kept as written
(never rewritten nor refused for its value; the step's verdict says it isn't ready),
an edge joins the handles it names, a connection sits under the slot it's given (one the
step takes), and they join the canvas session's version (saves within five minutes of its
first, whoever made them). `origin` is a name the sender gives itself (letters, digits,
`-` and `_`, up to 64; a canvas tab's own id): what the workflow's open canvases hear
of the write names it, so the canvas that sent it knows the change is its own.

`settle=True` waits, up to 30 seconds, for what the batch sets going (a trigger's
registration: its webhook, its schedule, its inbox; a removed step's teardown) before the
answer: `result.settled` says whether it finished in time, the graph (with
`include_graph`) carries what it wrote on the steps (a trigger's `webhook_url`), and
`result.unregistered` names, by step, why each trigger it left unregistered can't be yet.

Parameters:

- `if_version` (`int | None`, default `None`)
- `include_graph` (`bool`, default `False`)
- `source` (`str | None`, default `None`)
- `origin` (`str | None`, default `None`)
- `settle` (`bool`, default `False`)

Returns: `EditBatch` An `EditBatch` to use as a context manager (`async with` in async code);
its `result` is the `WorkflowEdit` once the block ends.

Usage:

Add a step and wire it in, both or neither:

```python
brief = noclick.Workflow.from_name("Morning brief")
with brief.edit() as e:
    post = e.add_step("automation-slack", operation="send_message_to_channel",
                      settings={"channel": "#team", "text": "{{ $('summarize').text }}"})
    e.connect("summarize", post)
print(e.result.summary)
```

Read, decide, then change only if nothing changed in between, and decide again if it did:

```python
brief = noclick.Workflow.from_name("Morning brief")
graph = brief.graph()
for attempt in range(3):
    send = graph.step("Send the summary")
    try:
        with brief.edit(if_version=graph.version) as e:
            e.update_step(send, settings={"cc": ["ops@acme.com", *send.settings.get("cc", [])]})
        break
    except noclick.Conflict as changed:
        graph = changed.graph   # the workflow as it stands; decide again from it
```

### Workflow.settle

```python
workflow.settle(*, include_graph=False) -> WorkflowEdit
```

Wait, up to 30 seconds, for what earlier edits set going (their triggers' registrations,
removed steps' teardowns), changing nothing, as an edit with `settle=True` waits for its own.

Parameters:

- `include_graph` (`bool`, default `False`)

Returns: `WorkflowEdit` A `WorkflowEdit`: `settled` (whether it finished in time), `unregistered` (by step,
why each trigger left unregistered can't be yet) and, with `include_graph`, the workflow
as that left it.

Usage:

```python
brief = noclick.Workflow.from_name("Morning brief")
with brief.edit() as e:
    e.add_step("trigger-webhook", id="hook", name="Order placed")
print(brief.settle(include_graph=True).graph.step("hook").settings["webhook_url"])
```

### Workflow.versions

```python
workflow.versions(*, limit=20, named=False, recent=False) -> list[WorkflowVersion]
```

Its versions, newest first, kept 90 days (a named one for good): each one's number,
where it came from, who made it and what changed. `named=True` lists only the named
ones, its checkpoints; `recent=True` only its latest unnamed ones to go back to (never
the one it's at), each with its `step_count`, as the app's Versions list offers them.

Parameters:

- `limit` (`int | None`, default `20`): Return at most this many.
- `named` (`bool`, default `False`)
- `recent` (`bool`, default `False`)

Returns: `list[WorkflowVersion]` The first `limit` versions (20 by default; `None` for all of them), fetched page by page.

Usage:

```python
brief = noclick.Workflow.from_name("Morning brief")
for version in brief.versions(limit=10):
    print(version.version, version.source, version.summary, version.created_at)
```

### Workflow.name_version

```python
workflow.name_version(
    label, *, note=None, history_version=None, if_version=None
) -> WorkflowVersion
```

Name a version of its history, keeping it for good while it has a name: the version
it's at now (a checkpoint, as the app saves one; `if_version` refuses it with
`noclick.Conflict` when the workflow moved on since you read it), or the one
`history_version` names, or another name for a named one. No later change joins a
named version. Naming the version it's at now when it has a name already raises
`noclick.Conflict` naming it (`label`). Restore it with
`restore(history_version=...)`. A name someone else gave is changed only by them or the
workflow's owner.

Parameters:

- `label` (`str`, required)
- `note` (`str | None`, default `None`)
- `history_version` (`int | None`, default `None`)
- `if_version` (`int | None`, default `None`)

Returns: `WorkflowVersion` The named `WorkflowVersion`.

Usage:

```python
brief = noclick.Workflow.from_name("Morning brief")
saved = brief.name_version("Before the Slack change", note="Sends at 8.")
brief.step("send_summary").update(settings={"channel": "#team"})
brief.restore(history_version=saved.history_version)   # back to it
```

### Workflow.unname_version

```python
workflow.unname_version(history_version) -> WorkflowVersion
```

Take a version's name away (a checkpoint deleted): it's kept 90 days from its last
write then, as any version. Only who named it or the workflow's owner takes it away.

Parameters:

- `history_version` (`int`, required)

Returns: `WorkflowVersion` The `WorkflowVersion`, its `label` `None`.

Usage:

```python
brief = noclick.Workflow.from_name("Morning brief")
for version in brief.versions(named=True, limit=None):
    if version.label.startswith("tmp"):
        brief.unname_version(version.history_version)
```

### Workflow.versions_page

```python
workflow.versions_page(*, cursor=None, limit=None, named=False) -> Page
```

One page of its versions, newest first; pass `next_cursor` back as `cursor`.

Parameters:

- `cursor` (`str | None`, default `None`): The `next_cursor` of the page before; omit it for the first page.
- `limit` (`int | None`, default `None`): Return at most this many.
- `named` (`bool`, default `False`)

Returns: `Page` A page whose `data` holds the versions and whose `next_cursor` is `None` on the last page.

Usage:

```python
brief = noclick.Workflow.from_name("Morning brief")
page = brief.versions_page(limit=50)
while True:
    for version in page.data:
        print(version.version, version.summary)
    if page.next_cursor is None:
        break
    page = brief.versions_page(limit=50, cursor=page.next_cursor)
```

### Workflow.version_at

```python
workflow.version_at(history_version) -> WorkflowVersion
```

One version of its history, by its `history_version`, with the definition it
holds. A version it doesn't have (kept 90 days) raises `noclick.NotFound`.

Parameters:

- `history_version` (`int`, required)

Returns: `WorkflowVersion` The `WorkflowVersion`; its `graph` is the workflow as it was: its name,
description, settings and steps.

Usage:

```python
brief = noclick.Workflow.from_name("Morning brief")
before = brief.version_at(11)
print(before.graph.name, [step.name for step in before.graph.steps])
```

### Workflow.build

```python
workflow.build(instructions=None, *, publish=None, questions=None) -> WorkflowBuild
```

Change the workflow by describing the change; NoClick's builder makes
it, reading the workflow as it stands. `publish=True` then puts its
app live (or pass `{"subdomain": "morrow", "title": ...}`; `publish()`
and `unpublish()` publish without a change). One build at a time:
another in progress raises `noclick.Conflict`. A change costs AI
usage, as building in the app does.

What the builder can't decide it asks the person whose build it is (you
as the account's owner, or the user your key acts for): each input of its
question is a human request NoClick sends them, which any client answers.
`questions="assume"` asks nothing: the builder decides, and its summary
and the workflow's readiness say what it assumed and what's missing.

Parameters:

- `instructions` (`str | None`, default `None`)
- `publish` (`bool | dict[str, Any] | None`, default `None`)
- `questions` (`str | None`, default `None`)

Returns: `WorkflowBuild` A `WorkflowBuild`: `wait()` gives the `WorkflowBuildResult` (its `steps`, and what was
`published`), and `next_question()` returns anything it asks first.

Usage:

```python
brief = noclick.Workflow.from_name("Morning brief")
result = brief.build("Also post the brief to #team on Slack").wait(timeout=900)
print(result.summary)
```

### Workflow.builder

```python
workflow.builder() -> WorkflowBuilder
```

Where the workflow's builds are talked through: the account's builder agent and the conversation this
workflow's builds share (read it as any agent conversation: `Agent.from_id(agent_id).history(conversation)`),
and its build under way or waiting on a question.

Returns: `WorkflowBuilder` A `WorkflowBuilder`: `agent_id` and `conversation` are None where your builds aren't the agent's
(a user's key, an app's code), or it was never made; `build` is None when nothing is building.

Usage:

```python
found = noclick.Workflow.from_name("Morning brief").builder()
if found.agent_id:
    print(noclick.Agent.from_id(found.agent_id).history(found.conversation))
```

### Workflow.draft

```python
workflow.draft(
    steps, *, mode='full', field=None, instructions=None, write=True
) -> Operation
```

Have NoClick's drafter (the builder's own) pick `steps`' operations and fill their settings, the steps
together. Each step is a `Step`, its id, or `{"id": ..., "goal": ...}`: its goal says what it's for (the
drafter reads it, and a drafted step keeps it). `mode` is `full` (pick each step's operation and fill
its settings; a step drafts against the operation each step it reads was given), `operation` (pick only
the operation), `fields` (fill the settings of the operation a step has) or `field` (fill the one
setting `field` names). `instructions` say what the workflow does. A step the workflow doesn't have, a
note, a step that provides an agent its tools or a setting it doesn't have raises
`noclick.InvalidRequest` before anything runs. What's drafted lands as one version of the workflow,
written as an edit with your key is; the drafter never connects an account. `write=False` drafts the same
and writes nothing: the result's `edits` are the edits a write would make, for you to apply as your own
change (`edit()` takes them as they are). It costs its AI usage, at cost, written or not.

Parameters:

- `steps` (`Sequence[Any]`, required)
- `mode` (`str`, default `'full'`)
- `field` (`str | None`, default `None`)
- `instructions` (`str | None`, default `None`)
- `write` (`bool`, default `True`)

Returns: `Operation` An operation (kind `workflow.draft`) that reports each step as it lands (`progress`); `wait()`
gives the `WorkflowDraftResult`, each step's verdict among it, or raises when no step could be drafted.

Usage:

```python
brief = noclick.Workflow.from_name("Morning brief")
with brief.edit() as batch:
    batch.add_step("automation-gmail", id="fetch")
    batch.add_step("automation-slack", id="post")
    batch.connect("fetch", "post")
drafted = brief.draft([{"id": "fetch", "goal": "Read today's unread email"},
                       {"id": "post", "goal": "Post a summary to #team"}]).wait()
for step_id, step in drafted.steps.items():
    print(step_id, step["operation"], step["unfilled"], step["references"])
```

### Workflow.publish

```python
workflow.publish(*, subdomain=None, title=None) -> WorkflowBuild
```

Put the workflow's app live as it now stands, at `subdomain`
(`morrow` is `morrow.noclick.app`; omitted, the address it has).

Parameters:

- `subdomain` (`str | None`, default `None`)
- `title` (`str | None`, default `None`)

Returns: `WorkflowBuild` A `WorkflowBuild` whose result's `published` holds the app's `url`.

Usage:

```python
site = noclick.Workflow.from_name("Morrow Bakehouse site")
print(site.publish(subdomain="morrow").wait().published["url"])
```

### Workflow.unpublish

```python
workflow.unpublish() -> WorkflowBuild
```

Take the workflow's app down, to the trash: its public URL stops answering. For 30 days its address
stays its own, and restoring it (or `publish()`) brings it back there with the same key.

Returns: `WorkflowBuild` A `WorkflowBuild`; its result's `published` says `unpublished`, with the `trash_id` that
restores it and until when (`restorable_until`).

Usage:

```python
done = noclick.Workflow.from_name("Morrow Bakehouse site").unpublish().wait()
noclick.TrashItem.from_id(done.published["trash_id"]).restore()
```

### Workflow.pause

```python
workflow.pause(reason=None) -> Workflow
```

Switch off each of its triggers that's on, with `reason` beside them
in the app: nothing starts it on its own until you `resume()`. Runs
from code still start.

Parameters:

- `reason` (`str | None`, default `None`)

Returns: `Workflow` This workflow, read again (`paused` is `True`).

Usage:

```python
digest = noclick.Workflow.from_name("Hourly digest")
digest.pause("Too noisy over the weekend")
```

### Workflow.resume

```python
workflow.resume() -> Workflow
```

Switch back on each trigger a pause switched off (never one turned off by hand).

Returns: `Workflow` This workflow, read again.

Usage:

```python
noclick.Workflow.from_name("Hourly digest").resume()
```

### Workflow.restore

```python
workflow.restore(*, history_version=None, if_version=None) -> Workflow
```

Bring the workflow back from the trash (within 30 days of `delete()`);
its schedules and webhooks register again.

With `history_version`, put that version of its history back instead (`versions()`
lists them): its graph, name, description and settings, as a new version of its own
(source `restore`), so it's undone by restoring the one before it. `if_version`
(the workflow's `version` you read) refuses it with `noclick.Conflict`, carrying the
workflow as it stands, when the workflow moved on since. One that takes away a step
holding an app, conversations or files may be held for the account's owner, as a batch
is (`noclick.ApprovalRequired`).

Parameters:

- `history_version` (`int | None`, default `None`)
- `if_version` (`int | None`, default `None`)

Returns: `Workflow` This workflow. Out of the trash it's read again; after a version's restore,
`version` is the new one, `last_edit` says what it did (`restored_from`,
`summary`) and its fields load again the next time you read one.

Usage:

Out of the trash:

```python
noclick.Workflow.from_id("2e3a9296-1bf5-4088-a20d-7c31937380c4").restore()
```

Undo the last change, unless something changed since you looked:

```python
brief = noclick.Workflow.from_name("Morning brief")
now = brief.graph().version
latest, before = brief.versions(limit=2)
brief.restore(history_version=before.history_version, if_version=now)
print(brief.last_edit.summary)   # restored version 11
```

### Workflow.delete

```python
workflow.delete() -> None
```

Move the workflow to the trash: its schedules and webhooks stop now,
and `restore()` brings it back within 30 days.

Returns: Nothing.

Usage:

```python
noclick.Workflow.from_name("Old digest").delete()
```

### Workflow.delete_for_good

```python
workflow.delete_for_good() -> None
```

Delete a workflow in your account's trash for good, as the app's
Trash does: its runs, files, tables and published apps go with it, and
nothing restores it. Move it to the trash with `delete()` first.

Returns: Nothing.

Usage:

```python
for workflow in noclick.Workflow.trashed():
    workflow.delete_for_good()
```

### Workflow.trashed

```python
noclick.Workflow.trashed(*, client=None) -> list[Workflow]
```

Your account's workflows in the trash, the newest deleted first, as
the app's Trash lists them: each one's `raw` holds its `deleted_at`
and `purge_after`, when it's deleted for good unless `restore()`
brings it back first.

Parameters:

- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `list[Workflow]` Each workflow in the trash.

Usage:

```python
for workflow in noclick.Workflow.trashed():
    print(workflow.name, workflow.raw["purge_after"])
```

### Workflow.run

```python
workflow.run(
    inputs=None, *, from_step=None, only=False, manual=None, user=...,
    idempotency_key=None
) -> Operation
```

Start a run with `inputs` (checked against `inputs`, the workflow's
schema; a mismatch raises `noclick.InvalidRequest` naming the field).
What would stop the run is refused before anything runs: a step with no
account connected raises `noclick.NeedsConnection`, and a workflow that
can't start from code (several triggers and no Run trigger, or only
events an integration pushes) or isn't set up `noclick.ActionRequired`.

`from_step` (a `Step` or its id) runs that step and what comes after
it instead, the steps before it giving the outputs they last stored, as
the app's Run from here does; with `only=True` that step alone. A run
from a step takes no inputs, unless it's a trigger that does. A step
that provides an agent its tools has no run of its own
(`noclick.InvalidRequest`, `details["reason"]` `tool_provider`).

`manual` runs it as the app's Run button does (`{}` for a plain
one): no trigger has to start runs from code (one no event fired gives
its no-event placeholder), its setup isn't judged up front, and inputs
go to the trigger or form step it starts at. Its keys: `steps` (only
these run), `forward_only` (`False`: the steps before `from_step`
run again too), `settings` (one-run settings by step id, nothing
saved), `outputs_from` (a step id to the run whose stored output
stands in for it) and `background`. Someone it's shared with to view
may run it so as saved, giving values only to a trigger.

Parameters:

- `inputs` (`dict[str, Any] | None`, default `None`)
- `from_step` (`Any`, default `None`)
- `only` (`bool`, default `False`)
- `manual` (`dict[str, Any] | None`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `idempotency_key` (`str | None`, default `None`): Makes a retried create safe: the same key returns the first result. Generated when omitted.

Returns: `Operation` An operation whose `.wait()` gives the finished `WorkflowRun`, or
raises the run's error if it failed.

Usage:

Run it and wait for the outputs:

```python
intake = noclick.Workflow.from_name("order-intake")
run = intake.run({"order_id": "o_1042", "rush": True}).wait(timeout=300)
print(run.outputs["summary"])
```

Record the run for a user, and make a retried request safe:

```python
intake = noclick.Workflow.from_name("order-intake")
op = intake.run({"order_id": "o_1042"}, user="acme", idempotency_key="order-o_1042")
print(op.id)   # resume anywhere with noclick.Operation.from_id(op.id).wait()
```

Try one step again on what came in last, nothing after it:

```python
intake = noclick.Workflow.from_name("order-intake")
run = intake.run(from_step="summarize", only=True).wait()
```

### Workflow.test_runs

```python
workflow.test_runs() -> list[WorkflowTestRun]
```

The test runs the workflow offers, as its Test Run screen lists them: for each trigger an agent comes
after, the staged situations NoClick offers for it (under the names the workflow gave them, with its edits
to their messages, less the ones it removed) and the runs it authored (`edit().add_test_run`). Empty for
a workflow with no trigger a test can stage. Reading them costs nothing.

Returns: `list[WorkflowTestRun]` Each `WorkflowTestRun`, in the order `rehearse` finds them: its `key` and `name` (either names
it to `rehearse`), the `trigger` it stages on and its staged `message`.

Usage:

```python
inbox = noclick.Workflow.from_name("Support inbox")
for run in inbox.test_runs():
    print(run.name, run.trigger["label"], run.message.get("title"))
test = inbox.rehearse(inbox.test_runs()[0].key).wait()
```

### Workflow.rehearse

```python
workflow.rehearse(
    test_run=None, *, trigger=None, body=None, title=None, author=None, handle=None,
    scenario=None, user=...
) -> Operation
```

A test run of the workflow, as the app's Test Run plays one: a staged
event arrives at one of its triggers and the agents it reaches take a
real turn (their models, instructions and tools) while a simulated world
answers every tool call, so nothing is sent, no account is touched and
its connections needn't be connected yet (its agents' model connections
must be). The steps after an agent that would reach an account never run.

`test_run` plays one the workflow offers, by its name or key, as its
Test Run screen lists them (`test_runs()` reads them): a staged situation for one of its triggers,
or one authored for it (`edit().add_test_run`). Or stage a message you
type on `trigger` (a trigger `Step`, its id or its type): `body`,
with `title`, `author` and `handle`. `scenario` says what the
simulated world is like, in place of the staged situation's own. One
the workflow doesn't offer raises `noclick.NotFound` naming the ones
it does. Billed as the app's Test Run is; an account has up to 10
queued or running at once (`noclick.QuotaExceeded` past that).

Parameters:

- `test_run` (`str | None`, default `None`)
- `trigger` (`Any`, default `None`)
- `body` (`str | None`, default `None`)
- `title` (`str | None`, default `None`)
- `author` (`str | None`, default `None`)
- `handle` (`str | None`, default `None`)
- `scenario` (`str | None`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `Operation` The run's operation (kind `workflow.rehearse`); `.wait()` gives the `WorkflowRehearsal`: the
agent's `reply` and the `tool_calls` it made with what the world answered.

Usage:

```python
inbox = noclick.Workflow.from_name("Support inbox")
test = inbox.rehearse("Refund request").wait()
print(test.reply)
for call in test.tool_calls:
    print(call["tool"], call["arguments"])

# A message of your own, on the trigger step support_email:
test = inbox.rehearse(trigger="support_email", body="My order 1042 never came.",
                      title="Where is order 1042?", author="ana@example.com").wait()
```

### Workflow.runs

```python
workflow.runs(
    *, status=None, limit=20, user_filter=None, user=..., source=None, trigger=None,
    waiting=None, search=None
) -> list[WorkflowRun]
```

Recent runs, newest first, however they started (your code, its
endpoint, a schedule, the app). Outside `as_user` you read runs recorded
for your account; `user_filter` reads your users'. Narrow them by
`status`, by how they started (`source`: `api`, `endpoint`,
`app`, `schedule`, `trigger`), by the kind of event that started
them (`trigger`: `webhook`, `email`, `call`, `agent`,
`shared_link`, `error`), to those that wait (`waiting=True`) or
that don't (`False`), and by text in their error (`search`, any
case).

Parameters:

- `status` (`str | Sequence[str] | None`, default `None`)
- `limit` (`int | None`, default `20`): Return at most this many.
- `user_filter` (`Any`, default `None`): Which users a read covers: `noclick.ALL_USERS`, `noclick.NO_USER`, a `User`, or your id for one. It filters without acting as that user.
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `source` (`str | Sequence[str] | None`, default `None`)
- `trigger` (`str | Sequence[str] | None`, default `None`)
- `waiting` (`bool | None`, default `None`)
- `search` (`str | None`, default `None`)

Returns: `list[WorkflowRun]` The first `limit` matching runs (20 by default; `None` for all of them).

Usage:

```python
intake = noclick.Workflow.from_name("order-intake")
for run in intake.runs(status="failed", user_filter=noclick.ALL_USERS):
    print(run.started_at, run.source, run.error)
for run in intake.runs(trigger="email", waiting=True):
    print(run.id, "waits on", run.waiting_on)
```

### Workflow.runs_page

```python
workflow.runs_page(
    *, cursor=None, limit=None, status=None, user_filter=None, user=..., source=None,
    trigger=None, waiting=None, search=None
) -> Page
```

One page of runs, newest first: `runs()`'s filters, a page at a time (`limit` up to 100); pass
`next_cursor` back as `cursor` for the next.

Parameters:

- `cursor` (`str | None`, default `None`): The `next_cursor` of the page before; omit it for the first page.
- `limit` (`int | None`, default `None`): Return at most this many.
- `status` (`str | Sequence[str] | None`, default `None`)
- `user_filter` (`Any`, default `None`): Which users a read covers: `noclick.ALL_USERS`, `noclick.NO_USER`, a `User`, or your id for one. It filters without acting as that user.
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `source` (`str | Sequence[str] | None`, default `None`)
- `trigger` (`str | Sequence[str] | None`, default `None`)
- `waiting` (`bool | None`, default `None`)
- `search` (`str | None`, default `None`)

Returns: `Page` A page whose `data` holds the runs and whose `next_cursor` is `None` on the last page.

Usage:

```python
intake = noclick.Workflow.from_name("order-intake")
page = intake.runs_page(status="failed", limit=50)
while page.next_cursor:
    page = intake.runs_page(status="failed", limit=50, cursor=page.next_cursor)
```

### Workflow.connections

```python
workflow.connections() -> list[WorkflowConnectionInfo]
```

The accounts its steps use, by name and owner: what the canvas shows beside each step. Metadata only,
never a value; a collaborator reads the owner's and the ones lent to the workflow.

Returns: `list[WorkflowConnectionInfo]` Each account's `id`, `name`, `credential_type`, whether it's yours, and its owner's name if not.

Usage:

```python
for account in noclick.Workflow.from_name("order-intake").connections():
    print(account.name, "yours" if account.owned_by_me else account.owner_name)
```

### Workflow.get_run

```python
workflow.get_run(run_id, *, detail=None) -> WorkflowRun
```

One run, with what each step did (`steps`: status, error and output, in order).
While it runs, each step reads as it moves (`running`, then how it ended with its
output); `noclick.watch` says when, with a `workflow_run` change naming the run
(`change` `step` when a step moved, `run` when it started or ended).
`detail="steps"` also reads each step as it ran (its `type`, `operation`,
`error_action` and an agent's `tool_calls`) and the `graph` the run ran.

Parameters:

- `run_id` (`str`, required)
- `detail` (`str | None`, default `None`)

Returns: `WorkflowRun` The `WorkflowRun`; an unknown id raises `noclick.NotFound`.

Usage:

```python
intake = noclick.Workflow.from_name("order-intake")
failed = intake.runs(status="failed", limit=1)[0]
for step in intake.get_run(failed.id).steps:
    print(step.name, step.status, step.error)
```

### Workflow.run_inputs

```python
workflow.run_inputs(run_id) -> RunInputs
```

What came in to a coding harness's reply, the run that recorded it: such a run
never fired its trigger, so each delivery it answered (hidden from `runs()`) comes
with what its steps output, the newest 15, never a secret.

Parameters:

- `run_id` (`str`, required)

Returns: `RunInputs` The `RunInputs`: each delivery's `run_id` and `steps` (`RunStep`), and `total`.

Usage:

```python
intake = noclick.Workflow.from_name("support-agent")
came = intake.run_inputs(intake.runs(limit=1)[0].id)
for delivery in came.inputs:
    print(delivery["run_id"], [step.output for step in delivery["steps"]])
```

### Workflow.stop_run

```python
workflow.stop_run(run_id, *, user=...) -> WorkflowRun
```

Stop a run that's running, however it started, as the app's stop does: the step
it's on stops at once and nothing after it runs. A run from code is its operation's
cancel (the operation reads `canceled`). Takes what starting one takes; inside
`as_user` (or with `user=`) only that user's runs.

Parameters:

- `run_id` (`str`, required)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `WorkflowRun` The run once it stopped (or as it stands after a few seconds). A run that already
ended raises `noclick.Conflict`, as does any other that waits with nothing running
(an approval, a delay).

Usage:

```python
intake = noclick.Workflow.from_name("order-intake")
for run in intake.runs(status="running"):
    print(intake.stop_run(run.id).status)   # failed
```

### Workflow.get_step

```python
workflow.get_step(step_id) -> Step
```

One of its steps read alone, whole (`GET /v1/workflows/{id}/steps/{step_id}`),
as `graph()` reads every step: its settings as stored, never a secret
(`withheld` names, by path, what was left out). No step by that id
raises `noclick.NotFound`.

Parameters:

- `step_id` (`str`, required)

Returns: `Step` The `Step`, loaded.

Usage:

```python
hook = noclick.Workflow.from_name("order-intake").get_step("hook")
print(hook.type, hook.settings, hook.withheld)
```

### Workflow.check_readiness

```python
workflow.check_readiness() -> WorkflowReadinessCheck
```

Whether it's set up to run, with the evidence that's judged on, as the
app's setup check shows it: what `readiness` says, then the inputs its
triggers last received, which are registered, the deadlines its alarm
steps watch and the recipients its agents' tools are held to.

Returns: `WorkflowReadinessCheck` The `WorkflowReadinessCheck`.

Usage:

```python
check = noclick.Workflow.from_name("order-intake").check_readiness()
print(check.status, [o["step"] for o in check.observations])
```

### Workflow.warm_sandboxes

```python
workflow.warm_sandboxes() -> dict[str, int]
```

How many of your sandboxes are up for each of this workflow's agent steps (one per
conversation whose sandbox is warm), as the app's canvas badges them.

Returns: `dict[str, int]` Each agent step's id with a sandbox up, to its count.

Usage:

```python
print(noclick.Workflow.from_name("support desk").warm_sandboxes())   # {"helper": 2}
```

### Workflow.template

```python
workflow.template() -> WorkflowTemplate
```

This workflow's place in NoClick's template library: whether it's published, its
page, and the draft saved for it before it is.

Returns: `WorkflowTemplate` The `WorkflowTemplate`.

Usage:

```python
listing = noclick.Workflow.from_name("order-intake").template()
print(listing.public_url if listing.published else listing.draft_title)
```

### Workflow.save_template

```python
workflow.save_template(*, title=None, description=None) -> WorkflowTemplate
```

Keep a draft `title` and `description` for this workflow's template, before (or between)
publishing it. Takes what pausing it takes: the account owns and pays for it.

Parameters:

- `title` (`str | None`, default `None`)
- `description` (`str | None`, default `None`)

Returns: `WorkflowTemplate` The `WorkflowTemplate`, with the draft.

Usage:

```python
noclick.Workflow.from_name("daily-digest").save_template(title="Daily digest")
```

### Workflow.publish_template

```python
workflow.publish_template(*, title, description=None) -> WorkflowTemplate
```

Put this workflow in NoClick's template library under `title` (its page at
`/workflow/<slug>`), or change its title and description there. It must be shared
publicly first (`noclick.Share.create`): a template's page is that share's.

Parameters:

- `title` (`str`, required)
- `description` (`str | None`, default `None`)

Returns: `WorkflowTemplate` The `WorkflowTemplate`, `published`, with its `public_url`.

Usage:

```python
listed = noclick.Workflow.from_name("daily-digest").publish_template(title="Daily digest")
print(listed.public_url)
```

### Workflow.unpublish_template

```python
workflow.unpublish_template() -> WorkflowTemplate
```

Take this workflow out of the template library; its public share stays as it is.

Returns: `WorkflowTemplate` The template as it stands now, unpublished.

Usage:

```python
noclick.Workflow.from_name("daily-digest").unpublish_template()
```

### Workflow.share_test_run

```python
workflow.share_test_run(snapshot, *, title=None) -> dict[str, str]
```

Share a finished Test Run as a read-only page anyone with its `url` reads, as the
app's Test Run screen's Share does: `snapshot` is what the screen showed of the run (its
`scenario`, `rows`, `reply` and the like; only those display fields are kept).
Nothing runs or bills through the page. Takes what pausing the workflow takes.

Parameters:

- `snapshot` (`dict[str, Any]`, required)
- `title` (`str | None`, default `None`)

Returns: `dict[str, str]` `{"id", "url"}`: the page's id and address.

Usage:

```python
page = noclick.Workflow.from_name("lead-flow").share_test_run(snapshot, title="Direct lead")
print(page["url"])
```

### Workflow.preview_expression

```python
workflow.preview_expression(
    expression, *, samples=None, primary_input=None, user=...
) -> ExpressionPreview
```

What an expression gives outside any one step (an interface block's, say), evaluated
as a run evaluates it: against `samples` (each step's output by step id, `vars` the
workflow's variables), else against what every step last stored (never a secret), with
`primary_input` as `$json`. Changes nothing. A step's own setting previews with
`Step.preview_expression`.

Parameters:

- `expression` (`str`, required)
- `samples` (`dict[str, Any] | None`, default `None`)
- `primary_input` (`Any`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `ExpressionPreview` The `ExpressionPreview`; an expression that fails has `ok` False and its `error`.

Usage:

```python
flow = noclick.Workflow.from_name("order-intake")
print(flow.preview_expression("$('hook').items.length").preview)   # 2
```

### Workflow.run_counts

```python
workflow.run_counts(*, user_filter=None, user=...) -> WorkflowRunCounts
```

How many runs `runs()` lists: in all, `by_status` (and how many of the running
ones are `waiting`), `by_source` and `by_trigger`. Outside `as_user` you count
the runs recorded for your account; `user_filter` counts your users'.

Parameters:

- `user_filter` (`Any`, default `None`): Which users a read covers: `noclick.ALL_USERS`, `noclick.NO_USER`, a `User`, or your id for one. It filters without acting as that user.
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `WorkflowRunCounts` The `WorkflowRunCounts`.

Usage:

```python
counts = noclick.Workflow.from_name("order-intake").run_counts()
print(counts.total, counts.by_status["failed"], counts.by_source)
```

### Workflow.latest_outputs

```python
workflow.latest_outputs(*, steps=None, full=False, user=...) -> LatestOutputs
```

Each step's latest output, whatever run it's from, as the app's canvas shows the
workflow when it opens: cut short as a run's steps are unless `full`, never a
secret. `steps` reads only those steps' (each a `Step` or its id). Inside
`as_user` (or with `user=`) only that user's runs are read.

Parameters:

- `steps` (`Sequence[Any] | None`, default `None`)
- `full` (`bool`, default `False`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `LatestOutputs` The `LatestOutputs`: `outputs` by step id, with what each `withheld`.

Usage:

```python
latest = noclick.Workflow.from_name("order-intake").latest_outputs()
print(latest.outputs["hook"]["order_id"], latest.withheld.get("hook"))
```

### Workflow.approvals

```python
workflow.approvals(*, status=None, limit=20) -> list[WorkflowApproval]
```

Its Approval steps, newest first: those its runs wait at (`status="pending"`), and those approved,
declined or expired. NoClick asks your account's owner to answer each; your code answers one with a key
naming `approvals:answer` (`approval.approve()`, `approval.decline()`).

Parameters:

- `status` (`str | None`, default `None`)
- `limit` (`int | None`, default `20`): Return at most this many.

Returns: `list[WorkflowApproval]` The first `limit` (20 by default, at most 100), each a `noclick.WorkflowApproval`.

Usage:

```python
invoices = noclick.Workflow.from_name("Invoices")
for approval in invoices.approvals(status="pending"):
    print(approval.title, approval.values)
```

### Workflow.endpoint

```python
workflow.endpoint(*, public=None) -> WorkflowEndpoint
```

The workflow's HTTP endpoint, turned on if it wasn't. `public=True`
lets a publishable key call it from a web page, with per-visitor rate
limits; `public=False` requires a secret key again; leave it out to keep
what it is.

Parameters:

- `public` (`bool | None`, default `None`)

Returns: `WorkflowEndpoint` The endpoint: its `url`, whether it's `public`, and the `method` to call it with.

Usage:

```python
intake = noclick.Workflow.from_name("order-intake")
endpoint = intake.endpoint(public=True)
print(endpoint.method, endpoint.url, endpoint.public)
```

## noclick.AgentLink

```python
class AgentLink
```

An agent step's public chat page (`/a/{id}`), as one visitor talks through it. Anyone holding the link talks
to the agent, billed to the workflow's owner, who turns it off or rotates it from the step's share link. A visitor
is named by an id their browser keeps (a UUID), and each of their threads by a `chat` key; they read their own
threads alone.

Usage:

```python
link = noclick.AgentLink(link_id, visitor=visitor_id)
link.send("Do you ship to Canada?")
print(link.thread().messages)
```

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |
| `visitor` | `str` |  |

### noclick.AgentLink

```python
noclick.AgentLink(link_id, *, visitor, base_url=None)
```

Parameters:

- `link_id` (`str`, required)
- `visitor` (`str`, required)
- `base_url` (`str | None`, default `None`)

### AgentLink.send

```python
agent_link.send(text, *, chat='main') -> str
```

Say something to the agent in the visitor's thread `chat` (a new key starts a new thread). It returns
once the agent's turn is under way; read its reply back with `thread()`. Raises `noclick.Conflict`
(`details["reason"]` `busy`) while the thread's last message is still being handed to the agent,
`noclick.NotAvailable` when the agent can't take a turn, and `noclick.NotFound` once the link is off.

Parameters:

- `text` (`str`, required)
- `chat` (`str`, default `'main'`)

Returns: `str` The thread's conversation id.

Usage:

```python
noclick.AgentLink(link_id, visitor=visitor_id).send("Hi!")
```

### AgentLink.thread

```python
agent_link.thread(*, chat='main') -> AgentLinkThread
```

The visitor's thread `chat`, as the page shows it.

Parameters:

- `chat` (`str`, default `'main'`)

Returns: `AgentLinkThread` The `AgentLinkThread`.

Usage:

```python
for message in noclick.AgentLink(link_id, visitor=visitor_id).thread().messages:
    print(message["role"], message.get("message"))
```

### AgentLink.room_token

```python
agent_link.room_token(*, chat='main', origin=None) -> RoomToken
```

A single-use token for the room of the visitor's thread `chat`, where its turns' frames
(`chat:message`, `agent:state`) arrive as they happen: a page joins with it (`AgentLink.join` in
TypeScript). View-only. `origin` is the page's (`location.origin`); the socket must come from it.

Parameters:

- `chat` (`str`, default `'main'`)
- `origin` (`str | None`, default `None`)

Returns: `RoomToken` The token, the socket's `url` (carrying its ticket) and what it lets the page do (`view`).

Usage:

```python
token = noclick.AgentLink(link_id, visitor=visitor_id).room_token(origin="https://chat.example.com")
return {"url": token.url, "token": token.token}
```

## noclick.AgentLinkThread

```python
class AgentLinkThread
```

A visitor's thread with the agent (`AgentLink.thread`): its conversation's id and its messages, oldest
first.

| Attribute | Type | Description |
| --- | --- | --- |
| `conversation` | `str` |  |
| `messages` | `list[dict[str, Any]]` |  |

## noclick.WorkflowRun

```python
class WorkflowRun
```

One run of a workflow. `status` is `running` (a run waiting on an
approval or a delay too: `waiting_on` says on what, `approval`,
`delay` or for a run from code `agent_turn`; `None` while it runs
on), `succeeded` or `failed` (`error` says why). `outputs` holds
what its final steps produced (each step that finished with nothing after
it running), by step name. `source` is how it started: `api`,
`endpoint`, `schedule`, `trigger` (an event) or `app`; for a
`trigger` run, `trigger` names the kind of event: `webhook` (a
delivery to one of its trigger steps, a webhook's or an app's event),
`email`, `call`, `agent` (an agent's turn), `shared_link` or
`error` (it handled another run's failure). `inputs` and
`operation_id` are set for a run started from code. `steps` says what
each step did, read with one run (`Workflow.get_run`); empty in a list.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |
| `workflow_id` | `str | None` |  |
| `status` | `str` |  |
| `inputs` | `dict[str, Any]` |  |
| `outputs` | `dict[str, Any]` |  |
| `error` | `str | None` |  |
| `source` | `str | None` |  |
| `user_id` | `str | None` |  |
| `operation_id` | `str | None` |  |
| `started_at` | `Any` |  |
| `finished_at` | `Any` |  |
| `steps` | `list[RunStep]` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |
| `trigger` | `str | None` |  |
| `waiting_on` | `str | None` |  |
| `graph` | `dict[str, Any] | None` | Read with `get_run(id, detail="steps")`: the graph the run ran, as `graph()` reads one (no secret). |

## noclick.RunStep

```python
class RunStep
```

What one step did in a run: `status` is `succeeded`, `failed`
(`error` says why) or `skipped`; `output` is what it produced, with
long lists and text cut short and never a secret (`withheld` names, by
path, what was left out). `Step.output` reads it whole.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |
| `name` | `str` |  |
| `status` | `str` |  |
| `error` | `str | None` |  |
| `output` | `Any` |  |
| `withheld` | `list[str]` |  |
| `type` | `str | None` | Read with `get_run(id, detail="steps")`: its type and operation in the graph the run ran. |
| `operation` | `str | None` |  |
| `error_action` | `dict[str, Any] | None` | The fix its error offers (a reconnect, adding funds), where it has one. |
| `tool_calls` | `list[dict[str, Any]]` | An agent step's tool calls in the run, oldest first, as `/v1/logs` shows one. |

## noclick.StepOutput

```python
class StepOutput
```

What one step produced in one run (`Step.outputs`, `Step.output`). `run_id` is the
run's id (`Workflow.get_run` reads a run from code by it), `source` how it started (as
`WorkflowRun.source` says it), `status` the step's there (`succeeded`, `failed` with
`error`, `skipped`). A trigger's deliveries are its outputs too: `no_event` marks a
manual run's placeholder for one that got no event. `iteration` is set for one iteration of
a step that runs in a loop.

A listing gives a one-line `preview` (`path=value` pairs); one read gives the `output`,
with long text and lists cut short (`truncated`) unless read `full`, or the part at `path`.
Never a secret: `withheld` names, by path, what was left out (a request's `Authorization`
header, a key, a token).

| Attribute | Type | Description |
| --- | --- | --- |
| `step_id` | `str` |  |
| `run_id` | `str` |  |
| `workflow_id` | `str | None` |  |
| `iteration` | `int | None` |  |
| `source` | `str | None` |  |
| `status` | `str | None` |  |
| `error` | `str | None` |  |
| `created_at` | `Any` |  |
| `no_event` | `bool` |  |
| `preview` | `str | None` |  |
| `output` | `Any` |  |
| `path` | `str | None` |  |
| `full` | `bool` |  |
| `truncated` | `bool` |  |
| `withheld` | `list[str]` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.WorkflowEndpoint

```python
class WorkflowEndpoint
```

The URL a workflow answers at: send `method` (`POST`) with the inputs
as a JSON body, and the run's outputs come back (a run longer than 30
seconds answers `202` with its operation). A `public` endpoint also takes
a publishable key (`nk_pub_...`) that lists it, so a web page can call it;
otherwise it needs a secret key.

| Attribute | Type | Description |
| --- | --- | --- |
| `url` | `str` |  |
| `public` | `bool` |  |
| `method` | `str` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.WorkflowBuild

```python
class WorkflowBuild(Operation)
```

A build of a workflow from a description (kind `workflow.build`). It's
an `Operation`: `wait()` returns the `WorkflowBuildResult`, or raises
why the build failed.

While it builds, `step` is `building`. When the builder needs something
it's `awaiting_human` (step `asking`) and `question` says what: each
input is a human request NoClick sent the person whose build it is, and the
build goes on once they answer; or answer it all now with `answer()`.
`wait()` stops at a question it hasn't shown you, raising
`noclick.AnswerRequired` with it; called again, it waits through that
question for its answer. `next_question()` returns as soon as there is one.

| Attribute | Type | Description |
| --- | --- | --- |
| `workflow_id` | `str | None` |  |
| `conversation` | `str | None` | The conversation of the builder agent the build runs in (`Workflow.builder()`); None for a build it doesn't run. |
| `question` | `BuildQuestion | None` | What the build waits on (`None` unless it's asking). |

### WorkflowBuild.next_question

```python
workflow_build.next_question(timeout=None) -> BuildQuestion | None
```

Block until the build asks something (its `question`) or finishes (`None`: `wait()` gives the result).

Parameters:

- `timeout` (`float | None`, default `None`)

Returns: `BuildQuestion | None` The question to answer, or `None` once the build is done.

Usage:

```python
build = noclick.Workflow.from_name("Morning brief").build("Also post it to #team on Slack")
while (question := build.next_question(timeout=600)) is not None:
    build.answer({question.inputs[0]["id"]: "#team"})
print(build.wait().summary)
```

### WorkflowBuild.answer

```python
workflow_build.answer(
    values=None, *, message=None, skip=False, secret_values=None
) -> WorkflowBuild
```

Answer the question the build waits on, all at once, by input id: the
build goes on now. Each value answers its input's human request as your
key; those you leave unanswered are withdrawn. A choice, words, or for a
`credential` input a connection's ref or name; an `env` input's values
go in `secret_values` (`{input id: {KEY: value}}`), kept as the
account's secret and never shown to a model. An account or a secret
takes a key acting for the whole account. `message` tells the builder
anything else, `skip=True` goes on without answering.

Parameters:

- `values` (`dict[str, Any] | None`, default `None`)
- `message` (`str | None`, default `None`)
- `skip` (`bool`, default `False`)
- `secret_values` (`dict[str, dict[str, str]] | None`, default `None`)

Returns: `WorkflowBuild` This build, `running` again.

Usage:

```python
build = noclick.Workflow.from_name("Morning brief").build("Send it on Slack too")
question = build.next_question()
if question:
    build.answer({"channel": "#team"}, message="Keep it under five lines")
print(build.wait().steps)
```

## noclick.WorkflowBuilder

```python
class WorkflowBuilder
```

Where a workflow's builds are talked through (`Workflow.builder()`).

| Attribute | Type | Description |
| --- | --- | --- |
| `workflow_id` | `str` |  |
| `agent_id` | `str | None` | The account's builder agent, whose conversation `conversation` this workflow's builds share; None where the caller's builds aren't the agent's, or it was never made. |
| `conversation` | `str | None` |  |
| `build` | `WorkflowBuild | None` | The workflow's build under way or waiting on a question, else None. |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.WorkflowBuildResult

```python
class WorkflowBuildResult
```

A finished build: what the builder says it did (`summary`), the
workflow's `steps` as they now stand, and, when it published the
workflow's app, `published` (`{state, url}`: `state` is
`published`, `renamed` or `unpublished`; unpublished, its
`trash_id` restores it until `restorable_until`).

Beside the builder's words, facts no model wrote: whether it `built`
anything (`False`: the workflow is as it was, whatever `summary`
says), the `version` it ended on (what `edit(if_version=...)` takes),
its `readiness` as `Workflow.readiness` reads it (`status`,
`meaning`, `issues`, `warnings`, `unverified`), and each step's
verdict by step id (`verdicts`: `config_valid`, `validation_error`,
`missing_required`, `left_for_user` and `references`, as an edit answers them).
`references` lists, across the workflow, each read of another step's output
that gets no value, said in a sentence (`message`): `{step, field, source, key, known_keys, message}` for a key the `source` step's known output lacks
(a run reads nothing there and still succeeds, so a test run never shows it), or
`{step, field, source, reference, missing, near, message}` for a step the
workflow doesn't have; a step whose output nothing has shown isn't judged.
`sent_back` counts the times the build went back to the builder for settings
the run engine rejects or reads that get no value (at most 2) before it
finished. A fact NoClick couldn't read is `None` and named in `unread`:
then nothing says the workflow is ready.

| Attribute | Type | Description |
| --- | --- | --- |
| `workflow_id` | `str | None` |  |
| `summary` | `str | None` |  |
| `steps` | `list[WorkflowStep]` |  |
| `app_url` | `str | None` |  |
| `published` | `dict[str, Any] | None` |  |
| `built` | `bool | None` |  |
| `version` | `int | None` |  |
| `readiness` | `dict[str, Any] | None` |  |
| `verdicts` | `dict[str, dict[str, Any]] | None` |  |
| `references` | `list[dict[str, Any]] | None` |  |
| `sent_back` | `int` |  |
| `unread` | `list[str]` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.WorkflowDraftResult

```python
class WorkflowDraftResult
```

A finished draft: the workflow's `version` once the drafted steps were written (one version of its
history, `history_version`; `changed` false when the drafter changed nothing), a `summary` of what
changed, and for each step it drafted (`steps`, by id) the verdict an edit answers (`config_valid`,
`validation_error`, `missing_required`, `left_for_user`, `references`) beside `drafted`, its
`operation`, the `settings` it wrote, the ones it left for a person (`unfilled`: a choice read from the
connected account, a value only they know; a required one reads as `left_for_user` until it's filled in) and,
for a step it couldn't draft (left as it was), its `error`.

A draft asked not to write (`draft(..., write=False)`): `written` is false, `version` the one it was
judged on, `changed` whether writing it would change the workflow, and `edits` the `update_step` edits a
write would make, which `edit()` takes as they are, each step's own in its `changes` (`{operation?, settings?}`, None for nothing); a secret the drafter set is left out of them and named in its step's
`withheld`.

| Attribute | Type | Description |
| --- | --- | --- |
| `workflow_id` | `str` |  |
| `mode` | `str` |  |
| `version` | `int | None` |  |
| `history_version` | `int | None` |  |
| `changed` | `bool` |  |
| `summary` | `str | None` |  |
| `steps` | `dict[str, dict[str, Any]]` |  |
| `written` | `bool` |  |
| `edits` | `list[dict[str, Any]]` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.WorkflowStep

```python
class WorkflowStep
```

One step of a workflow, as the app shows it: its `name`, its kind
(`type`, like `automation-gmail` or `trigger-cron`) and the
`operation` it does there (`None` for a step with one thing to do).

Read with one workflow, a step also says whether it's `enabled`, its
`settings` (never a secret; long values cut short), its `connection`
(`None` for a step that takes no account, else `{attached, healthy, hint}`: `healthy` is `None` when NoClick can't tell) and, for a
trigger, its `trigger` state (`{error, paused_reason, next_run}`;
`None` for any other step).

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |
| `name` | `str` |  |
| `type` | `str` |  |
| `operation` | `str | None` |  |
| `enabled` | `bool` |  |
| `settings` | `dict[str, Any]` |  |
| `connection` | `dict[str, Any] | None` |  |
| `trigger` | `dict[str, Any] | None` |  |

## noclick.WorkflowApproval

```python
class WorkflowApproval
```

An Approval step a run of one of your workflows waits at (or waited at), as its owner sees it.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |
| `workflow_id` | `str` |  |
| `workflow_name` | `str | None` |  |
| `run_id` | `str` | The run that waits at it (`workflow.get_run(run_id)`). |
| `step` | `str` | The Approval step's id in the workflow. |
| `title` | `str | None` | What it asks, as the step's title says it. |
| `fields` | `list[dict[str, Any]]` | Its form's fields, each with `name`, `type`, `label`, `description`, `required` and `options`. |
| `values` | `dict[str, Any]` | The form's values by field name: as the run asked, then as it was answered. |
| `status` | `str` |  |
| `created_at` | `Any` |  |
| `expires_at` | `Any` | When the approver it waits on must answer by (7 days after it was asked, unless the step's `expires_in_s` says otherwise; an escalation gives the next approver theirs). |
| `approver` | `dict[str, Any]` | Who it waits on (or waited on last): `kind` `owner`, `person` (with `email`), `user` (`user_id`), `agent` (`agent_id`) or `code`: the step's approver, else your account's, else the owner. |
| `on_timeout` | `str | None` | What happens if they don't answer by `expires_at`: `decline` (the run ends) or `escalate` (the next approver up answers it, finally the owner). |
| `decided_at` | `Any` |  |
| `decided_by` | `str | None` | Who decided: `owner` (signed in, or from NoClick's link or the web chat), `person` (a person or user named approver, from the link NoClick emailed them), `agent` (an agent named approver), `code` or `app` (someone who may edit the workflow, in the NoClick app); None while it waits. |
| `decided_by_key` | `dict[str, Any] | None` | The key whose code decided (`key_id`, `key_name`); None otherwise. |
| `decided_by_agent` | `dict[str, Any] | None` | The agent named approver that decided (`agent_id`, `name`); None otherwise. |
| `note` | `str | None` | What whoever decided wrote with it. |
| `sent_to` | `list[str]` | Where NoClick sent the owner its link: `whatsapp`, `imessage`, `email`, or `web` (a card in the chat they were watching). |

### WorkflowApproval.from_id

```python
noclick.WorkflowApproval.from_id(
    workflow, approval_id, *, client=None
) -> WorkflowApproval
```

A lazy reference to one of a workflow's Approval steps by its id (an event's `data["id"]`).

Parameters:

- `workflow` (`Any`, required)
- `approval_id` (`str`, required)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `WorkflowApproval` The approval; it loads the first time it's used.

Usage:

```python
approval = noclick.WorkflowApproval.from_id(event.data["workflow_id"], event.data["id"])
print(approval.title, approval.values)
```

### WorkflowApproval.list

```python
noclick.WorkflowApproval.list(
    workflow, *, status=None, limit=None, client=None
) -> list[WorkflowApproval]
```

A workflow's Approval steps, newest first: the first 20, or the first `limit` (at most 100), with
`status` one of `pending`, `approved`, `declined` or `expired`. Read as your account, with a key
holding `workflows` or `approvals:answer`.

Parameters:

- `workflow` (`Any`, required)
- `status` (`str | None`, default `None`)
- `limit` (`int | None`, default `None`): Return at most this many.
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `list[WorkflowApproval]` Each approval as its owner sees it.

Usage:

```python
for approval in noclick.WorkflowApproval.list("2e3a9296-...", status="pending"):
    print(approval.title, approval.values, approval.expires_at)
```

### WorkflowApproval.approve

```python
workflow_approval.approve(*, note=None, values=None) -> WorkflowApproval
```

Approve it from your own code, with one of your account's secret keys that names the `approvals:answer`
scope: the run goes on down the step's approved branch, once, with `values` (by field name) as the form's
values where you give them. Refused with `noclick.PermissionDenied` for a key without the scope or one
acting for a user, `noclick.Conflict` once it was answered, and `noclick.Expired` once it lapsed unanswered.

Parameters:

- `note` (`str | None`, default `None`)
- `values` (`dict[str, Any] | None`, default `None`)

Returns: `WorkflowApproval` This approval, answered: `status` is `approved`, `decided_by` is `code`.

Usage:

```python
approval = noclick.WorkflowApproval.from_id(workflow_id, approval_id)
approval.approve(note="Checked the invoice.", values={"amount": "420"})
```

### WorkflowApproval.decline

```python
workflow_approval.decline(*, note=None, values=None) -> WorkflowApproval
```

Decline it from your own code, as `approve` answers it: the run goes on down the step's rejected branch.

Parameters:

- `note` (`str | None`, default `None`)
- `values` (`dict[str, Any] | None`, default `None`)

Returns: `WorkflowApproval` This approval, answered: `status` is `declined`.

Usage:

```python
for approval in noclick.Workflow.from_name("Invoices").approvals(status="pending"):
    approval.decline(note="Invoices wait for Monday's review.")
```

## noclick.WorkflowRehearsal

```python
class WorkflowRehearsal
```

A workflow's test run, as the app's Test Run plays one: a staged event arrived at one of its triggers
(`trigger`: `{step_id, type, name}`) and the agents it reached took a real turn while a simulated world
answered every tool call, so nothing was sent and no account was touched. `test_run` is the run it played
(`{key, name, custom}`; `None` for a message you typed). `reply` is the agent's closing words;
`tool_calls` the calls it made, each with its `tool`, `arguments` and the `result` the world answered
(and `outbound`, the message it would have sent, for a call that carries one); `transcript` the run step by
step (`role` `assistant` steps, its `text`, and `tool` steps; a coding harness's own shell and file steps
carry `source` `harness`). `scenario` is the world it ran in, `note` says when it wrote nothing or what
it did to act was simulated, and `cost_usd` is what it cost you.

| Attribute | Type | Description |
| --- | --- | --- |
| `workflow_id` | `str | None` |  |
| `test_run` | `dict[str, Any] | None` |  |
| `trigger` | `dict[str, Any] | None` |  |
| `reply` | `str` |  |
| `tool_calls` | `list[dict[str, Any]]` |  |
| `transcript` | `list[dict[str, Any]]` |  |
| `scenario` | `str | None` |  |
| `note` | `str | None` |  |
| `cost_usd` | `float | None` |  |
| `operation_id` | `str | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.WorkflowTestRun

```python
class WorkflowTestRun
```

A test run a workflow offers (`Workflow.test_runs`), as its Test Run screen lists it: a staged situation for
one of its triggers, or one the workflow authored (`custom`; `edit().add_test_run`). `key` and `name`
each name it to `rehearse`. `trigger` is what it stages on (`{type, label, operation}`: the trigger step's
type, the type's name in the app and the step's operation), and `message` the staged message as the run would
stage it (`title`, `body`, and where it has them `author`, `handle`, `meta` and `time`): an offered
situation's with the workflow's edits, an authored run's own.

| Attribute | Type | Description |
| --- | --- | --- |
| `key` | `str` |  |
| `name` | `str` |  |
| `custom` | `bool` |  |
| `trigger` | `dict[str, Any]` |  |
| `message` | `dict[str, Any]` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.WorkflowGraph

```python
class WorkflowGraph
```

A workflow's definition as it was read, at `version`: its `name`,
`description` and `settings` (its variables, its Test Runs and the rest), its
`steps` (each a `Step` you can change), its `notes` (steps of type
`stickyNote`) and its `edges`.

Each edge is `{id, from, to, kind, handle}`: `kind` `data`, or `tools` for a
step wired into an agent as its tools; `handle` names which output of `from` it
leaves (`None` for its only one).

A secret is never read back, and writing a step or the settings back without one keeps
it: `withheld` names, by step id, the paths of the settings left out
(`api_key`, `auth.password`, `headers[0].value`), `settings_withheld` those of
the workflow's own settings (`variable_definitions[1].value`: a variable's value, whatever its
name; one with no value yet reads as blank, so you can tell which still need one), and
`variables_withheld` the graph's own variables. The graph a `noclick.Conflict`
carries holds the steps and edges alone: its `name`, `description`, `settings`
and `settings_withheld` are `None`.

An edge into a step with several inputs names which in `target_handle` (a code step's
`state`). `display_metadata` is what the app shows of the workflow (its canvas's
viewport, the step open in its panel), read with `graph()`: never part of a version.
`access` is what you may do with it (`owner`, `editor` or `viewer`) and `agent`
the agent whose own flow it is (`{id, name, yours}`, `yours` when it's your account's
own), both read with `graph()`.

| Attribute | Type | Description |
| --- | --- | --- |
| `workflow_id` | `str` |  |
| `version` | `int` |  |
| `name` | `str | None` |  |
| `description` | `str | None` |  |
| `settings` | `dict[str, Any] | None` |  |
| `settings_withheld` | `list[str] | None` |  |
| `steps` | `list[Step]` |  |
| `notes` | `list[Step]` |  |
| `edges` | `list[dict[str, Any]]` |  |
| `withheld` | `dict[str, list[str]]` |  |
| `variables_withheld` | `list[str]` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |
| `display_metadata` | `dict[str, Any] | None` |  |
| `access` | `str | None` |  |
| `agent` | `dict[str, Any] | None` |  |

### WorkflowGraph.step

```python
workflow_graph.step(ref) -> Step
```

One of its steps or notes, by id, else by its name in the app.

Parameters:

- `ref` (`str`, required)

Returns: `Step` The step. None by that id or name raises `noclick.NotFound`; a name two steps
share raises `noclick.Conflict` (name it by id).

Usage:

```python
graph = noclick.Workflow.from_name("Morning brief").graph()
send = graph.step("Send the summary")
print(send.id, send.settings)
```

## noclick.Step

```python
class Step
```

One step of a workflow's graph: its trigger, an app's operation, an agent, a
note. `Workflow.graph()` reads them all; `Workflow.step(id)` is a handle to
one by id that loads the first time you read a field.

Its fields are as stored: `type` (`automation-gmail`, `agent`,
`trigger-cron`), its `name` in the app, the `operation` it does,
whether it's `enabled`, its `settings` (never a secret: `withheld`
names the ones left out), its `connections` (each slot's connected account,
by id), where it sits (`position`) and the output it gives on test runs
instead of running (`mock_output`). A note on the canvas is a step of type
`stickyNote` (its text is `settings["content"]`), listed in
`WorkflowGraph.notes`.

Each method is one edit, applied as its own version: the step comes back as
written, with what the edit said about it (`notes`) and whether it's ready
to run (`verdict`). To change several things at once, or only if the
workflow hasn't changed since you read it, use `Workflow.edit()`.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` | Its id in the workflow, which edits name it by. |
| `workflow` | `Workflow` | The workflow it's a step of. |
| `type` | `str` | What kind of step it is: `automation-gmail`, `agent`, `trigger-cron`, `stickyNote` for a note. |
| `name` | `str | None` | Its name in the app (`None` when it has none and the app shows its type). |
| `operation` | `str | None` | What it does, one of its type's operations (`None` for a step with one thing to do). |
| `enabled` | `bool` | Whether it runs: a step switched off (`update(enabled=False)`) is passed over. |
| `settings` | `dict[str, Any]` | Its settings, by field name, as stored (a secret is never read back: see `withheld`). |
| `connections` | `dict[str, str]` | The accounts connected to it: each slot (a connection type, like `gmail_oauth`) to the id of the account connected there, which the connection holding it names as its `credential_id`. `set_connection` changes them. |
| `position` | `dict[str, float] | None` | Where it sits on the canvas: `{"x", "y"}`. |
| `mock_output` | `Any` | What it outputs on test runs instead of running (`mock()`), or `None`. |
| `withheld` | `list[str]` | The settings left out of `settings` because they hold a secret (a key, a token, a password), each by its path: `api_key`, `auth.password`, `headers[0].value`. An update that leaves them out keeps them. |
| `verdict` | `dict[str, Any] | None` | Whether it's ready to run, as the last edit through this handle that touched it judged: `config_valid`, and when it isn't, `validation_error`, `missing_required` and `left_for_user` (the required settings it leaves for its person to fill in, a value only they know: they wait on that person and are never part of the error); an agent's `agent_credential_hint`; and `references` (see `references`). `None` until an edit judged it (a read doesn't). |
| `references` | `list[dict[str, Any]]` | Each read of another step's output in its settings (`{{ $('x').key }}`) that won't resolve at run time, as the last edit through this handle that touched it judged: `{field, step, key, known_keys}` for a key `x`'s output isn't known to have (`known_keys`: what it has, from what `x` declares, its latest output in this workflow, or what your account's own runs of its type showed), or `{field, step, reference, missing, near}` for a step `x` the workflow doesn't have (`near`: the one it likely means). A read of a step whose output nothing has shown yet isn't judged. Empty when every read resolves, or before an edit judged it. |
| `notes` | `dict[str, Any]` | What the last edit through this handle answered for its change, beyond the step's id: `changed` for an update, the edge for a connect, and anything the edit did on its own, such as `resolutions` (a value it resolved, like a model's full id), `harness_switch` (an agent moved to another harness, with the settings that went with the old one), `coerced_values` or `stripped_trigger_refs`. |

### Step.options

```python
step.options(
    field, *, settings=None, search=None, page_token=None, type=None, connection=None
) -> StepOptions
```

The choices `field` takes, as the app's dropdown lists them: read from the account the
step connects to (a Google account's spreadsheets, a Slack workspace's channels) by the
step's own lookup, with its settings as saved and `settings` laid over them (what a list
that depends on another reads, like the tabs of a spreadsheet you haven't saved yet).
`search` narrows them where the service can search. A page at a time: pass
`page_token=` its `next_page_token`. A connection whose owner reviews its calls holds
the lookup for them (`noclick.ApprovalRequired`). A step the workflow doesn't hold yet
(one a canvas added and hasn't saved) lists its choices by its `type`
(`automation-slack`), and `connection` (a connection's ref or id) names the account to
read from in place of the one the step holds. Takes read access to the workflow: whoever
can change it reads through the step's account as a run does, anyone else only through
an account that's theirs to use.

Parameters:

- `field` (`str`, required)
- `settings` (`dict[str, Any] | None`, default `None`)
- `search` (`str | None`, default `None`)
- `page_token` (`str | None`, default `None`)
- `type` (`str | None`, default `None`)
- `connection` (`str | None`, default `None`)

Returns: `StepOptions` The `StepOptions`: `options` (each a `StepOption`), `next_page_token` and
`withheld`.

Usage:

```python
sheet = noclick.Workflow.from_name("Morning brief").step("read_sheet")
for choice in sheet.options("spreadsheet_id").options:
    print(choice.value, choice.label)
tabs = sheet.options("sheet_name", settings={"spreadsheet_id": "1AbCdEf"})
```

### Step.value

```python
step.value(field, *, settings=None) -> StepValue
```

A widget's value on the step, as the app loads it beside the step's settings: a
trigger's address, minted and registered where its events come from (`webhook_url`), an
app's event subscription (`subscription_status`), the files in a filesystem step's
volume (`file_browser`), an alarm's schedules (`active_alarms`), an MCP step's hosted
link (`hosted_url`). `settings` are laid over the step's saved ones. One that mints or
registers something changes the account, and takes what changing the workflow takes; one
that only reads (a list, an id from the step's account) takes read access. A hosted MCP
link's URL is its capability, so no MCP connection loads it.

Parameters:

- `field` (`str`, required)
- `settings` (`dict[str, Any] | None`, default `None`)

Returns: `StepValue` The `StepValue`: `value`, or `values` where it fills several settings at once,
and `withheld`.

Usage:

```python
hook = noclick.Workflow.from_name("Order intake").step("hook")
print(hook.value("webhook_url").values["webhook_url"])
```

### Step.update

```python
step.update(
    *, settings=None, name=None, operation=None, enabled=None, secrets=None,
    left_for_user=None
) -> Step
```

Change its settings, name or operation, or switch it off or on. `settings` merge
into what it has (a nested object merges, any other value replaces, and `None` takes
that setting out, a secret included); a field you leave out is never touched. An agent
given another `model` on another harness drops the
old harness's own settings and connections, as the app does (`notes["harness_switch"]`
says what went). Values are judged as a run judges them: one that can't be is refused
with `noclick.InvalidRequest` naming the field, and nothing changes.

`secrets` (an agent step's) are the account's own secrets in its shell's environment
on every run, `noclick.Secret` objects or their names, replacing the ones it had
(`[]` takes them all off). Only a key acting for the whole account of the workflow's
owner gives a step one, and an agent's own tools as your approval settings let them
(`attach_connection`, allowed by default); any other caller keeps or drops what it
was given. Their values never show in a read of the workflow, nor to the agent's model.

`left_for_user` names settings to leave for the step's person to fill in: a value only
they know (their own address, number or URL). Each is cleared and noted on the step, so a
required one reads `left_for_user` in the step's `verdict` and the workflow's
readiness, never an invalid setting, until it's given a value; giving it one takes it
off the note. It's how code or an agent that builds a workflow says "this one is yours"
without making a value up. A name that isn't one of the step's settings, or one given a
value in the same call, is refused. A value that only stands in for one
(`YOUR_PHONE_NUMBER`, `<your website url>`) is refused too, naming this instead.

Parameters:

- `settings` (`dict[str, Any] | None`, default `None`)
- `name` (`str | None`, default `None`)
- `operation` (`str | None`, default `None`)
- `enabled` (`bool | None`, default `None`)
- `secrets` (`Any`, default `None`)
- `left_for_user` (`Any`, default `None`)

Returns: `Step` This step as written, with `notes` and `verdict`.

Usage:

```python
brief = noclick.Workflow.from_name("Morning brief")
send = brief.step("send_summary")
send.update(settings={"to": "team@acme.com", "subject": "Today"}, name="Email the team")
print(send.verdict)   # {"config_valid": True}
brief.step("summarize").update(secrets=["warehouse"])

alert = noclick.Workflow.from_name("Site monitor").step("text_me")
alert.update(left_for_user=["to_number", "from_number"])   # only its owner knows these
print(alert.verdict["left_for_user"])                      # ['to_number', 'from_number']
```

### Step.patch

```python
step.patch(field, patch) -> Step
```

Change part of one long text setting (an agent's instructions, a step's code)
with a patch: `@@` lines naming text that's there, then `-` lines to remove and
`+` lines to add. Text the patch names that isn't there is refused.

Parameters:

- `field` (`str`, required)
- `patch` (`str`, required)

Returns: `Step` This step as written.

Usage:

```python
writer = noclick.Workflow.from_name("Morning brief").step("writer")
writer.patch("system_prompt", "@@ Keep it short.\n-Keep it short.\n+Keep it under five lines.")
```

### Step.remove

```python
step.remove() -> None
```

Take the step out of the workflow, with its edges. A trigger's schedule or webhook
stops with it. Removing a step that holds an app, conversations or files deletes them for
good, so it may be held for the account's owner (`noclick.ApprovalRequired`), as a
batch is (`Workflow.edit`).

Usage:

```python
noclick.Workflow.from_name("Morning brief").step("old_digest").remove()
```

### Step.connect

```python
step.connect(other, *, kind='data', handle=None, target_handle=None) -> Step
```

Wire this step into `other` (a `Step` or its id). `kind="data"` runs `other`
after it with its output; `kind="tools"` makes its operations tools of `other`, an
agent (or an MCP step). `handle` names which of this step's outputs, for a step with
several (an iteration's `loop`), and `target_handle` which of `other`'s inputs (a
code step's `state`). Connecting what's already connected changes nothing.

Parameters:

- `other` (`Any`, required)
- `kind` (`str`, default `'data'`)
- `handle` (`str | None`, default `None`)
- `target_handle` (`str | None`, default `None`)

Returns: `Step` This step; `notes` holds the edge (`edge_id`, `kind`).

Usage:

```python
brief = noclick.Workflow.from_name("Morning brief")
brief.step("summarize").connect("send_summary")
brief.step("linear").connect("triage_agent", kind="tools")
```

### Step.disconnect

```python
step.disconnect(other, *, handle=None) -> Step
```

Remove the edge from this step to `other` (a `Step` or its id); one that isn't
there raises `noclick.InvalidRequest`.

Parameters:

- `other` (`Any`, required)
- `handle` (`str | None`, default `None`)

Returns: `Step` This step.

Usage:

```python
noclick.Workflow.from_name("Morning brief").step("summarize").disconnect("send_summary")
```

### Step.set_connection

```python
step.set_connection(connection, *, slot=None) -> Step
```

Connect an account to the step: one of the account's own connections, as a
`noclick.Connection` (connected in the app, `credential:<id>`, or a named one), its
ref or id, or a named connection's name; the step takes the account it holds. Its slot
is the account's own type unless `slot` names it. `connection=None` with `slot`
takes the account in that slot off. One of a user's connections, one holding no
working account, or one your account may not use is refused (`noclick.InvalidRequest`
naming it), as is one of a type the step doesn't take; a caller that doesn't act for
the whole account (a user's key, an app's code) only keeps one the workflow already
uses. An agent's own tools attach your account's own connections in your account's own
workflows, never another member's, a user's or one held for someone else, as your
approval settings let them (`attach_connection`: allowed by default; asked, the edit
waits for the owner's yes, `noclick.ApprovalRequired`).

Parameters:

- `connection` (`Any`, required)
- `slot` (`str | None`, default `None`)

Returns: `Step` This step, its `connections` as written.

Usage:

```python
brief = noclick.Workflow.from_name("Morning brief")
gmail = noclick.Connection.from_id("credential:9b2a1c5e-7d9f-4a31-8f6d-3f1d2c4b8a7e")
brief.step("send_summary").set_connection(gmail)
brief.step("post").set_connection("work-slack")  # a named connection, by its name
```

### Step.mock

```python
step.mock(output) -> Step
```

Have the step give `output` on test runs instead of running (no email sent,
no API called), so the steps after it can be tried.

Parameters:

- `output` (`Any`, required)

Returns: `Step` This step, its `mock_output` set.

Usage:

```python
brief = noclick.Workflow.from_name("Morning brief")
brief.step("read_calendar").mock({"events": [{"title": "Standup", "start": "09:00"}]})
```

### Step.unmock

```python
step.unmock() -> Step
```

Have the step run for real on test runs again.

Returns: `Step` This step.

Usage:

```python
noclick.Workflow.from_name("Morning brief").step("read_calendar").unmock()
```

### Step.run

```python
step.run(*, only=False, user=..., idempotency_key=None) -> Operation
```

Run the workflow from this step: it and what comes after it (`only=True`: it alone), the steps
before it giving the outputs they last stored. `Workflow.run(from_step=...)` says more.

Parameters:

- `only` (`bool`, default `False`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `idempotency_key` (`str | None`, default `None`): Makes a retried create safe: the same key returns the first result. Generated when omitted.

Returns: `Operation` An operation whose `.wait()` gives the finished `WorkflowRun`.

Usage:

```python
summarize = noclick.Workflow.from_name("order-intake").step("summarize")
print(summarize.run(only=True).wait().outputs)
```

### Step.outputs

```python
step.outputs(*, search=None, limit=10, user=...) -> list[StepOutput]
```

What the step produced, run by run, newest first, each a `StepOutput` with its run,
how that run started, the step's status there and a one-line `preview`. A trigger's
deliveries are its outputs (`no_event` marks a manual run's placeholder). `search`
keeps those holding the text (any case), reading 100 at a time. Inside `as_user` (or
with `user=`) only the runs recorded for that user are read.

Parameters:

- `search` (`str | None`, default `None`)
- `limit` (`int | None`, default `10`): Return at most this many.
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `list[StepOutput]` The newest `limit` (10 by default; `None` for every one).

Usage:

```python
hook = noclick.Workflow.from_name("order-intake").step("hook")
for out in hook.outputs(search="o_1042"):
    print(out.created_at, out.source, out.preview)
```

### Step.output

```python
step.output(run_id, *, path=None, full=False, iteration=None, user=...) -> StepOutput
```

What the step produced in one run (`run_id`, as `outputs()` or `Workflow.runs()`
name it): its `output`, long text and lists cut short unless `full`, or only the
part at `path` (`payload.items[0].id`, as a preview names it). `iteration` reads
one iteration of a step that runs in a loop. Never a secret (`withheld`); a path to
one raises `noclick.InvalidRequest`, as does a path that isn't there (naming what is).

Parameters:

- `run_id` (`str`, required)
- `path` (`str | None`, default `None`)
- `full` (`bool`, default `False`)
- `iteration` (`int | None`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `StepOutput` The `StepOutput`; a run the step stored nothing in raises `noclick.NotFound`.

Usage:

```python
hook = noclick.Workflow.from_name("order-intake").step("hook")
latest = hook.outputs(limit=1)[0]
print(hook.output(latest.run_id, path="items[0].sku").output)
```

### Step.preview_expression

```python
step.preview_expression(expression, *, samples=None, user=...) -> ExpressionPreview
```

What an expression in one of the step's settings gives, evaluated as a run
evaluates it (what goes inside `{{ }}`, like `$('hook').order_id` or
`$json.items.length`), as the app's editor previews it while you type. It's
evaluated against what every other step last stored (never a secret, so an
expression reaching one finds nothing there), or against `samples`, each step's
output by step id (`vars` the workflow's variables). `$json` is the step's one
input's output, when it has one. Changes nothing.

Parameters:

- `expression` (`str`, required)
- `samples` (`dict[str, Any] | None`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `ExpressionPreview` The `ExpressionPreview`; an expression that fails has `ok` False and its `error`.

Usage:

```python
note = noclick.Workflow.from_name("order-intake").step("summarize")
print(note.preview_expression("$('hook').items.length").preview)   # 2
```

### Step.hosted_mcp

```python
step.hosted_mcp(*, tools=False, user=...) -> HostedMcpStatus
```

How an MCP step's hosted link stands: whether it's made (`exists`) and active, and
the last request a client made of it (`client_name`, `last_method`, `tool_count`,
`first_tools_at`, `seconds_since_seen`; `liveness_available` False when that
couldn't be read, never "no client yet"). With `tools`, what the link serves now
(`tools_ready`, the first few names in `tools_sample`), resolved from the stored
graph: ask once and keep it. Never the link itself.

Parameters:

- `tools` (`bool`, default `False`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `HostedMcpStatus` The `HostedMcpStatus`.

Usage:

```python
link = noclick.Workflow.from_name("crm-tools").step("mcp").hosted_mcp(tools=True)
print(link.tools_ready, link.client_name or "no client yet")
```

### Step.clear_state

```python
step.clear_state() -> ClearedStepState
```

Forget what the step keeps between runs, as the app's Clear state does: its state
(an RSS step's seen items, a State step's values) and its conversations (an agent
step's threads), so its next run starts fresh. Clearing an agent step deletes its
conversations for good: a deletion, which through MCP waits for your account's owner
(preview it with `POST /v1/delete_previews`). Takes what changing the workflow
takes, and always acts for your account, never one of your users: an agent step's
threads are every user's.

Returns: `ClearedStepState` How many state records and conversations were deleted.

Usage:

```python
feed = noclick.Workflow.from_name("news digest").step("rss")
print(feed.clear_state().state_rows_deleted)   # 1
```

### Step.conversations

```python
step.conversations(*, limit=100) -> list[StepConversation]
```

Your chats with this agent step, most recently active first, as the app's chat
history lists them. Each is the person's who had it: another member's chats with the
same step aren't yours to read, and a key acting for one of your users has none.

Parameters:

- `limit` (`int`, default `100`): Return at most this many.

Returns: `list[StepConversation]` Up to `limit` `StepConversation` (100 at most).

Usage:

```python
helper = noclick.Workflow.from_name("support desk").step("helper")
for chat in helper.conversations():
    print(chat.conversation, chat.title)
```

### Step.conversation

```python
step.conversation(conversation) -> StepConversation
```

One of your chats with this agent step, with its `messages` as the app's chat
stores and draws them (a trigger's event with its output, a reply with its steps),
oldest first. A turn whose run died before saying so is ended first.

Parameters:

- `conversation` (`str`, required)

Returns: `StepConversation` The `StepConversation`; one that isn't yours raises `noclick.NotFound`.

Usage:

```python
thread = noclick.Workflow.from_name("support desk").step("helper").conversation("orders")
print(thread.messages[-1]["message"])
```

### Step.delete_conversation

```python
step.delete_conversation(conversation) -> None
```

Delete one of your chats with this agent step, for good, as the app's chat history
does. Through MCP it's a deletion that waits for your account's owner (preview it with
`POST /v1/delete_previews`).

Parameters:

- `conversation` (`str`, required)

Usage:

```python
noclick.Workflow.from_name("support desk").step("helper").delete_conversation("orders")
```

### Step.decide_proposal

```python
step.decide_proposal(conversation, proposal_id, decision) -> None
```

Answer a change this agent step proposed to its own workflow in one of your chats
(the card its `prompt_builder` tool shows): `"approved"` or `"dismissed"`. The
verdict is kept in the conversation and the agent hears it on its next turn; approving
takes edit access to the workflow (the change itself is a build you start).

Parameters:

- `conversation` (`str`, required)
- `proposal_id` (`str`, required)
- `decision` (`str`, required)

Usage:

```python
helper = noclick.Workflow.from_name("support desk").step("helper")
helper.decide_proposal("__interface_chat__", "a1b2c3d4e5f6", "dismissed")
```

### Step.message

```python
step.message(
    text='', *, conversation=None, attachments=None, model=None, idempotency_key=None
) -> Operation
```

Say something to this agent step in one of your chats, as the app's chat does: a
run from the step (what comes after it runs too, on the workflow as saved) whose turn
is `text`, handed to the agent as written (a `{{ }}` in it is text). `conversation`
names the chat (a new key starts one; omitted, the app's chat's own), `attachments`
are uploaded files it reads with it (each `{resource_id, url, name, mime_type, size_bytes}`) and `model` the model this turn runs on. Someone the workflow is
shared with to view may say something too.

Parameters:

- `text` (`str`, default `''`)
- `conversation` (`str | None`, default `None`)
- `attachments` (`Sequence[Mapping[str, Any]] | None`, default `None`)
- `model` (`str | None`, default `None`)
- `idempotency_key` (`str | None`, default `None`): Makes a retried create safe: the same key returns the first result. Generated when omitted.

Returns: `Operation` The run's operation: `.wait()` gives the finished `WorkflowRun`; the reply is in
the conversation (`Step.conversation`).

Usage:

```python
helper = noclick.Workflow.from_name("support desk").step("helper")
helper.message("Where's order 1042?", conversation="orders").wait()
print(helper.conversation("orders").messages[-1]["message"])
```

### Step.share

```python
step.share() -> ShareLink
```

Turn on this agent step's public chat page, or read it if it's on, as the app's
Share does: anyone with the link chats with the step, no account needed, each visitor
in their own conversations, on your credits. Only the workflow's owner may.

Returns: `ShareLink` The `ShareLink`: its `url`, and `disable()` and `rotate()` to turn it off or
change it.

Usage:

```python
link = noclick.Workflow.from_name("support desk").step("helper").share()
print(link.url)   # https://noclick.com/a/...
```

### Step.share_link

```python
step.share_link() -> ShareLink | None
```

This agent step's chat page as it is, without turning it on (`share()` does that).

Returns: `ShareLink | None` The `ShareLink`, `enabled` or not, or `None` if the step has never been shared.

Usage:

```python
link = noclick.Workflow.from_name("support desk").step("helper").share_link()
print(link.url if link and link.enabled else "Not shared")
```

### Step.workspace

```python
step.workspace(conversation=None) -> StepWorkspace
```

The files on one of this agent step's conversations' workspace, as the app's chat
shows them: what the step's sandbox mounts for `conversation` (a wired filesystem
step, else the conversation's own `/workspace`). Anyone who opens the workflow reads
it; a conversation with none (`conversation` omitted) lists nothing.

Parameters:

- `conversation` (`str | None`, default `None`)

Returns: `StepWorkspace` The `StepWorkspace`: its `files`, and an `upload_url` when you may change the
workflow.

Usage:

```python
helper = noclick.Workflow.from_name("support desk").step("helper")
for file in helper.workspace("orders").files:
    print(file.path, file.url)
```

### Step.delete_workspace_file

```python
step.delete_workspace_file(path, *, conversation=None) -> None
```

Delete one file from a conversation's workspace, as the app's chat does; a missing
file does nothing. Takes what changing the workflow takes.

Parameters:

- `path` (`str`, required)
- `conversation` (`str | None`, default `None`)

Usage:

```python
noclick.Workflow.from_name("support desk").step("helper").delete_workspace_file(
    "out/report.md", conversation="orders")
```

### Step.app

```python
step.app() -> StepPublication
```

Read this interface step's app as it stands. Takes read access to the workflow.

Returns: `StepPublication` The `StepPublication`: `state` `published` (at its `url`), `unpublished`
(in the trash, which `trash_id` restores until `restorable_until`, back at the
`subdomain` it kept) or `not_published`, and the `apps_domain` a first publish
puts it on.

Usage:

```python
page = noclick.Workflow.from_name("Morrow Bakehouse site").step("page")
print(page.app().state)   # "published"
```

### Step.check_address

```python
step.check_address(subdomain) -> PublishAddress
```

Check whether this interface step's app may be published (or renamed) at
`subdomain`: free, or the address it already holds; never one another app holds.
Changes nothing.

Parameters:

- `subdomain` (`str`, required)

Returns: `PublishAddress` The `PublishAddress`: `available`, else the `reason` it isn't.

Usage:

```python
page = noclick.Workflow.from_name("Morrow Bakehouse site").step("page")
if page.check_address("morrow").available:
    page.publish("morrow")
```

### Step.publish

```python
step.publish(subdomain=None, *, title=None) -> StepPublication
```

Put this interface step's app live as the app's canvas does, with no build: at
`subdomain` the first time (`morrow` is `morrow.noclick.app`); again, the saved
edits at the address it has (a `subdomain` other than its own raises
`noclick.Conflict`: `rename_app` moves it). An app in the trash comes back where it
was. Its pages carry the account's one key for it. Takes what changing the workflow
takes, and through MCP `deploy`, as `Workflow.publish` does.

Parameters:

- `subdomain` (`str | None`, default `None`)
- `title` (`str | None`, default `None`)

Returns: `StepPublication` The `StepPublication`: `state` `published`, the app's `url`, its
`project_id` and `subdomain`, and the release (`deployment_id`).

Usage:

```python
site = noclick.Workflow.from_name("Morrow Bakehouse site").step("page")
print(site.publish("morrow").url)   # https://morrow.noclick.app
```

### Step.rename_app

```python
step.rename_app(subdomain) -> StepPublication
```

Move this interface step's app to `subdomain`, publishing no edits; its old
address stops answering.

Parameters:

- `subdomain` (`str`, required)

Returns: `StepPublication` The `StepPublication`: `state` `renamed`, the new `url` and where it was
(`previous_url`).

Usage:

```python
noclick.Workflow.from_name("Morrow Bakehouse site").step("page").rename_app("morrow-bakery")
```

### Step.unpublish

```python
step.unpublish() -> StepPublication
```

Take this interface step's app down, to the trash: its public URL stops answering and
its page's key stops working. For 30 days its address stays its own, and restoring it
(or `publish()`) brings it back there with the same key. One not published changes
nothing.

Returns: `StepPublication` The `StepPublication`: `state` `unpublished`, where it answered
(`previous_url`) and the `trash_id` that restores it until `restorable_until`.

Usage:

```python
gone = noclick.Workflow.from_name("Morrow Bakehouse site").step("page").unpublish()
noclick.TrashItem.from_id(gone.trash_id).restore()
```

## noclick.StepOption

```python
class StepOption
```

One choice a step's setting takes, as the app's dropdown lists it: its `value` (what the setting takes),
its `label` and what the service says beside it (`metadata`: an icon, a count, `None` for none).

| Attribute | Type | Description |
| --- | --- | --- |
| `value` | `Any` |  |
| `label` | `Any` |  |
| `metadata` | `dict[str, Any] | None` |  |

## noclick.StepOptions

```python
class StepOptions
```

A page of the choices a step's `field` takes (`Step.options`). `next_page_token` reads the next page;
`withheld` names, by path, a choice or a part of one left out because it held a secret.

| Attribute | Type | Description |
| --- | --- | --- |
| `field` | `str` |  |
| `options` | `list[StepOption]` |  |
| `next_page_token` | `str | None` |  |
| `withheld` | `list[str]` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.StepPublication

```python
class StepPublication
```

What `Step.publish`, `Step.rename_app` and `Step.unpublish` left of an interface step's app: its
`state` (`published`, `renamed` or `unpublished`) and `url`, as a build's `published` names them;
the app itself (`project_id`, a `noclick.Project`'s id, and its `subdomain`); the release a publish made
(`deployment_id`); where it answered before a rename or an unpublish (`previous_url`); and, unpublished,
the trash entry that restores it (`trash_id`) until `restorable_until`.

| Attribute | Type | Description |
| --- | --- | --- |
| `workflow_id` | `str` |  |
| `step_id` | `str` |  |
| `action` | `str` |  |
| `state` | `str` |  |
| `url` | `str | None` |  |
| `project_id` | `str | None` |  |
| `subdomain` | `str | None` |  |
| `deployment_id` | `str | None` |  |
| `previous_url` | `str | None` |  |
| `trash_id` | `str | None` |  |
| `restorable_until` | `Any` |  |
| `apps_domain` | `str | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.PublishAddress

```python
class PublishAddress
```

What `Step.check_address` found: whether the interface step's app may go at
`subdomain` (`available`), else `reason`; `apps_domain` is the domain it's on.

| Attribute | Type | Description |
| --- | --- | --- |
| `subdomain` | `str` |  |
| `available` | `bool` |  |
| `reason` | `str | None` |  |
| `apps_domain` | `str | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.WorkflowState

```python
class WorkflowState
```

What a workflow's State step keeps: its `values` by key, and the `step_id`
keeping them (`None`, and nothing kept, in a workflow with no State step).

| Attribute | Type | Description |
| --- | --- | --- |
| `workflow_id` | `str` |  |
| `step_id` | `str | None` |  |
| `values` | `dict[str, Any]` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.StepValue

```python
class StepValue
```

A widget's value on a step (`Step.value`): `value`, or `values` where it fills several of the step's
settings at once (a trigger's address, whether it's registered, why not). `withheld` names, by path, what was
left out because it held a secret (a webhook's signing secret, a signed upload link).

| Attribute | Type | Description |
| --- | --- | --- |
| `field` | `str` |  |
| `value` | `Any` |  |
| `values` | `dict[str, Any] | None` |  |
| `withheld` | `list[str]` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.EditBatch

```python
class EditBatch
```

The edits `Workflow.edit()` collects: each method queues one, and the `with`
block's end sends them as one batch, applied in order as one version, or not at all
(an op that can't apply raises `noclick.InvalidRequest` naming it, and nothing of
the batch lands). A block that raises sends nothing.

Steps are named by `Step` or by id; a step `add_step` queues has its id already,
so later edits in the batch can name it. After the block, `result` is the
`WorkflowEdit`.

| Attribute | Type | Description |
| --- | --- | --- |
| `ops` | `list[dict[str, Any]]` | The edits queued so far, as the API takes them (a connection given as an object is resolved when sent). |
| `result` | `WorkflowEdit | None` | What the batch did, once it was sent (`None` before, or when nothing was queued). |

### EditBatch.add_step

```python
edit_batch.add_step(
    type, *, operation=None, settings=None, name=None, id=None, position=None,
    secrets=None, left_for_user=None
) -> Step
```

Queue a new step of `type` (`automation-gmail`, `agent`, `trigger-cron`),
doing `operation` with `settings`. `id` names it (made from its type when left
out); without `position` it's laid out beside the rest. An agent step's `secrets`
and the settings `left_for_user` are as `Step.update` takes them.

Parameters:

- `type` (`str`, required)
- `operation` (`str | None`, default `None`)
- `settings` (`dict[str, Any] | None`, default `None`)
- `name` (`str | None`, default `None`)
- `id` (`str | None`, default `None`)
- `position` (`Position | None`, default `None`)
- `secrets` (`Any`, default `None`)
- `left_for_user` (`Any`, default `None`)

Returns: `Step` The step, whose `id` later edits in the batch can name. Its fields load once the batch is sent.

Usage:

```python
brief = noclick.Workflow.from_name("Morning brief")
with brief.edit() as e:
    post = e.add_step("automation-slack", operation="send_message_to_channel", name="Post it",
                      settings={"channel": "#team", "text": "{{ $('summarize').text }}"})
    e.connect("summarize", post)
    e.set_connection(post, "work-slack")
```

### EditBatch.update_step

```python
edit_batch.update_step(
    step, *, settings=None, name=None, operation=None, enabled=None, secrets=None,
    left_for_user=None
) -> None
```

Queue a change to a step, as `Step.update` makes it (`secrets` and `left_for_user` too).

Parameters:

- `step` (`Any`, required)
- `settings` (`dict[str, Any] | None`, default `None`)
- `name` (`str | None`, default `None`)
- `operation` (`str | None`, default `None`)
- `enabled` (`bool | None`, default `None`)
- `secrets` (`Any`, default `None`)
- `left_for_user` (`Any`, default `None`)

Usage:

```python
with noclick.Workflow.from_name("Morning brief").edit() as e:
    e.update_step("send_summary", settings={"subject": "Today"}, enabled=True)
    e.update_step("summarize", secrets=["warehouse"])
    e.update_step("text_me", left_for_user=["to_number"])
```

### EditBatch.patch_step

```python
edit_batch.patch_step(step, field, patch) -> None
```

Queue a patch to one long text setting of a step, as `Step.patch` makes it.

Parameters:

- `step` (`Any`, required)
- `field` (`str`, required)
- `patch` (`str`, required)

Usage:

```python
with noclick.Workflow.from_name("Morning brief").edit() as e:
    e.patch_step("writer", "system_prompt", "@@ Keep it short.\n-Keep it short.\n+Keep it brief.")
```

### EditBatch.remove_step

```python
edit_batch.remove_step(step) -> None
```

Queue taking a step (or a note) out, with its edges.

Parameters:

- `step` (`Any`, required)

Usage:

```python
with noclick.Workflow.from_name("Morning brief").edit() as e:
    e.remove_step("old_digest")
```

### EditBatch.connect

```python
edit_batch.connect(
    source, target, *, kind='data', handle=None, target_handle=None, id=None
) -> None
```

Queue an edge from `source` into `target`, as `Step.connect` makes it
(`kind="tools"` wires `source` into an agent as its tools). `id` names the edge
(made for it when left out), as a canvas names its own.

Parameters:

- `source` (`Any`, required)
- `target` (`Any`, required)
- `kind` (`str`, default `'data'`)
- `handle` (`str | None`, default `None`)
- `target_handle` (`str | None`, default `None`)
- `id` (`str | None`, default `None`)

Usage:

```python
with noclick.Workflow.from_name("Morning brief").edit() as e:
    e.connect("every_morning", "summarize")
```

### EditBatch.disconnect

```python
edit_batch.disconnect(source, target, *, handle=None, id=None) -> None
```

Queue removing the edge from `source` into `target` (`id`: the one edge of
that id, when two join them).

Parameters:

- `source` (`Any`, required)
- `target` (`Any`, required)
- `handle` (`str | None`, default `None`)
- `id` (`str | None`, default `None`)

Usage:

```python
with noclick.Workflow.from_name("Morning brief").edit() as e:
    e.disconnect("summarize", "send_summary")
```

### EditBatch.set_connection

```python
edit_batch.set_connection(step, connection, *, slot=None) -> None
```

Queue connecting an account to a step, as `Step.set_connection` does
(`connection=None` with `slot` takes one off).

Parameters:

- `step` (`Any`, required)
- `connection` (`Any`, required)
- `slot` (`str | None`, default `None`)

Usage:

```python
gmail = noclick.Connection.from_id("credential:9b2a1c5e-7d9f-4a31-8f6d-3f1d2c4b8a7e")
with noclick.Workflow.from_name("Morning brief").edit() as e:
    e.set_connection("send_summary", gmail)
```

### EditBatch.mock_step

```python
edit_batch.mock_step(step, output) -> None
```

Queue giving a step `output` on test runs instead of running it.

Parameters:

- `step` (`Any`, required)
- `output` (`Any`, required)

Usage:

```python
with noclick.Workflow.from_name("Morning brief").edit() as e:
    e.mock_step("read_calendar", {"events": []})
```

### EditBatch.unmock_step

```python
edit_batch.unmock_step(step) -> None
```

Queue having a step run for real on test runs again.

Parameters:

- `step` (`Any`, required)

Usage:

```python
with noclick.Workflow.from_name("Morning brief").edit() as e:
    e.unmock_step("read_calendar")
```

### EditBatch.update_workflow

```python
edit_batch.update_workflow(
    *, name=None, description=None, settings=None, display_metadata=None,
    interface=None
) -> None
```

Queue a change to the workflow's own fields, as `Workflow.update` makes it.
`display_metadata` replaces what the app shows of it (its canvas's viewport, the step
open in its panel; 16 KB at most): never a version, nor a change anyone is told of.
`interface` replaces its Interface tab's layout as the app draws it (each block's
place on the grid, the tabs' order; 256 KB at most): part of its graph, so a version.

Parameters:

- `name` (`str | None`, default `None`)
- `description` (`str | None`, default `None`)
- `settings` (`dict[str, Any] | None`, default `None`)
- `display_metadata` (`dict[str, Any] | None`, default `None`)
- `interface` (`dict[str, Any] | None`, default `None`)

Usage:

```python
with noclick.Workflow.from_name("Morning brief").edit() as e:
    e.update_workflow(description="Emails the team the day's calendar at 8.")
```

### EditBatch.move

```python
edit_batch.move(step, position, *, width=None, height=None) -> None
```

Queue moving a step (or a note) on the canvas, to `(x, y)`, and for one drawn at a
size (a note) giving it `width` and `height`. Moving things is never a version of
its own.

Parameters:

- `step` (`Any`, required)
- `position` (`Position`, required)
- `width` (`float | None`, default `None`)
- `height` (`float | None`, default `None`)

Usage:

```python
with noclick.Workflow.from_name("Morning brief").edit() as e:
    e.move("send_summary", (640, 120))
```

### EditBatch.layout

```python
edit_batch.layout() -> None
```

Queue laying every step out again, as the app's Tidy up does.

Usage:

```python
with noclick.Workflow.from_name("Morning brief").edit() as e:
    e.layout()
```

### EditBatch.add_note

```python
edit_batch.add_note(
    content, *, id=None, color=None, near=None, direction=None, after=None,
    before=None, width=None, height=None, position=None
) -> Step
```

Queue a note on the canvas, as `Workflow.add_note` makes it (`position`: where it
sits, instead of beside steps).

Parameters:

- `content` (`str`, required)
- `id` (`str | None`, default `None`)
- `color` (`int | None`, default `None`)
- `near` (`Sequence[Any] | None`, default `None`)
- `direction` (`str | None`, default `None`)
- `after` (`Any`, default `None`)
- `before` (`Any`, default `None`)
- `width` (`int | None`, default `None`)
- `height` (`int | None`, default `None`)
- `position` (`Position | None`, default `None`)

Returns: `Step` The note, a step of type `stickyNote` whose `id` later edits can name.

Usage:

```python
with noclick.Workflow.from_name("Morning brief").edit() as e:
    e.add_note("Runs at 8 on weekdays.", near=["every_morning"])
```

### EditBatch.define_variable

```python
edit_batch.define_variable(name, *, value='', description=None, per_user=False) -> None
```

Queue defining a workflow variable: a value its steps read as `{{vars.name}}`,
changed in one place. `per_user=True` asks each person who copies the workflow for
their own. Only the workflow's owner defines one.

Parameters:

- `name` (`str`, required)
- `value` (`str`, default `''`)
- `description` (`str | None`, default `None`)
- `per_user` (`bool`, default `False`)

Usage:

```python
with noclick.Workflow.from_name("Morning brief").edit() as e:
    e.define_variable("team_email", value="team@acme.com", description="Who gets the brief")
```

### EditBatch.add_test_run

```python
edit_batch.add_test_run(
    trigger, name, body, *, title=None, author=None, handle=None
) -> None
```

Queue a Test Run: a message staged on `trigger` (a trigger step wired into an
agent, by step or id, or its type) that the app's Test Run plays to the agent.
Only the workflow's owner adds one.

Parameters:

- `trigger` (`Any`, required)
- `name` (`str`, required)
- `body` (`str`, required)
- `title` (`str | None`, default `None`)
- `author` (`str | None`, default `None`)
- `handle` (`str | None`, default `None`)

Usage:

```python
with noclick.Workflow.from_name("Support inbox").edit() as e:
    e.add_test_run("support_email", "Refund request", "Hi, I'd like a refund for order 1042.",
                   title="Refund for order 1042", author="ana@example.com")
```

## noclick.WorkflowEdit

```python
class WorkflowEdit
```

What an edit did: the workflow's `version` once it and what it set in motion
were written (a trigger's registration writes too), to edit on from; whether its
definition `changed` (moving things on the canvas changes none); the version of
its history it landed in (`history_version`, what `version_at` and `restore`
name: a version of its own, which this key's next edits join for five minutes from
its first; a layout-only edit is none); a `summary` of what changed; each op's
`results` in order (an added
step's `id`, and what the edit did on its own: `resolutions`,
`harness_switch`, `coerced_values`, `stripped_trigger_refs`,
`http_auth_credential_hint`); and, for each step an op touched, whether it's ready
to run (`steps`: `config_valid`, `validation_error`, `missing_required`,
`left_for_user`, `agent_credential_hint`, and `references`: each read of another step's output that
won't resolve, as `Step.references` reads them). `graph` is the workflow as written, read as
`Workflow.graph()` reads it, when the edit asked for it; `restored_from` names
the version of its history a restore put back. `warnings` say what an edit did that
won't work as it may look: a read in a touched step's settings that gets no value
(each of its `references`, in a sentence), and a workspace member's own connection
given to a team workflow's step, which its owner's automatic runs can't use. An edit sent with
`settle` also says whether what it set going finished in time (`settled`) and, by
step, why each trigger it left unregistered can't be registered yet (`unregistered`).

| Attribute | Type | Description |
| --- | --- | --- |
| `workflow_id` | `str` |  |
| `version` | `int` |  |
| `history_version` | `int | None` |  |
| `changed` | `bool` |  |
| `summary` | `str | None` |  |
| `results` | `list[dict[str, Any]]` |  |
| `steps` | `dict[str, dict[str, Any]]` |  |
| `graph` | `WorkflowGraph | None` |  |
| `restored_from` | `int | None` |  |
| `warnings` | `list[str]` |  |
| `settled` | `bool | None` |  |
| `unregistered` | `dict[str, str]` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.WorkflowVersion

```python
class WorkflowVersion
```

One version of a workflow's history: its own number (`history_version`, what
`version_at` and `restore` take, fixed once given), the workflow's `version`
its latest write left, where the change came from (`source`: `api`,
`canvas`, `builder`, `mcp`, `coordinator`, `deploy`, `restore`,
`baseline`, the workflow as it was before its history began, or `checkpoint`, one
saved in the app before its history was kept, numbered below 1), who began it
(`author`: `{user_id, key_id}`, `None` for the baseline) and everyone who
wrote into it (`authors`, its author first), a `summary` and each of its
`changes`, and for a restore the version of the history it put back
(`restored_from`). A named version (a checkpoint: `Workflow.name_version`) has its
`label` and `note`, who named it (`labeled_by`: `{user_id}`) and when
(`labeled_at`), and is kept for good while it has a name.

Saves in the app's canvas within five minutes of a session's first are one
version, whoever made them. Any other change (from your code, the builder, an MCP
client, NoClick's assistant, a restore) is a version of its own, which only the
same key's next changes from the same place join, within five minutes of its
first; so `updated_at` is its latest write. `graph` is the whole definition it
holds, its name, description and settings with its steps, read with
`Workflow.version_at` (`None` in a list): a restore puts all of it back. Its
steps are as they were then, and changing one changes the workflow's step of that
id as it is now.

| Attribute | Type | Description |
| --- | --- | --- |
| `workflow_id` | `str` |  |
| `history_version` | `int` |  |
| `version` | `int` |  |
| `source` | `str` |  |
| `author` | `dict[str, Any] | None` |  |
| `authors` | `list[dict[str, Any]]` |  |
| `summary` | `str | None` |  |
| `changes` | `list[str]` |  |
| `restored_from` | `int | None` |  |
| `created_at` | `Any` |  |
| `updated_at` | `Any` |  |
| `graph` | `WorkflowGraph | None` |  |
| `label` | `str | None` |  |
| `note` | `str | None` |  |
| `labeled_by` | `dict[str, Any] | None` |  |
| `labeled_at` | `Any` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |
| `step_count` | `int | None` | How many steps it holds (notes aside), on a version `versions(recent=True)` lists; None otherwise. |

## noclick.WorkflowVariables

```python
class WorkflowVariables
```

A workflow's variables with their values, which no other read of it carries, as they
were at `version`: `definitions` are its variables as its settings hold them, in
their order (each `{name, value, description, per_user}`; `per_user`: asked of each
new owner when the workflow is copied, and read here like any other), and `variables`
the graph's own by name, as
its Set variable steps last wrote them. `values` is what `{{vars.name}}` reads: the
two together, the graph's own winning.

| Attribute | Type | Description |
| --- | --- | --- |
| `workflow_id` | `str` |  |
| `version` | `int | None` |  |
| `definitions` | `list[dict[str, Any]]` |  |
| `variables` | `dict[str, Any]` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |
| `values` | `dict[str, Any]` | Each variable's value by name: a definition's when it has one, the graph's own over it. |

## noclick.WorkflowSetup

```python
class WorkflowSetup
```

What a workflow needs from its person before it can run (`Workflow.setup()`), derived
from it as it stands: `items`, each a dict whose `kind` is `connect` (an app to
connect, once for every step that needs it: `app`, `label`, `steps`, `reconnect`),
`setting` (a value only the person knows: its `step`, the `setting`'s name, `label`,
`type` and `options`) or `secret` (the `keys` an agent step's shell asked for, kept
as the secret `name`). `ready` is true when there's nothing. `request` is the setup
request still waiting on the person (its `id`, `operation_id` and each part's
`status`), else None; `sent` the request `request_setup()` just sent, else None.

| Attribute | Type | Description |
| --- | --- | --- |
| `workflow_id` | `str` |  |
| `ready` | `bool` |  |
| `items` | `list[dict[str, Any]]` |  |
| `request` | `dict[str, Any] | None` |  |
| `sent` | `dict[str, Any] | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.WorkflowFile

```python
class WorkflowFile
```

A file one of your workflows keeps: what a step or an interface uploaded or
produced. `url` reads it until `url_expires_at`; list again for a fresh
one. Tables are apart (`WorkflowTable`).

You read the files of each workflow `Workflow.get` reads: your account's
own, those shared with it, and the ones its agents run on. They're the
account's: acting for one of your users, it's refused. An app's own code reads
only those of a workflow its code made, named with `workflow`.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |
| `name` | `str` |  |
| `workflow` | `dict[str, Any]` | The workflow that keeps it: `{id, name, step_types}`. `step_types` is what it's made of, at a glance: at most four of its step types, its triggers first, then its agents, then the rest in the order it holds them (`['trigger-cron', 'agent:codex', 'automation-hubspot']`); an agent on a coding harness is `agent:<harness>`. Only step types and harness names, never a step's settings. |
| `access` | `str` | Your account's access to that workflow: `owner`, `editor` or `viewer`. Deleting takes owner or editor. |
| `step_id` | `str | None` | The step that keeps it, when one does. |
| `type` | `str` | What it holds: `image`, `video`, `audio`, `document` or `file`. |
| `mime_type` | `str | None` |  |
| `size_bytes` | `int` |  |
| `url` | `str | None` | A link that reads the file until `url_expires_at` (an hour after it's listed), naming nothing of where it's stored: a picture, PDF, sound or video opens in place, anything else downloads. `None` for a file with nothing stored yet. |
| `url_expires_at` | `Any` |  |
| `upload_url` | `str | None` | Only on a file `create` made: where its bytes go, in one PUT whose `Content-Type` is its `mime_type` and whose length is its `size_bytes`, until `upload_expires_at`. |
| `upload_expires_at` | `Any` |  |
| `permanent_url` | `str | None` | Only on a file `create` made: where it reads for good once uploaded, which a step or a message may carry. Anyone holding it reads the file. |
| `created_at` | `Any` |  |
| `updated_at` | `Any` |  |

### WorkflowFile.from_id

```python
noclick.WorkflowFile.from_id(file_id, *, client=None) -> WorkflowFile
```

A handle to one of your workflows' files by id: nothing is read (`delete()` it, or
`get` it to read it).

Parameters:

- `file_id` (`str`, required)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `WorkflowFile` The `WorkflowFile`, its fields read only by `get`.

Usage:

```python
noclick.WorkflowFile.from_id("6f1c...").delete()
```

### WorkflowFile.get

```python
noclick.WorkflowFile.get(file_id, *, client=None) -> WorkflowFile
```

One of your workflows' files by id, as `list` shows it.

Parameters:

- `file_id` (`str`, required)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `WorkflowFile` The `WorkflowFile`, its `url` good for an hour.

Usage:

```python
menu = noclick.WorkflowFile.get("6f1c...")
print(menu.name, menu.url)
```

### WorkflowFile.create

```python
noclick.WorkflowFile.create(
    workflow, name, *, size_bytes, mime_type=None, step_id=None, type=None,
    client=None
) -> WorkflowFile
```

Make a file of `workflow` (a `Workflow` or its id) to upload: put its bytes to
`upload_url` in one PUT. `size_bytes` is at most 100 MB; `type` (`image`,
`video`, `audio`, `document`, `file`) is read from `mime_type` when left out.
Takes edit access to the workflow.

Parameters:

- `workflow` (`Any`, required)
- `name` (`str`, required)
- `size_bytes` (`int`, required)
- `mime_type` (`str | None`, default `None`)
- `step_id` (`str | None`, default `None`)
- `type` (`str | None`, default `None`)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `WorkflowFile` The `WorkflowFile` with its `upload_url` and `permanent_url`.

Usage:

```python
data = open("menu.pdf", "rb").read()
menu = noclick.WorkflowFile.create(noclick.Workflow.from_name("Cafe site"), "menu.pdf",
                                   size_bytes=len(data), mime_type="application/pdf")
httpx.put(menu.upload_url, content=data, headers={"Content-Type": "application/pdf"})
```

### WorkflowFile.list

```python
noclick.WorkflowFile.list(
    *, workflow=None, organization_id=None, limit=None, client=None
) -> list[WorkflowFile]
```

The files your workflows keep, most recently changed first: every
workflow `Workflow.get` reads, or one (`workflow`, a `Workflow` or
its id). An app's own code names a workflow its code made.

Parameters:

- `workflow` (`Any`, default `None`)
- `organization_id` (`str | None`, default `None`)
- `limit` (`int | None`, default `None`): Return at most this many.
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `list[WorkflowFile]` Every file, fetched page by page (or the first `limit`), each with a link good for an hour.

Usage:

```python
intake = noclick.Workflow.from_name("Order intake")
for file in noclick.WorkflowFile.list(workflow=intake):
    print(file.name, file.workflow["name"], file.url)
```

### WorkflowFile.list_page

```python
noclick.WorkflowFile.list_page(
    *, workflow=None, organization_id=None, cursor=None, limit=None, client=None
) -> Page
```

One page of the files your workflows keep; pass `next_cursor` back as `cursor`.

Parameters:

- `workflow` (`Any`, default `None`)
- `organization_id` (`str | None`, default `None`)
- `cursor` (`str | None`, default `None`): The `next_cursor` of the page before; omit it for the first page.
- `limit` (`int | None`, default `None`): Return at most this many.
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `Page` A page whose `data` holds the files and whose `next_cursor` is `None` on the last page.

Usage:

```python
page = noclick.WorkflowFile.list_page(organization_id="none", limit=25)
print([file.name for file in page.data])
```

### WorkflowFile.delete

```python
workflow_file.delete() -> None
```

Delete the file for good: its record and what it stored, with no
trash to restore it from. A step that reads it by its id finds nothing
there. Takes edit access to its workflow, never one of your agents runs on
(`noclick.PermissionDenied` otherwise: change that through the agent).

Usage:

```python
for file in noclick.WorkflowFile.list(workflow=noclick.Workflow.from_name("Order intake")):
    if file.name.endswith(".tmp"):
        file.delete()
```

## noclick.WorkflowTable

```python
class WorkflowTable
```

A table one of your workflows keeps rows in (a Table step's, an
interface's). Read its rows with `rows()`, never by querying the database
it names (`database_id`): how a workflow lays its tables out there may
change. You read the tables of the workflows you read their files of
(`WorkflowFile`).

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |
| `name` | `str` |  |
| `workflow` | `dict[str, Any]` | The workflow that keeps it: `{id, name, step_types}`. `step_types` is what it's made of, at a glance: at most four of its step types, its triggers first, then its agents, then the rest in the order it holds them (`['trigger-cron', 'agent:codex', 'automation-hubspot']`); an agent on a coding harness is `agent:<harness>`. Only step types and harness names, never a step's settings. |
| `access` | `str` | Your account's access to that workflow: `owner`, `editor` or `viewer`. Deleting takes owner or editor. |
| `step_id` | `str | None` | The step that keeps it, when one does. |
| `row_count` | `int | None` | How many rows it holds. |
| `database_id` | `str | None` | The database of your account's its rows are kept in (`noclick.Database.from_id`); `None` until they move there. |
| `created_at` | `Any` |  |
| `updated_at` | `Any` |  |

### WorkflowTable.from_id

```python
noclick.WorkflowTable.from_id(table_id, *, client=None) -> WorkflowTable
```

A handle to one of your workflows' tables by id: nothing is read (its rows, or
`delete()` it).

Parameters:

- `table_id` (`str`, required)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `WorkflowTable` The `WorkflowTable`.

Usage:

```python
noclick.WorkflowTable.from_id("8a2e...").delete()
```

### WorkflowTable.create

```python
noclick.WorkflowTable.create(
    workflow, name, *, step_id=None, client=None
) -> WorkflowTable
```

Make an empty table of `workflow` (a `Workflow` or its id), as an interface or a
Table step does. Takes edit access to the workflow.

Parameters:

- `workflow` (`Any`, required)
- `name` (`str`, required)
- `step_id` (`str | None`, default `None`)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `WorkflowTable` The new `WorkflowTable`.

Usage:

```python
signups = noclick.WorkflowTable.create(noclick.Workflow.from_name("Signups"), "Signups")
signups.add_rows([{"email": "ada@example.com"}])
```

### WorkflowTable.add_rows

```python
workflow_table.add_rows(rows) -> int
```

Add `rows` at its end, in order, each an object of at most 1 MB as JSON; more than
10,000 go in as several calls. Takes edit access to its workflow.

Parameters:

- `rows` (`list[dict[str, Any]]`, required)

Returns: `int` How many rows went in.

Usage:

```python
[signups] = noclick.WorkflowTable.list(workflow=noclick.Workflow.from_name("Signups"))
signups.add_rows([{"email": "ada@example.com"}, {"email": "grace@example.com"}])
```

### WorkflowTable.update_row

```python
workflow_table.update_row(row_id, data) -> None
```

Replace one row's data with `data`. Takes edit access to its workflow.

Parameters:

- `row_id` (`str`, required)
- `data` (`dict[str, Any]`, required)

Usage:

```python
[signups] = noclick.WorkflowTable.list(workflow=noclick.Workflow.from_name("Signups"))
first = signups.rows(limit=1)[0]
signups.update_row(first.id, {**first.data, "confirmed": True})
```

### WorkflowTable.remove_rows

```python
workflow_table.remove_rows(row_ids) -> int
```

Take rows out by id, for good; one it doesn't hold is passed by. Takes edit access to
its workflow.

Parameters:

- `row_ids` (`list[str]`, required)

Returns: `int` How many rows went.

Usage:

```python
[signups] = noclick.WorkflowTable.list(workflow=noclick.Workflow.from_name("Signups"))
signups.remove_rows([row.id for row in signups.rows() if not row.data.get("email")])
```

### WorkflowTable.list

```python
noclick.WorkflowTable.list(
    *, workflow=None, organization_id=None, limit=None, client=None
) -> list[WorkflowTable]
```

The tables your workflows keep, most recently changed first: every
workflow `Workflow.get` reads, or one (`workflow`, a `Workflow` or
its id). An app's own code names a workflow its code made.

Parameters:

- `workflow` (`Any`, default `None`)
- `organization_id` (`str | None`, default `None`)
- `limit` (`int | None`, default `None`): Return at most this many.
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `list[WorkflowTable]` Every table, fetched page by page (or the first `limit`).

Usage:

```python
for table in noclick.WorkflowTable.list(workflow=noclick.Workflow.from_name("Signups")):
    print(table.name, table.row_count)
```

### WorkflowTable.list_page

```python
noclick.WorkflowTable.list_page(
    *, workflow=None, organization_id=None, cursor=None, limit=None, client=None
) -> Page
```

One page of the tables your workflows keep; pass `next_cursor` back as `cursor`.

Parameters:

- `workflow` (`Any`, default `None`)
- `organization_id` (`str | None`, default `None`)
- `cursor` (`str | None`, default `None`): The `next_cursor` of the page before; omit it for the first page.
- `limit` (`int | None`, default `None`): Return at most this many.
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `Page` A page whose `data` holds the tables and whose `next_cursor` is `None` on the last page.

Usage:

```python
page = noclick.WorkflowTable.list_page(limit=25)
print([table.name for table in page.data])
```

### WorkflowTable.rows_page

```python
workflow_table.rows_page(*, cursor=None, limit=None) -> RowsPage
```

One page of its rows in the order they were added (`limit`, 1 to
10,000; 100 when left out); pass `next_cursor` back as `cursor`.

Parameters:

- `cursor` (`str | None`, default `None`): The `next_cursor` of the page before; omit it for the first page.
- `limit` (`int | None`, default `None`): Return at most this many.

Returns: `RowsPage` A page whose `data` holds each `TableRow`, whose `next_cursor` is `None` on the last page and
whose `total_count` is how many rows the table holds.

Usage:

```python
[signups] = noclick.WorkflowTable.list(workflow=noclick.Workflow.from_name("Signups"))
page = signups.rows_page(limit=500)
print([row.data["email"] for row in page.data])
```

### WorkflowTable.rows

```python
workflow_table.rows(*, limit=None) -> list[TableRow]
```

Its rows in the order they were added.

Parameters:

- `limit` (`int | None`, default `None`): Return at most this many.

Returns: `list[TableRow]` Every row, read 10,000 at a time (or the first `limit`).

Usage:

```python
[signups] = noclick.WorkflowTable.list(workflow=noclick.Workflow.from_name("Signups"))
emails = [row.data["email"] for row in signups.rows()]
```

### WorkflowTable.delete

```python
workflow_table.delete() -> None
```

Delete the table and every row in it for good, with no trash to
restore it from. A step or an interface that reads or adds to it fails
on its next run. Takes edit access to its workflow, never one of your
agents runs on (`noclick.PermissionDenied` otherwise).

Usage:

```python
[scratch] = noclick.WorkflowTable.list(workflow=noclick.Workflow.from_name("Scratch"))
scratch.delete()
```

## noclick.AgentStepWorkspace

```python
class AgentStepWorkspace
```

One of your conversations with an agent step of a workflow, as a place
its files are kept: what `Step.workspace(conversation)` reads. You list
those of your own conversations with the agent steps of every workflow
`Workflow.get` reads (never a share link's visitors', nor an agent's
workflow: an agent keeps one workspace, `agent.workspace()`). They're
your people's, never one of your users': acting for one, it's refused.

| Attribute | Type | Description |
| --- | --- | --- |
| `workflow` | `dict[str, Any]` | The workflow the step is in: `{id, name, step_types}`, as `WorkflowFile.workflow` names it. |
| `step_id` | `str` |  |
| `step_name` | `str` | The agent step's name in the app. |
| `model` | `str | None` | The model the conversation last ran on. |
| `conversation` | `str` | The conversation, as `Step.workspace` takes it. |
| `title` | `str` |  |
| `last_activity` | `Any` |  |

### AgentStepWorkspace.list

```python
noclick.AgentStepWorkspace.list(
    *, organization_id=None, limit=None, client=None
) -> list[AgentStepWorkspace]
```

Your conversations' workspaces with agent steps, most recently active first, as Resources lists them;
`organization_id` narrows to a team workspace's workflows (`"none"`: those in no workspace).

Parameters:

- `organization_id` (`str | None`, default `None`)
- `limit` (`int | None`, default `None`): Return at most this many.
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `list[AgentStepWorkspace]` Each one (or the first `limit`).

Usage:

```python
for place in noclick.AgentStepWorkspace.list():
    print(place.step_name, place.title, [f.path for f in place.files().files])
```

### AgentStepWorkspace.files

```python
agent_step_workspace.files() -> Any
```

Its files, as `Step.workspace(conversation)` reads them.

Returns: `Any` The `StepWorkspace`: its `files`, and an `upload_url` when you may change the workflow.

Usage:

```python
[place] = noclick.AgentStepWorkspace.list(limit=1)
for file in place.files().files:
    print(file.path, file.url)
```

## noclick.Share

```python
class Share
```

Who one of your resources is shared with, and what they may do with it.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |
| `resource_type` | `str` |  |
| `resource_id` | `str` |  |
| `with_` | `str` | `user` (a person, by `email`), `organization` (a team workspace) or `public` (anyone with `url`). |
| `access` | `str` | `view` or `edit`. |
| `name` | `str | None` | Who it's with, as the app names them. |
| `email` | `str | None` |  |
| `user_id` | `str | None` |  |
| `organization_id` | `str | None` |  |
| `pending` | `bool` | A person without an account yet: they get it once they make one. |
| `url` | `str | None` | A public share's page. |
| `created_at` | `Any` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |
| `resource_name` | `str | None` | The resource's name and who shared it, on a share read alone (`retrieve`). |
| `shared_by_name` | `str | None` |  |

### Share.retrieve

```python
noclick.Share.retrieve(share_id, *, client=None) -> Share
```

One share, for the person it's with (`watch`'s `share` change says something was shared with
you) or someone who manages the resource's shares: with the resource's `resource_name` and who
shared it, `shared_by_name`.

Parameters:

- `share_id` (`str`, required)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `Share` The `Share`.

Usage:

```python
share = noclick.Share.retrieve(share_id)
print(f"{share.shared_by_name} shared {share.resource_name} ({share.access})")
```

### Share.list

```python
noclick.Share.list(resource, *, resource_type=None, client=None) -> list[Share]
```

Who `resource` (a `Workflow`, or any resource's id with its `resource_type`) is shared with. Only someone who manages its shares reads them.

Parameters:

- `resource` (`Any`, required)
- `resource_type` (`str | None`, default `None`)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `list[Share]` Each share, with whom (`with_`, `name`) and what it allows (`access`).

Usage:

```python
for share in noclick.Share.list(noclick.Workflow.from_name("Order intake")):
    print(share.name, share.access, share.pending)
```

### Share.create

```python
noclick.Share.create(
    resource, *, email=None, organization_id=None, public=False, access='view',
    resource_type=None, client=None
) -> Share
```

Share `resource` with a person by `email` (they're told; someone without an account gets it once they
make one), a team workspace (`organization_id`), or, for a workflow, anyone with the link (`public`,
always to view). Sharing again with the same one changes its `access` (`view` or `edit`).

Parameters:

- `resource` (`Any`, required)
- `email` (`str | None`, default `None`)
- `organization_id` (`str | None`, default `None`)
- `public` (`bool`, default `False`)
- `access` (`str`, default `'view'`)
- `resource_type` (`str | None`, default `None`)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `Share` The share.

Usage:

```python
noclick.Share.create(noclick.Workflow.from_name("Order intake"), email="sam@example.com", access="edit")
```

### Share.update

```python
share.update(access, *, client=None) -> Share
```

Change what it allows (`view` or `edit`).

Parameters:

- `access` (`str`, required)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `Share` The share as it is now.

Usage:

```python
[share] = noclick.Share.list(noclick.Workflow.from_name("Order intake"))
share.update("view")
```

### Share.delete

```python
share.delete(*, client=None) -> None
```

End it: whoever it was with stops seeing the resource (sharing it again gives it back).

Parameters:

- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Usage:

```python
for share in noclick.Share.list(noclick.Workflow.from_name("Order intake")):
    if share.pending:
        share.delete()
```

### Share.leave

```python
noclick.Share.leave(resource, *, resource_type=None, client=None) -> bool
```

Stop seeing something shared with you: your own share of it goes.

Parameters:

- `resource` (`Any`, required)
- `resource_type` (`str | None`, default `None`)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `bool` False when there was none to drop (it reaches you through a team workspace or a shared folder).

Usage:

```python
noclick.Share.leave("6f1c…", resource_type="workflow")
```

### Share.invite_link

```python
noclick.Share.invite_link(workflow, *, client=None) -> ShareInviteLink
```

A personal workflow's invite link: whoever opens it signed in joins the workflow as a collaborator. Its
owner makes it the first time; anyone it's shared with reads the one that's on.

Parameters:

- `workflow` (`Any`, required)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `ShareInviteLink` The link's `url` and the `access` it gives.

Usage:

```python
print(noclick.Share.invite_link(noclick.Workflow.from_name("Order intake")).url)
```

### Share.accept_invite

```python
noclick.Share.accept_invite(token, *, client=None) -> ShareInviteAccepted
```

Join a workflow through its invite link's `token`, signed in: you get the link's access to it, as a
share of your own. Accepting again changes nothing.

Parameters:

- `token` (`str`, required)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `ShareInviteAccepted` The workflow's id and name, and whether the session's token should be refreshed to see it.

Usage:

```python
joined = noclick.Share.accept_invite(token)
print(joined.workflow_id, joined.workflow_name)
```

## noclick.ShareInviteAccepted

```python
class ShareInviteAccepted
```

The workflow an invite link joined you to (`Share.accept_invite`).

| Attribute | Type | Description |
| --- | --- | --- |
| `workflow_id` | `str` |  |
| `workflow_name` | `str | None` |  |
| `refresh_session` | `bool` | The session's token should be refreshed for it to see the workflow. |

## noclick.ShareInviteLink

```python
class ShareInviteLink
```

A personal workflow's invite link: whoever opens it signed in joins the workflow with its `access`.

| Attribute | Type | Description |
| --- | --- | --- |
| `workflow_id` | `str` |  |
| `url` | `str` |  |
| `token` | `str` |  |
| `access` | `str` |  |

## noclick.TableRow

```python
class TableRow
```

One row of a table: its `id`, its position (`index`, from 0 in the
order rows were added) and its `data`, the object as it was written.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |
| `index` | `int` |  |
| `data` | `dict[str, Any]` |  |
| `created_at` | `Any` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.RowsPage

```python
class RowsPage(Page)
```

One page of a table's rows; pass `next_cursor` back as `cursor` for
the next (None = the last page). `total_count` is how many rows the table
holds.

| Attribute | Type | Description |
| --- | --- | --- |
| `total_count` | `int` |  |

## noclick.step_types

```python
noclick.step_types(query=None, *, kind=None, limit=None, client=None) -> list[StepType]
```

Every kind of step a workflow can hold, NoClick's own first, then the
integrations most used first; with `query`, those it finds by name or by
what they do, the best first, as the app's builder searches.
`kind="trigger"` keeps the types a run starts from (a trigger step, or one
with a trigger operation), `kind="tool"` those an agent uses as its tools;
any other raises `noclick.InvalidRequest`. A listing leaves out each
operation's description and the settings schema: `step_type()` reads them.
Needs the `workflows` scope.

Parameters:

- `query` (`str | None`, default `None`)
- `kind` (`str | None`, default `None`)
- `limit` (`int | None`, default `None`): Return at most this many.
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `list[StepType]` Each type's `type` (what `workflow.add_step` takes), `label`, `kinds`, `operations` (each
with whether it's a `trigger` and `needs_account`) and `connection`, fetched page by page
(or the first `limit`).

Usage:

Find the step for a job, and add it:

```python
[send] = noclick.step_types("send an email", limit=1)
brief = noclick.Workflow.from_name("Morning brief")
brief.add_step(send.type, operation=send.operations[0].name)
```

Or every way a run can start:

```python
for kind in noclick.step_types(kind="trigger"):
    starts = [op.name for op in kind.operations if op.trigger] or ["(the step itself)"]
    print(kind.type, starts)
```

## noclick.step_type

```python
noclick.step_type(
    name, *, kind=None, query=None, operation=None, client=None
) -> StepType
```

One step type, each operation with its `description` (its triggers
first), and its `schema`: what a step's `settings` take, as the app's
canvas draws its form from it. `name` is the type as a workflow's graph
names it (`automation-gmail`, `agent`); an unknown one raises
`noclick.NotFound` naming the nearest. A type can be large (Stripe holds
491 operations): `kind` (`"trigger"` or `"action"`), `query` (the
operations its words fit, the best first) and `operation` (one name, or
several) keep only some, and the `schema` only their settings;
`operations_total` still counts them all. An operation the type doesn't
have raises `noclick.InvalidRequest`. Needs the `workflows` scope.

Parameters:

- `name` (`str`, required)
- `kind` (`str | None`, default `None`)
- `query` (`str | None`, default `None`)
- `operation` (`str | list[str] | None`, default `None`)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `StepType` The type, with its `schema` (`None` for a type that takes no settings).

Usage:

Read a type's operations and settings:

```python
gmail = noclick.step_type("automation-gmail")
send = next(op for op in gmail.operations if op.name == "send_email_message")
print(send.description, gmail.connection.credential_types)
print(list(gmail.schema["$defs"]))
```

Or what starts a workflow in a large one, then one operation's settings:

```python
stripe = noclick.step_type("automation-stripe", kind="trigger", query="payment failed")
failed = noclick.step_type("automation-stripe", operation=stripe.operations[0].name)
print(failed.operations_total, list(failed.schema["$defs"]))
```

## noclick.StepType

```python
class StepType
```

A kind of step a workflow can hold: one of `step_types()`.

| Attribute | Type | Description |
| --- | --- | --- |
| `type` | `str` | What `workflow.add_step` takes, as a workflow's graph names it: `automation-slack`, `agent`, `trigger-cron`. |
| `label` | `str | None` | Its name in the app (`Slack`, `AI Agent`, `Schedule`). |
| `description` | `str | None` |  |
| `category` | `str | None` | The section the app lists an integration under (`communication`, `crm-sales`); `None` for NoClick's own. |
| `kinds` | `list[str]` | What a step of it can be in a workflow: `trigger` (a run starts from it: `trigger` below, or one of its operations) and `tool` (an agent uses its operations as tools). |
| `trigger` | `bool` | Whether a step of it starts runs whatever its operation (a trigger step: a schedule, a webhook, a form). |
| `operations` | `list[StepTypeOperation]` | Each operation once, its triggers first, in the order the app lists them; empty for a type that has none (`trigger-run`). A read narrowed by `kind`, `query` or `operation` holds only those it kept. |
| `connection` | `StepTypeConnection | None` | The accounts it connects to; `None` for a type whose settings take none. |
| `retired` | `dict[str, Any] | None` | Why its service is gone and since when (`reason`, `since`), or `None` while it works. A listing leaves retired types out; `step_type()` still reads one, since a step saved on it still loads and runs. |
| `schema` | `dict[str, Any] | None` | The JSON Schema of a step's settings, as the app's canvas draws its form from it (`properties.config`, a member per operation where it has several, with the canvas's `x-` and `ui:` extensions). `None` in a listing, and for a type that takes no settings. |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |
| `operations_total` | `int | None` | How many operations the type has in all, whatever a read kept; `None` in a listing. |

## noclick.check_step_settings

```python
noclick.check_step_settings(name, settings, *, client=None) -> StepSettingsCheck
```

Whether `settings` of the step type `name` would run, as a run judges them (a
form's, saved or not): nothing is read or written. Needs the `workflows` scope.

Parameters:

- `name` (`str`, required)
- `settings` (`dict[str, Any]`, required)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `StepSettingsCheck` The `StepSettingsCheck`.

Usage:

```python
check = noclick.check_step_settings("log", {"message": "Hello"})
if not check.valid:
    print(check.errors)
```

## noclick.StepSettingsCheck

```python
class StepSettingsCheck
```

Whether settings of a step type would run (`check_step_settings`): `valid`, the
`errors` in the way, and the set of settings they meet (`satisfied_set`, `default`;
`None` when none).

| Attribute | Type | Description |
| --- | --- | --- |
| `step_type` | `str` |  |
| `valid` | `bool` |  |
| `errors` | `list[Any]` |  |
| `satisfied_set` | `str | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.RunInputs

```python
class RunInputs
```

What came in to a coding harness's reply (`Workflow.run_inputs`): each delivery it
answered (`inputs`, the newest 15, each `{"run_id", "steps"}` with what its steps
output, never a secret), and `total`, every delivery it answered.

| Attribute | Type | Description |
| --- | --- | --- |
| `inputs` | `list[dict[str, Any]]` |  |
| `total` | `int` |  |

## noclick.WorkflowTemplate

```python
class WorkflowTemplate
```

A workflow's place in NoClick's template library (`Workflow.template`): whether it's
`published`, its `title`, `slug`, `description` and page (`public_url`) when it is,
and the `draft_title` and `draft_description` saved for it before it's published. Its
page opens by its link; nothing lists it.

| Attribute | Type | Description |
| --- | --- | --- |
| `published` | `bool` |  |
| `title` | `str | None` |  |
| `slug` | `str | None` |  |
| `description` | `str | None` |  |
| `public_url` | `str | None` |  |
| `draft_title` | `str | None` |  |
| `draft_description` | `str | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.TemplateVote

```python
class TemplateVote
```

A person's vote on a published template (`template_vote`, `vote_on_template`): theirs
(`vote`: 1, -1 or `None`) and the template's counts.

| Attribute | Type | Description |
| --- | --- | --- |
| `slug` | `str` |  |
| `vote` | `int | None` |  |
| `upvote_count` | `int` |  |
| `downvote_count` | `int` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.template_vote

```python
noclick.template_vote(slug, *, client=None) -> TemplateVote
```

Your vote on the published template at `slug`, and its counts.

Parameters:

- `slug` (`str`, required)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `TemplateVote` Your vote (`None` for none) and the template's up and down counts.

Usage:

```python
print(noclick.template_vote("daily-digest").upvote_count)
```

## noclick.vote_on_template

```python
noclick.vote_on_template(slug, vote, *, client=None) -> TemplateVote
```

Vote on the published template at `slug`: 1 up, -1 down, or `None` to take your vote
back. A person's own: a call acting for one of your users has none.

Parameters:

- `slug` (`str`, required)
- `vote` (`int | None`, required)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `TemplateVote` Your vote as it stands now, and the template's counts with it.

Usage:

```python
noclick.vote_on_template("daily-digest", 1)
```

## noclick.StepTypeOperation

```python
class StepTypeOperation
```

One operation a step of the type runs: what `operation=` takes.

| Attribute | Type | Description |
| --- | --- | --- |
| `name` | `str` |  |
| `label` | `str | None` |  |
| `description` | `str | None` | What it does; `None` in a listing (`step_type()` reads it). |
| `trigger` | `bool` | Whether it starts runs (a trigger operation, `x-is-trigger`) rather than acting when a run reaches it. |
| `needs_account` | `bool` | Whether running it needs an account connected to the step: False when it runs on NoClick's key with no account (web search, public data) or the type takes none; True otherwise, also when the need depends on its settings. |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.StepTypeConnection

```python
class StepTypeConnection
```

The accounts a step of the type connects to (`step.set_connection`).

| Attribute | Type | Description |
| --- | --- | --- |
| `needed` | `bool` | Whether every operation needs one, so a step of it can't run without. |
| `integration` | `str | None` | Its name in `Connection.integrations()` (`integration=` when you make a connection for it), or `None` for a step whose account isn't connected there (an agent's model key). |
| `credential_types` | `list[str]` | The credential types its settings take, as a step's `connections` names them. |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.WorkflowFolder

```python
class WorkflowFolder
```

One of your account's workflow folders, as the app's Automations page shows it:
`Workflow.folders()` lists them, `Workflow.create_folder()` makes one and
`workflow.move_to()` files a workflow in one.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |
| `name` | `str` |  |
| `description` | `str | None` |  |
| `parent_id` | `str | None` | The folder it's in; `None` at the top. |
| `depth` | `int` | How deep it sits: 0 at the top, 10 at most. |
| `workflow_count` | `int` | How many workflows are in it (not counting its folders'). |
| `created_at` | `Any` |  |
| `updated_at` | `Any` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |
| `access` | `str` | `owner` for one your account made; `viewer` for a teammate's in a team workspace, or one shared with you. |
| `owner` | `dict[str, Any] | None` | Who shared it with you (`{"name": ...}`); `None` for your account's own. |
| `shared_at` | `Any` | When it was shared with you; `None` for your account's own. |

## noclick.WorkflowFolderListing

```python
class WorkflowFolderListing
```

A folder's workflows as the app's Automations page lists them (`Workflow.in_folder()`).

| Attribute | Type | Description |
| --- | --- | --- |
| `workflows` | `list[Workflow]` |  |
| `hidden_shared_count` | `int` | Workflows shared with you that your plan has no room for, left out. |
| `plan` | `str | None` | The plan that room is judged by (`free`, `member`, ...); `None` when the API didn't say. |

## noclick.WorkflowConnectionInfo

```python
class WorkflowConnectionInfo
```

An account one of a workflow's steps uses, as the canvas names it (`workflow.connections()`): its name and
type, and who it belongs to. Never a value.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` | The credential's id, as the step holds it. |
| `name` | `str` |  |
| `credential_type` | `str` |  |
| `owned_by_me` | `bool` | Whether it's your own account (else a collaborator's, lent to this workflow, or its owner's). |
| `owner_name` | `str | None` | Who it belongs to when it isn't yours. |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.workflow_examples

```python
noclick.workflow_examples(
    query=None, *, limit=None, client=None
) -> list[WorkflowExample]
```

NoClick's own example workflows, the ones its builder studies before it
builds, most recently changed first; with `query`, the ones it finds by
name, what they're for and their text, the best first. A listing leaves
each one's text and workflow out: `workflow_example()` reads them. Needs
the `workflows` scope.

Parameters:

- `query` (`str | None`, default `None`)
- `limit` (`int | None`, default `None`): Return at most this many.
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `list[WorkflowExample]` Each example's `name`, `description`, whether it has guidance `text` and a workflow, and what that's
made of (`step_types`), fetched page by page (or the first `limit`).

Usage:

Find the examples for a job, and read the best one whole:

```python
[best] = noclick.workflow_examples("post new form answers to Slack", limit=1)
example = noclick.workflow_example(best.id)
print(example.text)
for node in example.graph["nodes"]:
    print(node["type"], node["config"].get("operation"))
```

## noclick.workflow_example

```python
noclick.workflow_example(example_id, *, client=None) -> WorkflowExample
```

One of NoClick's example workflows whole: its guidance `text` and its
workflow's `graph`. An id that names none raises `noclick.NotFound`.
Needs the `workflows` scope.

Parameters:

- `example_id` (`str`, required)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `WorkflowExample` The example, with its `text` and `graph` (each `None` where it has none).

Usage:

```python
example = noclick.workflow_example("6f1c2e9a-3b7d-4f0e-9a51-2d8c4b7e1a03")
print(example.description, example.step_types)
```

## noclick.WorkflowExample

```python
class WorkflowExample
```

One of NoClick's example workflows: one of `workflow_examples()`.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |
| `name` | `str` |  |
| `description` | `str | None` | What it's for, and when it applies. |
| `has_text` | `bool` | Whether it holds guidance text, and a workflow. |
| `has_workflow` | `bool` |  |
| `step_types` | `list[str]` | What its workflow is made of, at a glance, as `Workflow.step_types` says it: its triggers first, then its agents, then the rest. |
| `updated_at` | `Any` |  |
| `text` | `str | None` | Its guidance, in Markdown; `None` in a listing (`workflow_example()` reads it). |
| `graph` | `dict[str, Any] | None` | Its workflow as `workflow.graph()` reads a workflow's (`nodes`, each with its `type` and `config`, and `edges`), without the connections or test outputs of the account it was made in, never a secret; `None` in a listing and for one that's guidance only. |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.step_output_shape

```python
noclick.step_output_shape(name, *, operation=None, client=None) -> StepOutputShape
```

What a step of type `name` outputs (its `operation`'s, for a type with several),
learned from your account's own runs: the fields a later step's settings can reference,
as the app's canvas offers them. Needs the `workflows` scope.

Parameters:

- `name` (`str`, required)
- `operation` (`str | None`, default `None`)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `StepOutputShape` The `StepOutputShape`; an unknown type raises `noclick.NotFound` naming the nearest.

Usage:

```python
found = noclick.step_output_shape("automation-hubspot", operation="get_contact")
print(list((found.shape or {}).get("properties", {})))
```

## noclick.StepOutputShape

```python
class StepOutputShape
```

What a step of a type outputs, as your account's own runs and events of it showed it
(and those of people in a workspace with you), never another account's: `shape`, its
fields' names and types, with `suggested_refs`, the few references worth offering first
(`None` until they're made). `shape` is `None` until your first run or event of it.

| Attribute | Type | Description |
| --- | --- | --- |
| `type` | `str` |  |
| `operation` | `str` |  |
| `shape` | `dict[str, Any] | None` |  |
| `suggested_refs` | `list[Any] | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.WorkflowRunCounts

```python
class WorkflowRunCounts
```

How many runs `Workflow.runs` lists (`Workflow.run_counts`): the `total`,
`by_status` (`running`, `succeeded`, `failed`, each there even at 0), `waiting`
(how many of the running ones wait on an approval, a delay or an agent's turn),
`by_source` (`api`, `endpoint`, `schedule`, `trigger`, `app`: only those with
runs) and `by_trigger` (the kinds of event that started the runs a trigger did:
`webhook`, `email`, …, only those with runs). A run from code counts once, however
many executions it spans.

| Attribute | Type | Description |
| --- | --- | --- |
| `workflow_id` | `str` |  |
| `total` | `int` |  |
| `by_status` | `dict[str, int]` |  |
| `by_source` | `dict[str, int]` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |
| `waiting` | `int` |  |
| `by_trigger` | `dict[str, int]` |  |

## noclick.LatestOutputs

```python
class LatestOutputs
```

Each step's latest output, whatever run it's from (`Workflow.latest_outputs`):
`outputs` by step id, each cut short as a run's steps are unless read `full`
(`truncated` names the steps cut), never a secret (`withheld`: each step's paths left
out). A step that never stored one isn't in `outputs`. `last_runs`: how each step's
latest run ended, as the app's canvas marks it beside the step; a step never run isn't in
it.

| Attribute | Type | Description |
| --- | --- | --- |
| `workflow_id` | `str` |  |
| `outputs` | `dict[str, Any]` |  |
| `withheld` | `dict[str, list[str]]` |  |
| `full` | `bool` |  |
| `truncated` | `list[str]` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |
| `last_runs` | `dict[str, StepLastRun]` |  |

## noclick.StepLastRun

```python
class StepLastRun
```

How a step's latest run ended (`LatestOutputs.last_runs`): its `status`
(`succeeded`, `failed`, `skipped`), when it `finished_at`, its `error`.

| Attribute | Type | Description |
| --- | --- | --- |
| `status` | `str` |  |
| `finished_at` | `Any` |  |
| `error` | `str | None` |  |

## noclick.ExpressionPreview

```python
class ExpressionPreview
```

What an expression gives (`Step.preview_expression`): `ok`, with the value's `kind`
(`object`, `array`, `string`, `number`, `boolean`, `null`), an object's `keys`
and a short `preview`; or `ok` False with the `error`.

| Attribute | Type | Description |
| --- | --- | --- |
| `ok` | `bool` |  |
| `kind` | `str | None` |  |
| `keys` | `list[str] | None` |  |
| `preview` | `str | None` |  |
| `error` | `str | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.ClearedStepState

```python
class ClearedStepState
```

What `Step.clear_state` forgot: how many of its state records and of its
conversations were deleted.

| Attribute | Type | Description |
| --- | --- | --- |
| `step_id` | `str` |  |
| `state_rows_deleted` | `int` |  |
| `conversations_deleted` | `int` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.step_type_options

```python
noclick.step_type_options(
    name, field, *, connection=None, settings=None, workflow_id=None, search=None,
    page_token=None, client=None
) -> StepTypeOptions
```

The choices a step of type `name` lists for `field` (the name its
loader takes, a setting's `x-dynamic-options.field_name`), for no step of
a workflow: a picker outside a step's form. Read through `connection`, an
account you may use (its ref or credential id), with `settings` what the
list depends on; `workflow_id` names the workflow the choices are for. A
step's own dropdown is `Step.options`. Needs the `workflows` scope.

Parameters:

- `name` (`str`, required)
- `field` (`str`, required)
- `connection` (`str | None`, default `None`)
- `settings` (`dict[str, Any] | None`, default `None`)
- `workflow_id` (`str | None`, default `None`)
- `search` (`str | None`, default `None`)
- `page_token` (`str | None`, default `None`)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `StepTypeOptions` The `StepTypeOptions`: one page.

Usage:

```python
page = noclick.step_type_options("automation-slack", "channel", connection="credential:7c1...")
print([o["label"] for o in page.options])
```

## noclick.StepTypeOptions

```python
class StepTypeOptions
```

A page of a step type's choices for one field (`step_type_options`):
each of `options` is `{value, label, metadata}`; pass
`next_page_token` back as `page_token`. `withheld` names, by path, a
choice or a part of one left out because it held a secret.

| Attribute | Type | Description |
| --- | --- | --- |
| `type` | `str` |  |
| `field` | `str` |  |
| `options` | `list[dict[str, Any]]` |  |
| `next_page_token` | `str | None` |  |
| `withheld` | `list[str]` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.WorkflowReadinessCheck

```python
class WorkflowReadinessCheck
```

A workflow's readiness with the evidence it's judged on
(`Workflow.check_readiness`): its `status`, what that `meaning` is,
the `issues` in the way, `warnings` and `unverified` steps (each
`{step, code, message}`), then each trigger's latest real input
(`observations`: `step`, `at`, `trigger`, `run_status`), the
triggers registered where their events come from (`registered_steps`),
each missing-update check's deadline (`deadline_watches`) with the alarm
steps that keep them (`alarm_steps`), and the recipients an agent's tools
are held to (`destinations`). An input observed is history: it doesn't
show the next one will arrive.

| Attribute | Type | Description |
| --- | --- | --- |
| `status` | `str` |  |
| `meaning` | `str` |  |
| `issues` | `list[dict[str, Any]]` |  |
| `warnings` | `list[dict[str, Any]]` |  |
| `unverified` | `list[dict[str, Any]]` |  |
| `observations` | `list[dict[str, Any]]` |  |
| `registered_steps` | `list[str]` |  |
| `deadline_watches` | `list[dict[str, Any]]` |  |
| `alarm_steps` | `list[str]` |  |
| `destinations` | `list[dict[str, Any]]` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.StepConversation

```python
class StepConversation
```

One of your chats with an agent step, as `Step.conversations` lists them: its
`conversation` key (what reads it, and what `Step.message` names), `title`,
`preview`, `turns`, when it was last active, the model it last ran on, and whether a
share link's visitor had it (`shared`). `messages` is set on one read with
`Step.conversation`: the thread as the app's chat stores and draws it, oldest first.

| Attribute | Type | Description |
| --- | --- | --- |
| `conversation` | `str` |  |
| `title` | `str` |  |
| `preview` | `str` |  |
| `turns` | `int` |  |
| `last_activity` | `str | None` |  |
| `agent_model` | `str | None` |  |
| `shared` | `bool` |  |
| `messages` | `list[dict[str, Any]] | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.StepWorkspace

```python
class StepWorkspace
```

The files on one of an agent step's conversations' workspace (`Step.workspace`),
as the app's chat shows them: `files`, each with a download link good for an hour;
`workspace`, where its sandbox mounts it (`None` for a conversation that has none);
whether it `exists` yet; and for whoever may change the workflow `upload_url`, a link
that takes files into it (POST a file's bytes to it with `&path=<name>`).

| Attribute | Type | Description |
| --- | --- | --- |
| `files` | `list[WorkspaceFile]` |  |
| `workspace` | `str | None` |  |
| `exists` | `bool` |  |
| `truncated` | `bool` |  |
| `upload_url` | `str | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.BuildQuestion

```python
class BuildQuestion
```

What a build waits on. Each of `inputs` is `{id, label, type, description, options?, request_id?}`: `request_id` is the human request
that asks it, which NoClick sent the person whose build it is (`sent_to`)
and any client answers (its page, a chat's card, their texts,
`POST /v1/humans/requests/{id}/answer`); the build goes on once each is
answered. Or answer them all at once with
`build.answer({id: value})`, which goes on now: an input of type
`credential` takes a connection's ref or name, one of type `env` its
values in `secret_values` (both with a key acting for the whole
account). `answer_url` is a page anyone holding it answers on.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str | None` |  |
| `title` | `str | None` |  |
| `inputs` | `list[dict[str, Any]]` |  |
| `answer_url` | `str | None` |  |
| `answerable_from_code` | `bool` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |
| `sent_to` | `list[str]` |  |

## noclick.SavedOutput

```python
class SavedOutput
```

An output saved under a name, kept by step type: read beside every step of that type on any workflow your
account opens, your account's own first (`mine`), then those made public or shared with it. Reading them takes
what opening the workflow takes; saving, renaming and deleting take what changing it takes, and renaming or
deleting one also takes being its owner or holding a share that may edit it. A key held to one of your users
raises `noclick.PermissionDenied`.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |
| `workflow_id` | `str` |  |
| `name` | `str` |  |
| `step_type` | `str` |  |
| `output` | `dict[str, Any]` |  |
| `visibility` | `str` |  |
| `owner_id` | `str | None` |  |
| `mine` | `bool` |  |
| `created_at` | `datetime | None` |  |
| `updated_at` | `datetime | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

### SavedOutput.list

```python
noclick.SavedOutput.list(workflow_id, step_type, *, client=None) -> list[SavedOutput]
```

The outputs saved for steps of `step_type`, read on the workflow `workflow_id`: your account's own
first, newest first, then those made public or shared with it.

Parameters:

- `workflow_id` (`str`, required)
- `step_type` (`str`, required)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `list[SavedOutput]` Each saved output, whole.

Usage:

```python
for saved in noclick.SavedOutput.list(workflow_id, "automation-shopify"):
    print(saved.name)
```

### SavedOutput.create

```python
noclick.SavedOutput.create(
    workflow_id, *, step_type, name, output, visibility=None, client=None
) -> SavedOutput
```

Save an output of a step of the workflow `workflow_id` under a name (`visibility` `user`, the
default, or `public`). Raises `noclick.PlanRequired` once the step type keeps as many as your plan
allows.

Parameters:

- `workflow_id` (`str`, required)
- `step_type` (`str`, required)
- `name` (`str`, required)
- `output` (`dict[str, Any]`, required)
- `visibility` (`str | None`, default `None`)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `SavedOutput` The saved output.

Usage:

```python
noclick.SavedOutput.create(workflow_id, step_type="automation-shopify", name="A paid order", output=out)
```

### SavedOutput.update

```python
saved_output.update(*, name=None, visibility=None, client=None) -> SavedOutput
```

Rename it, or make it `public` or your account's own (`user`) again.

Parameters:

- `name` (`str | None`, default `None`)
- `visibility` (`str | None`, default `None`)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `SavedOutput` It, as it stands after the change.

Usage:

```python
saved.update(visibility="public")
```

### SavedOutput.delete

```python
saved_output.delete(*, client=None) -> None
```

Delete it, with its shares.

Parameters:

- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Usage:

```python
saved.delete()
```

## noclick.HostedMcpStatus

```python
class HostedMcpStatus
```

How an MCP step's hosted link stands (`Step.hosted_mcp`). `liveness_available` False
means the client's side couldn't be read just now: unknown, never "no client".
`tools_ready` is None unless asked for (`tools`) or when the graph wouldn't resolve.

| Attribute | Type | Description |
| --- | --- | --- |
| `exists` | `bool` |  |
| `active` | `bool` |  |
| `liveness_available` | `bool` |  |
| `client_name` | `str | None` |  |
| `last_method` | `str | None` |  |
| `tool_count` | `int | None` |  |
| `first_tools_at` | `float | None` |  |
| `seconds_since_seen` | `float | None` |  |
| `tools_ready` | `int | None` |  |
| `tools_sample` | `list[str]` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |
