> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anyformat.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Input

> Starts a workflow from values you send instead of a document, and hands them to a Report generator.

> [!WARNING]
>
> **Alpha.** The Input node is enabled per organization. Without it, the API rejects a workflow that holds one with `400` and names the node. Ask us to turn it on.

**Input** is the first node of a workflow that reads no document. You declare the fields the workflow needs, and each run sends their values. No file is parsed and no model runs: the values you send are the values the workflow uses.

Use it when you already hold the data and want a document written from it, with a [Report generator](https://docs.anyformat.ai/guides/nodes/report-generator.md) that fills a Word template.

## The node

```json API theme={null}
{
  "name": "Safety plan",
  "nodes": [
    {
      "id": "input_1",
      "type": "input",
      "extraction_schema": {
        "fields": [
          { "name": "site_name", "data_type": "string", "description": "The site the plan covers." },
          { "name": "start_date", "data_type": "date", "description": "First day of work." },
          {
            "name": "crew",
            "data_type": "object",
            "description": "One row per trade on site.",
            "nested_fields": [
              { "name": "trade", "data_type": "string", "description": "The trade." },
              { "name": "head_count", "data_type": "integer", "description": "People of that trade." }
            ]
          }
        ]
      }
    },
    { "id": "report_1", "type": "report_generator", "template_file_id": "069dcc2c-e14c-7606-8000-2ee4fb17b4e2" }
  ],
  "edges": [{ "source": "input_1", "target": "report_1" }]
}
```

```python Python theme={null}
import os

from anyformat.sdk import Client
from anyformat.workflow import Schema

client = Client(api_key=os.environ["ANYFORMAT_API_KEY"])
fields = [
    Schema.string("site_name", "The site the plan covers."),
    Schema.date("start_date", "First day of work."),
]

# A template belongs to one workflow: create the workflow, upload to it, then add the report.
workflow = client.workflow("Safety plan").input(fields).create()
template = client.upload_report_template(workflow.id, "safety-plan.docx")
workflow = (
    client.workflow("Safety plan")
    .input(fields)
    .report_generator(template_file_id=template.id)
    .update(workflow.id)
)
```

```typescript TypeScript theme={null}
import { Anyformat, Schema } from "@anyformat/sdk";

const af = new Anyformat({ apiKey: process.env.ANYFORMAT_API_KEY! });
const fields = [
  Schema.string("site_name", "The site the plan covers."),
  Schema.date("start_date", "First day of work."),
];

// A template belongs to one workflow: create the workflow, upload to it, then add the report.
const created = await af.workflow("Safety plan").input(fields).create();
const template = await af.uploadReportTemplate(created.id, new File([bytes], "safety-plan.docx"));
const workflow = await af
  .workflow("Safety plan")
  .input(fields)
  .reportGenerator("", "", { templateFileId: template.id })
  .update(created.id);
```

`template_file_id` is the id of a template uploaded to this same workflow. A template uploaded to another workflow is not found when the run starts.

## Options

| Field | Type | Default | What it does |
| - | - | - | - |
| `extraction_schema` | object | required | The fields a run supplies, in the same format an Extract node uses. Every field is supplied by the caller, so a field with a lookup source is refused. |

The schema the API accepts is generated from the same source: [Input node schema](https://docs.anyformat.ai/api-reference-v3/node-schemas.md#input).

## Run it

Start a run with [`POST /v3/workflows/{workflow_id}/run/`](https://docs.anyformat.ai/api-reference-v3/workflows/run) and the values in `metadata`. No file is sent.

```bash curl theme={null}
curl -X POST 'https://api.anyformat.ai/v3/workflows/0686bb97-8c30-70f0-8000-97669e000eb8/run/' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"metadata": {"site_name": "Mataro Parc", "start_date": "2026-07-28", "crew": [{"trade": "Electrician", "head_count": 3}]}}'
```

```python Python theme={null}
run = client.run_workflow(
    workflow.id,
    {"site_name": "Mataro Parc", "start_date": "2026-07-28", "crew": [{"trade": "Electrician", "head_count": 3}]},
)
result = run.wait()
```

```typescript TypeScript theme={null}
const run = await af.runWorkflow(workflow.id, {
  site_name: "Mataro Parc",
  start_date: "2026-07-28",
  crew: [{ trade: "Electrician", head_count: 3 }],
});
const result = await run.wait();
```

Each field takes the value under its result key, the field name in lower snake case. Nothing is converted: a value has to be what its field takes.

| Field type | Send |
| - | - |
| `string` | a string |
| `integer` | a whole number |
| `float` | a number |
| `boolean` | `true` or `false` |
| `date` | a string written `YYYY-MM-DD` |
| `datetime` | a string in ISO 8601 |
| `enum` | one of the field's option names |
| `multi_select` | a list of the field's option names |
| `object` (a table) | a list of objects, one per row, keyed by each column's result key |

A field you leave out, or send as `null`, is empty; a table you leave out has no rows. A key no field declares is ignored.

A value that is not what its field takes refuses the run with `422` and `error_code: "INPUT_VALUES_REFUSED"`, before anything runs. `params.keys` names each key and `params.expected`, at the same position, says what it takes:

```json theme={null}
{
  "error_code": "INPUT_VALUES_REFUSED",
  "error": "The values sent do not match the workflow's input fields.",
  "params": { "keys": ["start_date", "crew[0].head_count"], "expected": ["a date written as YYYY-MM-DD", "a whole number"] }
}
```

You can also send the values as the `metadata` of [Upload and run](https://docs.anyformat.ai/api-reference-v3/workflows/upload-and-run.md) together with a file; the same check applies.

## Connects to

[Input](https://docs.anyformat.ai/guides/nodes/input.md)

[Report generator](https://docs.anyformat.ai/guides/nodes/report-generator.md)

Input is the first node, in place of Parse. Only a Report generator may follow it.

A workflow starts at one Parse node or at one Input node, never both. Nothing feeds an Input.

## What it returns

The values appear in the [run results](https://docs.anyformat.ai/concepts/runs-and-results.md) like the fields of an Extract node, under the Input node's id. Each value has no confidence, because nothing was read: `confidence` is `null`, and its evidence cites the `metadata` key it came from.

The run's document packet holds one file, `input-<id>.json`, with the values as you sent them, so the packet reads like any other. The values are also the packet's `metadata`.

Pricing for runs that start at an Input node is not final while the feature is in alpha.


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