Batch Operations Guide

Multilogin X Script Runner Playbook

This guide formalizes script-runner usage into a controlled batch workflow with payload contracts, safety checks, and incident-aware execution limits.

Updated: 2026-04-05 | Input references: automation handbook and run-script examples in reference repositories.

Payload Contract

Minimum Request Shape

{
  "script_file": "profile.py",
  "profile_ids": [
    {
      "profile_id": "2b91e901-4606-46fc-af20-f93a8865a7ff",
      "is_headless": true
    }
  ]
}

Keep schema strict so failed payloads are rejected early instead of poisoning whole batches.

Execution Safety

Batch Strategy That Does Not Collapse

Step 1: Validate payload schema and profile ownership before queueing.
Step 2: Split workloads into small cohorts with max concurrency limits.
Step 3: Track each job by trace_id, profile_id, and script_version.
Step 4: Stop or quarantine a cohort when failure ratio crosses threshold.
Step 5: Save run evidence and summarize pass-fail matrix for decision pages.

Recommended Thresholds

  • Max batch size: 10 profiles per wave for initial rollout.
  • Failure stop trigger: > 20% in any 10-minute window.
  • Retry cap: 1 immediate retry, then quarantine.
  • Timeout classes split by startup, runtime, and cleanup.

Evidence Fields

  • trace_id and batch_id
  • profile_id and script_file
  • headless flag
  • duration_ms and end_state
  • failure_class and rollback_action

Pseudo Control Loop

def run_batch(batch):
    results = []
    for job in batch:
        if should_pause_batch(results):
            quarantine_remaining(batch, results)
            break

        result = run_script_job(job)
        results.append(result)

    publish_batch_summary(results)
    return results

Pause and quarantine logic is more valuable than blind retries under unstable conditions.

Failure Matrix

Common Script Runner Problems

Problem Likely cause Fast action
Batch-wide crash wave Single malformed payload pushed to full cohort Introduce schema gate and canary cohort before full run.
Random timeout spikes No per-stage timeout budget Split timeout by startup, run, and stop stages.
Orphan sessions after failure No cleanup enforcement Force stop in finally and track cleanup result codes.
No audit trace for incidents Weak logging schema Use mandatory trace_id and batch summary artifacts.

Affiliate Connection

Use Batch Reliability to Qualify Buyer Traffic

Readers trust recommendations more when they see controlled run evidence. Publish your pass thresholds, then route to commercial pages.

FAQ

Script Runner Questions

What is the biggest batch risk?

Failure propagation from one invalid payload or profile state to the whole cohort.

Should headless mode always be on?

No, use it only where your workload and repeated checks confirm stable behavior.

How does this improve affiliate conversion quality?

Evidence-backed reliability attracts better-fit buyers and reduces low-confidence traffic.