Batch Request Combinator


Experimental circuit-controlled batching for robot-fed loading stations. Helps prevent leftover items in requester chests and inserters between loads.

Content
4 hours ago
2.1
3
Logistics Trains Logistic network Circuit network
Owner:
Nova.kin
Source:
N/A
Homepage:
N/A
License:
MIT
Created:
4 hours ago
Latest Version:
0.1.0 (4 hours ago)
Factorio version:
2.1
Downloaded by:
3 users

🚂 Batch Request Combinator

Experimental: This mod is still being tested and refined. Back up important saves and try it in a safe setup before relying on it in an important factory.

I made Batch Request Combinator to solve a problem I encountered with robot-fed loading stations: a train can leave while logistic robots are still bringing items, and loading inserters can keep a few items in their hands. Those leftovers stay in the requester chests or inserters and can spill into the next train or load.

Factorio can already set requester-chest requests from circuit signals. This creates a standing inventory target rather than a one-shot exact transfer: while the signal remains active, items removed from the chest are requested again; after the request is cleared, robots already on their way may still arrive; and robots can deliver more than requested. A vanilla circuit build can emulate a batch with memory and chest-content calculations, but it becomes more involved across several chests, item qualities, deliveries in flight, and inserter hands.

The mod takes the current circuit item signals and manages them as one batch. It requests the selected items and qualities, removes its logistic requests once the staged quantity is present, waits for deliveries and pickups already in progress to settle, and then enables the loading inserters. It can also handle the last partial inserter loads and optionally send leftovers back to logistic storage when a Follow input becomes zero.

It was created for robot-fed train loading, but it is not tied to trains or a specific train-control mod. You can also use it for other circuit-controlled loading or batch-delivery setups if the same behavior is useful to you.

✨ What it does

  • Captures all accepted nonzero item signals as one fixed batch.
  • Distributes item-and-quality quantities across compatible requester chests.
  • Keeps loading disabled until robot deliveries have settled and the batch is ready.
  • Sends dedicated circuit status signals, including READY, COMPLETE, and ERROR.
  • Supports Follow and Snapshot input behavior.
  • Supports No tail flush, Single tail inserter, and Parallel tail inserters.
  • Can return leftovers and late robot deliveries to logistic storage when automatic Follow cleanup is enabled.
  • Shows configuration, progress, batch details, diagnostics, and recovery actions in a Factorio-style interface.
  • English and French localization.
  • Works with compatible requester containers without requiring a particular requester-chest prototype or train-control mod.

🔧 Basic setup

  1. Connect item signals to the combinator input side.
  2. Connect compatible requester chests and their loading inserters to the output side with red wire, green wire, or both.
  3. Configure every loading inserter to enable only when batch-request-combinator-ready > 0.
  4. Set all accepted item signals to zero and wait for ARMED > 0 before sending the next batch.

The request amount is the batch's final total across all managed chests, not a per-chest or additional amount. Existing matching contents count toward that total. Red and green duplicate paths are counted once.

Each non-error state signal and the WARNING signal has value 1 on every connected output wire network; ERROR carries its error code. Factorio adds the red and green values when the same receiver reads both colors, so use > 0 for state conditions and read only one color when you need the exact ERROR code.

🚦 Operating states

A normal batch moves through the first five states in order. Status signal sent shows the matching custom Batch Request Combinator virtual signal.

State What it means Loading Status signal sent
ARMED Waiting for the next nonzero item request. Configuration can be changed. Off ARMED = 1
REQUESTING The batch is captured and logistic requests are active for the requester chests. Off REQUESTING = 1
SETTLING Requests are removed while the mod waits for late robot activity and checks the staged items and inserter hands. Off SETTLING = 1
READY The batch is staged and loading can begin. Automatic tail handling can release eligible partial inserter hands. On READY = 1
COMPLETE The managed requester chests and monitored inserter hands are empty, robot activity has cleared, and temporary settings are restored. Off COMPLETE = 1
DRAINING Automatic Follow cleanup or Maintenance is returning leftovers to logistic storage. Off No primary state signal
RESET Requester-chest and inserter settings are being restored before returning to ARMED. Off No primary state signal
ERROR The mod stopped because it found an unsafe or ambiguous condition. The error message explains what must be corrected; Technical details shows additional information when available. Off ERROR = error code
ABORTED The previous batch or drain has ended. Set all accepted item signals to zero to return to ARMED. Off ABORTED = 1

COMPLETE describes only the requester-chest and inserter side. It does not confirm that a train or other destination received every requested item. Errors never start automatic cleanup.

