When this helps
Workbook-grounded and author-clarified; proposed reconstruction. People who do not code often encounter repetitive file and data tasks that are simple to describe but slow to perform manually. GenAI can translate an ordinary-language request into a script that repeats the transformation across a collection.
Proposed and author-clarified. Delegating the coding can make batch automation available to non-coders, but a small misunderstanding may be repeated across every item. A person who cannot inspect source code needs visible behavioural safeguards. Direct execution against originals risks destructive changes, silent corruption and irreproducible output.
Pattern response
Proposed and author-clarified. Treat delegated batch scripting as a bounded, preservation-oriented transformation. Let the person describe the outcome and examples in ordinary language while the system handles the coding complexity. Require the script to read from originals and write a new copy, then test representative cases and show a dry-run manifest. Permit agent execution only within the reviewed scope and after approval. Reconcile inputs, outputs, failures and semantic samples before accepting the new collection.
- A documented transformation contract and tested script.
- A dry-run manifest showing intended actions before mutation.
- A logged batch run with failures and skipped items made visible.
- Reconciled outputs and a recoverable route to the original material.
- A plain-language account that enables a non-coder to understand and approve the script’s intended behaviour.
Workflow at a glance
- 01
Describe the task and preservation boundary
The task owner supplies examples, confirms the exact originals and new output location, defines prohibited actions and decides whether the transformation is suitable for batching.
MOD-001 · MOD-020 - 02
Generate and test on copies
The task owner reviews plain-language explanations and sample results; a technically capable reviewer examines code or dependencies when risk or complexity warrants it.
MOD-028 · MOD-034 - 03
Preview and approve the batch
The task owner checks the manifest, conflicts, skipped items, expected counts and resolved paths, then approves, revises or rejects the proposed run.
MOD-034 · MOD-043 - 04
Execute to a new copy and reconcile
The task owner monitors exceptions, inspects representative outputs and decides whether to accept, revise or discard the new collection while retaining the originals.
MOD-034 · MOD-042 · MOD-044
Human checkpoints
The task owner explains the desired result, reviews examples and approves visible behaviour without being required to read code. A technically capable reviewer may be needed for high-risk or complex transformations. The system may draft, explain, test and execute within authorised bounds, but it cannot enlarge the target, alter originals or decide that an unexplained discrepancy is acceptable.
Risks and misuse
Reconstructed risks
- The script overwrites, deletes or moves material outside the intended scope.
- A test set omits edge cases that dominate the real collection.
- Partial failure leaves inputs and outputs in an inconsistent state.
- Logs contain confidential filenames or content.
- Generated code includes unsafe dependencies, network calls or platform assumptions.
Use this pattern
Begin with the recurring problem and the authorised inputs. Follow the workflow in order, keep intermediate outputs inspectable and retain the named human decisions.
- Minimum viable implementation: give a conversational system a plain-language task and several copied examples, request an explained script and dry run, then execute manually with a separate source and output folder.
- Robust implementation: enforce read-only source access, use representative and edge-case tests, generate machine-readable manifests and logs, stop on conflicts, reconcile every input and output, and retain the complete contract and script version.
- Low-code implementation: use an approved coding agent to inspect samples, generate and test the script, display a plain-language preview and execute only after approval of exact resolved paths and permitted actions.
- Local or privacy-preserving implementation: run scripts and models locally when collections contain sensitive, unpublished or restricted material; exclude confidential content from prompts and redact logs where necessary.
- Speculative implementation: allow an agent to propose and perform more complex batch transformations through staged approvals, while preserving originals, constraining permissions, logging each action and requiring separate authorisation for destructive behaviour.
Reusable modules
Related patterns
Technical and provenance detail
Data and information flow
Proposed and author-clarified. A preserved input collection, ordinary-language contract and representative copies produce an explained script, test results and dry-run manifest. Approved execution reads the originals and creates outputs in a new location. Reconciliation links every output, failure, skip and exception to an input while the original collection remains available.
Source provenance
- Pattern ID: DP-029
- Original workbook row(s): 39.
- Original label(s): Delegated Batch Scripting (DC).
- Inherited source category/theme: THEME: Automation.
- Source status: workbook-derived source; the source supplies concise labels rather than a complete pattern narrative.
- Extraction notes: Original labels, row relationships, categories, themes, rationales, and confidence assessments are preserved below.
- Editorial interventions: The problem statement, response, forces, risks, workflow, and module mapping are documented reconstructions that retain explicit provenance labels and remain open to author and practice-based validation.
- Author clarification (2026-08-20): The pattern primarily introduces people who do not know how to code or what scripting is to the use of AI for batch scripting. The person describes a task and the agent handles the coding complexity. Examples include a Python script that divides a document into parts or reorganises a folder. The process should be non-destructive and preservation-oriented: retain the originals and produce a new copy. Agent execution may be permitted through a graduated process of testing, dry-run review, bounded approval and separate authorisation for destructive actions.
Open questions
- Which minimum test and recovery evidence should be mandatory before a batch run?
- Which preview formats best support informed approval by people who do not read code?
- How should semantic correctness be sampled when every output cannot be inspected manually?