XML Record Batcher — Large XML to NDJSON
Pricing
$100.00 / 1,000 prepared xml documents
XML Record Batcher — Large XML to NDJSON
Split plain XML uploads into ordered NDJSON batches of at most 1 MiB. Up to 200 MiB and 100,000 records per document. Keep attributes, namespaces and mixed content. $0.10 per successful document; no external feed fetching.
Pricing
$100.00 / 1,000 prepared xml documents
Rating
0.0
(0)
Developer
Stefan Schellen
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
10 hours ago
Last modified
Categories
Share
XML Record Batcher
Prepare a large XML upload as small, ordered NDJSON files for a workflow that cannot hold the whole converted document in memory. Choose an exact record tag; retrieve the manifest, then fetch and process one batch at a time.
This is a paid Agent Tools utility. Price: $0.10 per successfully prepared XML document, including all batches. Platform usage is included in the event price.
Example
Input:
{"xmlText":"<feed><item id=\"01\">First</item><item id=\"02\">Second</item></feed>","recordTag":"item"}
A batch contains one JSON object per line:
{"index":1,"element":{"tag":"item","attributes":{"id":"01"},"content":["First"]}}{"index":2,"element":{"tag":"item","attributes":{"id":"02"},"content":["Second"]}}
Attributes and text remain strings; repeated children and mixed text/child order are preserved. Namespace names expand to URI|local, for example urn:catalog|item. Nested matching tags remain within the selected outer record. Comments and processing instructions are omitted. This is structured XML, not automatic product-field mapping, XPath, schema validation or business-data cleanup.
Larger input
Clear the inline example before using xmlFiles. Supply exactly one accessible Apify key-value-store record URL for plain XML. For private storage, obtain a record-specific signed URL using your Apify client’s get_record_public_url method; never put your account token in a URL. Simple record keys only (letters, digits, _-.~); rename other keys before using them. External URLs, redirects, ZIP and gzip are not supported. Your workflow must get the original document into Apify storage first. This does not solve source-server compression or download restrictions.
The native upload widget has been removed: a normal private Console upload link does not include access authorization, and this Actor never forwards account credentials to downloads. Use a signed record link for large files; for XML up to 1 MiB, paste the text into xmlText. This change does not add external feed fetching or broader account access.
For Python SDK users, after uploading source.xml into your own store:
signed_url = client.key_value_store(store_id).get_record_public_url("source.xml")run_input = {"xmlFiles": [signed_url], "recordTag": "item"}
Keep the signed URL private. Start the Actor separately with your chosen spending limit, wait for success, then use the free validated batch reader and guide. The reader never starts a new Actor run. The private cloud acceptance tested signed input; the reader's authenticated HTTP integration remains untested.
Output and limits
The single dataset row and OUTPUT key contain record count, source/output byte counts and ordered batch entries: recordKey, bytes, records, sha256. Files live in the run's default key-value store. Fetch a record using your Apify credentials; do not assume the key alone is a public link. Parse each NDJSON line separately and release the batch before fetching the next.
- Plain XML: at most 200 MiB; inline input: 1 MiB.
- Up to 100,000 selected records; depth at most 64.
- Each serialized record and each batch: at most 1 MiB; total output at most 220 MiB.
- DTDs and entity declarations are rejected. XML must validate to its end before upload starts. No partial success for malformed or over-limit XML.
- Parser child has Linux memory/CPU limits and a wall-clock timeout. These controls are not a security audit or a claim to support every XML dialect.
- Failed upload may leave partial batch records in run storage: use only a successful run with a complete manifest. Inspect the existing run before retrying; a timeout does not prove the run failed.
Workflow and alternatives
Start the Actor asynchronously, wait for success, read its manifest and loop over batch keys. An n8n Code step can split a downloaded batch by newline and parse each line with JSON.parse. This is guidance, not a verified n8n Cloud template. Keep tokens in credentials, not exported workflows. Original input and output consume your Apify storage; manage retention appropriate to your data.
Free alternatives are Python's XML parsers with a staging writer, a self-hosted worker, or n8n's XML node for documents that fit its memory. A generic XML-to-JSON converter is simpler for small complete documents. This tool is useful when you want hosted bounded batches without maintaining that worker.
Tested scope
Local synthetic fixtures cover order, repeated children, namespaces, mixed content, malformed XML, DTD rejection, limits, batch integrity and billing orchestration. A local 184.6 MB synthetic input yielded 90,000 records; this is not an n8n/cloud performance guarantee. Private cloud acceptance processed the same 90,000-record fixture into 184 batches. Manifest totals and first/middle/last batch hashes were checked; every output byte was not downloaded again. Actual n8n Cloud execution has not been tested. No customer documents or external feeds were used.
Report reproducible problems through Apify Issues using synthetic data. Remove credentials and signed links. No custom integration or schema mapping service. Built with AI assistance. More tools: https://apify.com/creatieve_naald