Skip to content

feat: batch-processing skill (ETL staging + jobs via inference-cli and MCP tools) - #36

Merged
japrescott merged 12 commits into
mainfrom
batch-processing-skill
Sep 1, 2026
Merged

feat: batch-processing skill (ETL staging + jobs via inference-cli and MCP tools)#36
japrescott merged 12 commits into
mainfrom
batch-processing-skill

Conversation

@japrescott

@japrescott japrescott commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Adds the batch-processing skill, served by the MCP server at roboflow://skills/batch-processing/SKILL and shipped with the Roboflow plugin, and adds routing pointers to the cloud-storage and inference skills.

What it covers

  • The teaching model: every batch processing job runs over a Data Staging batch; the two input paths differ only in who fills it. The platform stages Asset Library selections for you; you stage external files yourself with the inference-cli. A three-question decision tree routes between Asset Library jobs, staged jobs, and datasource (bucket mirror) imports, with ETL/ELT demoted to parentheticals. cloud-storage points back here and notes the composition: mirrored images become Asset Library images and can be batch-processed as Asset Library jobs.
  • Prerequisites: the batch-processing feature gate (402 with an upgrade/contact-sales message), credits, an existing Workflow, and safe API key handling.
  • Which steps run where, and why: staging and result export can only happen in the inference-cli, because the MCP server can neither read nor write the user's disk. Everything between needs only an API key, so the skill gives the CLI commands and the MCP equivalents side by side and says when to reach for which.
  • The full CLI lifecycle for images and videos: install (including the cloud-storage extra), staging from local disk, cloud buckets (S3/GCS/Azure with the credential env vars per provider; S3/GCS get 24h presigned URLs while Azure rides the SAS token) or references files, ingest inspection, process-images-with-workflow / process-videos-with-workflow with their flags, show-job-details / fetch-logs / abort-job / restart-job, and export-batch.
  • Practical limits verified against the CLI and platform source: image references chunk at 20,000 per ingest request, video references cap at 5,000 and are not chunked, ~1,000 videos per batch suggested.
  • The MCP tool surface: the batch_processing_run master tool, which is single-shot and returns retryAfterSeconds for the host to poll on rather than waiting server-side, plus the staging reads, jobs_list (entries labeled with inputSource: asset-library or staged-batch), and the job lifecycle tools. The staged_job_start example is valid as written (video-only knobs are called out separately, since the tool rejects max_video_fps on image jobs).
  • Webhooks: bring-your-own via notifications_url / --notifications-url, including the two ingests that drop the flag (local video staging, and simple local image batches of 32 files or fewer). The POST carries an Authorization header with the publishable key.
  • Results: the <job-id>-export staging batch is multipart; the files-list tool auto-selects the part when there is exactly one and otherwise takes part_name (parts come from batch_processing_staging_batch_get). Also covers the resumable export-batch download, signed download URLs for shell-less hosts, the 10k files-list cap, and the 7-day staging TTL.

Images vs videos is presented as an authoring choice rather than something inferred from a path, since create-batch-of-images and create-batch-of-videos both accept every data source.

Companion change

The MCP server side (tools, instructions line for this skill) lands in roboflow/roboflow-mcp#129 for INC-318. That PR bumps its submodule pointer at this branch so the skill resource resolves during review; it should be re-pointed at the merged commit once this PR lands. Merge this PR first.

Copilot AI review requested due to automatic review settings July 29, 2026 12:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new batch-processing skill page documenting how to run large-scale Workflow inference without importing data into a workspace, including client-side staging via inference-cli and server-side orchestration via MCP batch-processing tools.

Changes:

  • Introduces skills/batch-processing/SKILL.md with guidance on choosing batch processing (ETL) vs datasource bucket mirroring (ELT).
  • Documents end-to-end flow: CLI install + staging (local/cloud/references), job start/monitor, webhook events, and exporting/downloading results.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread skills/batch-processing/SKILL.md
The skill described a webhook relay hosted by the MCP server and a
batch_processing_run that waited server-side for up to 55 seconds. Both
are gone, so the skill was describing behavior that no longer exists.

Webhooks are now bring-your-own: pass notifications_url to
batch_processing_job_start or --notifications-url on the CLI, pointing at
a receiver you control. Local video staging is the one ingest that does
not accept the flag, which is now called out.

batch_processing_run is single-shot. It reads state, advances what it
can, and returns retryAfterSeconds; the MCP host does the waiting.

Staging and result export are the two steps that can only run in the
CLI, because the server can neither read nor write the user's disk.
Everything between needs only an API key, so the skill now gives the
commands for the whole run (stage, inspect, process, monitor, export)
for images and videos alike, alongside the MCP equivalents, and says
when to reach for which.

Cloud storage and references files carry videos as well as images, so
the choice of create-batch-of-images vs create-batch-of-videos is the
author's to make rather than something inferred from a file extension.
@japrescott

Copy link
Copy Markdown
Contributor Author

/jarbas review this pull request for the improvement of humanity

@japrescott

Copy link
Copy Markdown
Contributor Author

/jarbas review, noting this is a docs-only change

Review fixes from the companion MCP PR's source-verified review:

