A workflow you can run

Documents in.
Usable results out.

Read invoice PDFs, distinguish credit notes from delivery notes, and check whether the figures add up. Run an agent for each document, in parallel on your own machine.

Use agents where the documents need judgment.

If every input has the same machine-readable format and fixed extraction rules, use a script. Agents earn their place when layouts, languages or document types vary and the work needs inspection and decisions. Keep exact arithmetic in code: the agent can write and run it.

The released invoice example contains 7 synthetic PDFs, instructions and an output schema. It asks each agent to classify the document, read its facts, check the arithmetic with code and explain discrepancies. The instructions and schema stay in the example folder, so you can run the maintained workflow rather than recreate it from this page.

Copy the example and connect your stack.

Use a new working directory with Git and Node available. Copy the example outside the source checkout, whose contributor package-manager policy prevents running npx there.

git clone --depth 1 --branch v0.7.1 \
  https://github.com/elflodge/elflodge elflodge-example-src
cp -R elflodge-example-src/examples/invoices invoice-pilot
cd invoice-pilot

Connect to an existing authenticated hub, or follow the Docker and Node quickstart. The standard Docker Runner includes pdftotext and pdftoppm to extract text and render PDF pages. Scanned pages need an image-capable model or an OCR step; verify tools on custom Runners. Model calls may incur provider charges.

Give each document its own job.

The file glob creates one job per PDF. Each job runs an agent in its own sandbox. For a task that needs several related files, pass a directory per job instead.

npx elflodge batches submit \
  --id invoices-pilot-v1 \
  --each inputs/*.pdf \
  --instructions "$(cat instructions.txt)" \
  --output-schema schema.json \
  --wait \
  --wait-timeout 30m \
  --output-dir ./pilot-results-v1

The first five jobs form a Canary before the rest run. That catches execution failures; it does not establish factual quality. Review this pilot before sending your own collection.

Check the decisions, not just the JSON.

Successful records go into pilot-results-v1/output.jsonl, each with customId, status and output. Other outcomes go into error.jsonl; a file is omitted when it has no records. Match results to their inputs/ paths.

Some checks to make against the source documents
InputWhat to check
inputs/morgenfeld-druck-R-88731.pdfThe stated total is €10 too high. Keep the stated figures, flag the arithmetic mismatch and explain it.
inputs/harbor-pine-DN-2026-0398.pdfRecognize a delivery note, classify it as other and leave amounts null.
inputs/bluefin-logistics-CN-2026-031.pdfRecognize a credit note and return negative amounts as instructed.

Inspect every result, not just these cases. Shape validation cannot tell whether a document was understood correctly.

The project's recorded run on November 7, 2026 reports all 7 invoice jobs succeeded with deepseek/deepseek-v4.1-flash-1017 through OpenRouter: 0.3¢ in model charges and 20 seconds from the first job starting to the last ending. Those are results from that run, not a performance or quality guarantee. Your model, documents and host can change the outcome.

Move from the pilot to your collection.

Try representative real documents, including awkward cases. Adjust the instructions and schema to your task and inspect the answers before trusting the agent with the full collection. Use a new Batch ID when changing instructions, schema or inputs, and a fresh results directory.

The default Runner concurrency is 8; raise it to match the host and provider capacity you have measured. A large input collection does not require every job to run at once.

If submission is interrupted, repeat the unchanged command with the same Batch ID to fill in missing jobs. A wait timeout or Ctrl-C leaves jobs running. To collect again, repeat the original command with --wait and a fresh --output-dir; preserve partial result files.

When too many jobs fail, the Batch pauses. Inspect the reasons and follow the CLI’s resume guidance after fixing the cause. The workflow returns JSON results, not agent-generated files.