FileFormat
string
Tools
Batch Run
Run any other tool over many records, from a list, a SQL query, a table or an uploaded CSV, and collect the results in a file or a table.
Run one tool over many records at once. This is the only way to fan a tool out: every other tool takes exactly one item. Sources: `rows` (records in the call itself), `sql` (a BigQuery query), `table` (a whole catalog table), `file` (a CSV/TSV uploaded at https://app.botify.com/:organization/:project/o/storage/tmp, or the output of a previous batch). Small sources run immediately and return their results. Larger ones run as a background job: you get a job_id to poll with batch_status, and the records never enter this conversation. The output is a temporary JSONL file whose URL is directly usable as the `file` source of a next batch, which is how several tools are chained. Each line is {row, item, response, error} -- the original row and mapped item are both kept, so results stay attributable and source columns survive chaining. Use tool_documentation on the target tool first: item_map has to match its item schema. Use dry_run to check a mapping against real records before paying for the whole source.
Playground
Your organization, project and token stay in this browser's local storage and are sent straight to the API — this page never sees them.
Billing
These usage SKUs can be charged on a call.
| SKU | Credits | Description |
|---|---|---|
| Tool call | 1 per request | Charged once per successful item. |
Schemas
item is what you send, config how the tool behaves,
and the response is what you get back.
Item
objecttool
string
required
Id of the tool to run over every record. Use tool_documentation to read its item schema before writing item_map.
source
SourceSpec
required
Where the records come from.
item_map
object | null
Projection from a source record onto the tool's item, using {{row.<column>}} (ex: {"url": "{{row.page_url}}"}). Omit it when the records already have the tool's item shape.
sink
SinkSpec
Where results go. Defaults to a temporary gzipped JSONL file whose URL can be passed straight back as a file source.
tool_config
object | null
The target tool's own config, shared by every record.
dry_run
boolean
Run only the first 5 records and return them in full, launching nothing. Use it to check a mapping or a prompt against a large source in one turn.
{
"tool": "string",
"source": {
"type": "rows",
"rows": [
{}
]
},
"item_map": null,
"sink": null,
"tool_config": null,
"dry_run": false
}
Type Definitions
9 typesThese are the available sub-object types that can be used in the properties above.
FileSink
object
A temporary JSONL file in project storage, readable back as a source.
type
string
gzip
boolean
Compress the output.
FileSource
object
Rows from an uploaded CSV/TSV, or from a previous batch's JSONL output.
type
string
url
string
required
File URL. Upload a local file at https://app.botify.com/:organization/:project/o/storage/tmp and pass the returned URL, or reuse the sink URL of a previous batch. Public HTTP(S) URLs are accepted too. CSV, TSV and JSONL, gzip allowed.
format
FileFormat
File format, or auto-detect.
RowsSource
object
Records passed directly in the call.
type
string
rows
array
required
The records to process, one object per call.
SinkSpec
SourceSpec
SqlSource
object
Rows from a BigQuery query over the project's catalog.
type
string
query
string
required
BigQuery Standard SQL over catalog tables. Prefix every table with "catalog." (ex: catalog.crawl_pages_20251201). Same access as tables_query.
limit
integer | null
Stop after this many rows.
TableSink
object
A table in the project's editable catalog.
type
string
table
string
required
Destination table in the catalog.
row_map
object | null
Column projection, using {{item.<field>}}, {{response.<field>}}, {{error}} and {{row.<column>}}. Defaults to `row`, `item`, `response` and `error` columns.
replace_existing
boolean
Replace the table instead of appending to it.
TableSource
object
Every row of one catalog table.
type
string
table
string
required
Table name, with or without the "catalog." prefix.
limit
integer | null
Stop after this many rows.
Configuration
objecton_error
OnError
skip: record the failure and carry on. fail_job: stop the whole batch on the first failing record.
chunk_size
integer
Records sent to the tool at once.
inline_max_rows
integer
Above this many records, the batch runs as a job.
{
"on_error": "skip",
"chunk_size": 50,
"inline_max_rows": 10
}
Type Definitions
1 typeThese are the available sub-object types that can be used in the properties above.
OnError
string
Response
objectWhat a batch returns, whichever path it took.
mode
string
required
dry_run and inline carry their results; job carries a job_id to poll with batch_status.
tool
string
required
The tool that was run.
results
array | null
One {item, response, error} object per record.
job_id
string | null
Poll it with batch_status.
execution_id
string | null
Underlying Cloud Run execution.
rows_total
integer | null
Records the batch will process.
rows_ok
integer | null
Records that succeeded.
rows_error
integer | null
Records that failed.
estimated_credits
integer | null
Credits the batch is expected to cost.
sink
SinkPointer
Where the output landed.
message
string | null
One line about the outcome.
{
"mode": "dry_run",
"tool": "string",
"results": null,
"job_id": null,
"execution_id": null,
"rows_total": null,
"rows_ok": null,
"rows_error": null,
"estimated_credits": null,
"sink": null,
"message": null
}
Type Definitions
1 typeThese are the available sub-object types that can be used in the properties above.
SinkPointer
object
Where a batch's output landed.
type
string
required
url
string | null
Sink file URL, reusable as the source of a next batch.
table
string | null
Destination table.
rows_written
integer
Records written.
Endpoints
http://agents.botify.com/{organization}/{project}/batch_run/process
http://agents.botify.com/{organization}/{project}/batch_run/batch_process
http://agents.botify.com/{organization}/{project}/batch_run/async_process
http://agents.botify.com/{organization}/{project}/batch_run/async_batch_process
See running a long job in the background for the polling flow.
cURL
curl -X POST "http://agents.botify.com/{organization}/{project}/batch_run/process" \
-H "Authorization: Bearer $BOTIFY_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"item": {
"tool": "<tool>",
"source": "<source>"
}
}'
Over MCP
This tool is exposed as the MCP tool batch_run. An MCP client passes
organization, project and item as tool arguments.
Set up MCP →
Raw metadata
- GET /agents/batch_run — this page as JSON.
- /agents/batch_run/skill.md — Markdown for coding agents.