- The job_start example mixed content_type="images" with max_video_fps,
  which the tool rejects; the video-only knobs moved to a note.
- Job exports are multipart batches: the files-list recipe now explains the
  automatic sole-part selection and when part_name is needed.
- CLI facts sharpened: the 20k reference chunking is images-only (videos cap
  at 5k, unchunked), Azure URLs ride the SAS token rather than a 24h
  presign, AWS_REGION applies alongside AWS_ENDPOINT_URL, and small local
  image batches (32 or fewer) also ignore --notifications-url.
- Added batch_processing_jobs_list and _staging_batches_list to the tool
  map, plus a note that credits are checked before the idempotent-retry
  comparison.
- cloud-storage skill now routes ETL-shaped asks (process without
  importing) to the batch-processing skill.
The CLI reads ROBOFLOW_API_KEY from the environment and every command
accepts --api-key=<key>. A key stored by roboflow login
(~/.config/roboflow/config.json) is not picked up by the inference-cli,
which trips people who assume the login session carries over, so say it
explicitly where the commands are introduced.
@japrescott

Copy link
Copy Markdown
Contributor Author

/jarbas review

Two cheap probes before any credits are spent: time a single-image
workflows_run (second call, past the cold start; over ~1s of model time
means CPU workers will crawl), and count the Workflow's model steps via
workflows_get (several chained models or large foundation models mean
gpu). Also notes the video-FPS multiplier and the workers_per_machine
throughput/OOM trade-off.
@Mike-Medvedev
Mike-Medvedev self-requested a review August 31, 2026 15:35

@Mike-Medvedev Mike-Medvedev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three docs issues. Accuracy vs MCP #129 is otherwise fine (no relay, retryAfterSeconds, CLI-only stage/export).

Also: skills/inference/SKILL.md still has its own Batch Processing section and does not point here. Agents that load roboflow-inference for "batch" will skip this skill. Add a one-line deferral to roboflow-batch-processing.

Comment thread skills/batch-processing/SKILL.md Outdated
Comment thread skills/batch-processing/SKILL.md Outdated
Comment on lines +292 to +294
(`.tar` / `.tar.gz`) must be unpacked after download, and listings are capped
at 10,000 entries per call — past that scale use `export-batch`, or import the
source data into the workspace with datasources (ELT) and work inside Roboflow.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Past the 10k files-list cap, the fallback should stay export-batch / pagination / part_name.

Importing source data with datasources (ELT) does not download job results. That path is for labeling/training, which this skill is explicitly not. Agents will abandon ETL and start connect_cloud_storage when they only needed more result files.

stellasphere and others added 3 commits August 31, 2026 14:29
- Spell out the full batch_processing_job_* tool names in the first
  inventory an agent sees; the abbreviated _job_start forms are not real
  MCP tool names.
- Past the 10k files-list cap, keep the fallback inside ETL: paginate
  with nextPageToken and per-part part_name listings, or use the
  resumable export-batch. Importing source data with datasources never
  downloads job results, so that suggestion is gone.
- The inference skill's Batch Processing section now defers to the
  roboflow-batch-processing skill for the full recipe.
@japrescott

Copy link
Copy Markdown
Contributor Author

Addressed all three of Mike's docs issues in 9d8d453:

  1. The tool inventory spells out the full batch_processing_job_* names instead of the abbreviated forms.
  2. The past-10k-files fallback stays inside ETL (nextPageToken pagination, per-part part_name listings, resumable export-batch); the datasources/ELT suggestion is removed since importing source data never downloads job results.
  3. skills/inference/SKILL.md's Batch Processing section now defers to the roboflow-batch-processing skill in its first line, so agents that load roboflow-inference for batch work get routed here.

Every job processes a Data Staging batch; the two input paths differ only
in who fills it. The platform stages Asset Library selections for you;
you stage external files yourself with the inference-cli. The intro now
teaches that fold with a three-question decision tree, replacing the two
competing sections (input-path choice and ETL vs ELT). ETL/ELT survive
only as parentheticals on the external-file branches, and the old fork
becomes a composition: mirror with a datasource (bucket mirror), then run
an Asset Library job over the imported images.

Also renames the staged creator to batch_processing_staged_job_start to
match the MCP side, documents the inputSource label on job listings, and
aligns the cloud-storage and inference skills with the same framing.
@japrescott

Copy link
Copy Markdown
Contributor Author

Heads-up after the approval: 638da31 restructures the intro to resolve the Asset Library vs ETL/ELT tension. New teaching model: every batch processing job runs over a Data Staging batch, and the two input paths differ only in who fills it (the platform stages Asset Library selections; you stage external files with the inference-cli). The two competing top sections merged into one three-question decision tree, ETL/ELT are now parentheticals, and the datasource-vs-batch-processing fork became a composition (mirror, then Asset Library job). Matches the tool rename in roboflow/roboflow-mcp#129 (batch_processing_staged_job_start) and the new inputSource label on job listings.

One line so pipeline-minded readers map instantly: a staged job is the T
of an ETL flow, an Asset Library job is the T of an ELT flow whose load
already happened via uploads or a datasource mirror.
@japrescott
japrescott merged commit 90c7f59 into main Sep 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants