# Run many calls: cady local batch

`cady local batch` runs a file of calls, one per line, and stops after the first one that fails.

The CLI is not released yet; see [Install the CLI](https://cadyworks.com/docs/install.md).

Each line of the file is one call:

```text
{"tool": "cady_read", "arguments": {"refs": ["company:setup"]}}
{"tool": "work_read", "arguments": {}}
```

```sh
cady --company COMPANY_UUID local batch --input calls.jsonl
```

It prints one JSON line per call, with its position and a status:

```text
{"index": 0, "status": "success", "result": {...}}
{"index": 1, "status": "refused", "result": {...}}
```

The statuses are `success`, `refused`, `uncertain` and `not_attempted`. Every line is validated before the first call is sent.

## Limits

- At most 1,000 calls and 2 MiB per file.
- `--concurrency` sets how many run at once, from 1 to 8. The default is 1.
- There is no transaction across calls, no automatic approval and no automatic retry.

## What can go wrong

- A call was refused, so later calls were not attempted. Fix the cause and run the remaining lines.
- A call is `uncertain`. Read the record it would have changed before running it again.
- A line is invalid, or two lines name different companies. Nothing was sent.
- The exit code tells these apart: see [Troubleshooting and help](https://cadyworks.com/docs/troubleshooting.md).

Next: [Report usage: cady sync](https://cadyworks.com/docs/sync.md)