🔄 Follow or Snapshot input

  • Follow input: At least one accepted item signal must remain nonzero while the batch is REQUESTING, SETTLING, or READY. If all accepted item signals return to zero during those states, the active batch stops. If automatic cleanup is enabled, the captured requester chests are drained to logistic storage, including items already being carried by robots. After a normal COMPLETE, zero releases the finished batch and returns the combinator to ARMED. Use Follow when the request should remain active only while its circuit source is present.
  • Snapshot: The combinator remembers the captured batch even if the input returns to zero. The batch continues until COMPLETE, and the COMPLETE signal remains active for at least one input check before the combinator can return to ARMED. Snapshot never starts automatic Follow cleanup. Use Snapshot when a short signal should start a complete batch.

Changing a signal while a batch is active does not resize the current batch or queue another one. Wait for the combinator to return to ARMED before sending the next request.

🪶 Tail handling

A tail is the final partial load left in an inserter when it holds fewer items than its effective hand size for that item.

  • No tail flush: The mod never changes inserter stack settings. Choose manual stack-size overrides that do not leave partial inserter hands—for example, use a hand size of 10 when loading 50 or 100 items through one lane—or clear partial hands manually. Otherwise, the batch may remain unfinished.
  • Single tail inserter: Best when several requester-chest and inserter lanes feed the same destination container, such as one wagon. It routes all unavoidable remainder items through one deterministic lane and releases its partial loads one after another. Avoid this mode when the lanes feed separate destination containers.
  • Parallel tail inserters: Best when the lanes feed separate destination containers. It spreads final targets across the requester chests and lets qualifying inserters release their partial loads at the same time. This is the default for newly placed combinators.

Single and Parallel modes require exactly one connected loading inserter for each requester chest. Each inserter must start with an empty hand and use circuit enable/disable with batch-request-combinator-ready > 0. Logistic-network control, circuit-controlled stack size, and circuit-controlled filters must be disabled. Fixed filter slots must be empty when Use filters is disabled. Otherwise, Use filters must be enabled in whitelist mode, and the filter set must exactly match the allocated item-and-quality combinations. The mod briefly adjusts the inserter stack-size override to release a partial hand, then restores the previous value on the next tick.

⚡ Performance and input checks

The mod is designed to limit its UPS impact, especially when many combinators are placed:

  • Combinator checks are spread across different game ticks instead of running all at once.
  • Information that has not changed is reused instead of checked again unnecessarily.
  • Automatic-cleanup work remains idle until a cleanup actually starts.
  • The detailed window is not continually refreshed while it is closed.

You can change Batch input check interval in Settings → Mod settings → Map. The default is 12 ticks, and the available range is 1–60. Lower values react to circuit inputs sooner but use more processing time. Higher values reduce processing work but react more slowly. A zero pulse shorter than the selected interval can be missed.

⚠️ Important limits

  • COMPLETE only confirms that the requester chests and loading inserter hands are empty. It does not check wagon capacity, train identity, train schedules, or Cybersyn delivery state.
  • Requester chests must not be controlled by another active Batch Request Combinator, have circuit Set requests enabled, have another active manual request, or contain items outside the current batch. The mod stops with an error instead of risking moving or deleting player items.
  • Automatic Follow cleanup is disabled by default. It runs only when Follow input reaches zero during REQUESTING, SETTLING, or READY after logistic requests were activated. It includes late deliveries already being carried to the captured chests and temporarily enables Trash unrequested, so the network needs available logistic robots and storage space. Snapshot, normal COMPLETE reset, manual Abort, and errors do not start cleanup. Items sent to storage are not automatically returned.
  • Do not replace, move, merge, split, or rewire managed entities during an active batch. After replacement, reset the input, reconnect the entities, wait for ARMED, and start a new batch.
  • Before disabling or removing the mod, return every combinator to ARMED, then save. Set accepted inputs to zero; let active batches and cleanup finish or stop them with their displayed controls. This gives the mod time to remove its requests and restore temporary inserter and requester-chest settings. You can then disable the mod through Factorio's Mods menu; Factorio performs the required restart, so no separate shutdown is needed. Close Factorio first only if you remove the files manually.

🧩 Compatibility

  • Factorio 2.1.
  • Requires Base; Quality is optional.
  • Multiplayer has not been tested for experimental version 0.1.0.
  • Supports requester targets by runtime capability rather than a hardcoded chest name or size.
  • Does not require or directly integrate with Cybersyn, LTN, Wagon Split, or another train-control mod; any circuit source can provide the request.

🙏 Credits and license

Released under the MIT License.

Generative AI assisted with code, testing, documentation, and the packaged thumbnail artwork. All changes and final assets were reviewed and approved by the maintainer.