# input.file

Declares and checks one field of the trigger envelope: one FileRef at $trigger.files.<name>

# input.file

```
input.file --name VALUE [--label VALUE] [--optional] [--accept VALUE…]
```

Declares and checks one field of the trigger envelope: one FileRef at `$trigger.files.<name>`. Required by default — a missing or invalid value refuses the run with `FW_NODE_INPUT_MISSING` / `FW_NODE_INPUT_INVALID`, naming the field and what was expected; `--optional` allows absence (the answer is then null). Answers one key, its `--name`: the next node reads `input.<name>`, any later one `$nodes.<id>.<name>`, and the rest of the payload is kept. The input nodes after a trigger are its declaration: the Studio builds the Run form from them and an agent reads them to know what to send. Works after [`trigger.manual`](/nodes/trigger/trigger.manual.md) and after [`trigger.webhook`](/nodes/trigger/trigger.webhook.md). Fetches nothing, stores nothing.

## Flags

- `--name` (required): The envelope field this node declares, and the key it answers — also the first bare token: `file <name>`.
- `--label`: Form label shown in the Run form. Default: the field name.
- `--optional`: A missing value is allowed; the node's value is then null.
- `--accept`: FileRef kinds, mimes or extensions the file must match, one per flag, repeated (`--accept csv --accept xlsx`, `image/png`, `image/`).

## Examples

### A spreadsheet or CSV

```
| input.file sheet --accept csv --accept xlsx
```

`--accept` takes FileRef kinds, mimes (`image/png`, `image/`) or extensions.

Input:

```json
{
  "webhook": {
    "body": {},
    "files": {
      "sheet": {
        "__zf_type": "file_ref",
        "filename": "q3.xlsx",
        "mime": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
        "kind": "spreadsheet",
        "size": 18211
      }
    }
  }
}
```

It answers:

```json
{
  "webhook": {
    "body": {},
    "files": {
      "sheet": {
        "__zf_type": "file_ref",
        "filename": "q3.xlsx",
        "mime": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
        "kind": "spreadsheet",
        "size": 18211
      }
    }
  },
  "sheet": {
    "__zf_type": "file_ref",
    "filename": "q3.xlsx",
    "mime": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
    "kind": "spreadsheet",
    "size": 18211
  }
}
```
