Skip to content

Configuration

A state.json file (RunStateSchema) drives a run alongside the orchestration DAG. The state file supplies all runtime parameters — what to fetch, how fast, where to write, how to crawl. It is validated at startup before any network activity begins.

Pass it on the command line:

bash
ripperoni run mysite.dag.jsonld --state mysite.state.json

Schema source of truth: src/schemas/RunStateSchema.ts.

Top-level fields

FieldTypeRequiredDescription
baseUrlURInoBase URL for the target. All fetched URLs resolve against this. Required when using html:fetch.
apiUrlURInoMediaWiki API endpoint (e.g. https://en.wikipedia.org/w/api.php). Required when using wiki:fetch.
rateLimitMsinteger ≥ 0noMinimum milliseconds between requests.
jitterMsinteger ≥ 0noRandom jitter added on top of rateLimitMs per request.
maxRetriesinteger 0–10noRetry attempts on transient errors.
retryBaseDelayMsinteger ≥ 100noBase delay for retry backoff.
retryMaxDelayMsinteger ≥ 1000noBackoff ceiling.
headersobjectnoAdditional HTTP request headers. Include User-Agent.
outputOutputConfigyesOutput settings (see below).
cacheCacheConfignoCache settings. Defaults to read-write at output/.cache/<taskName>.
crawlerCrawlerConfignoLink-crawler config for the crawl:discover DAG.
urlsstring[]noExplicit URL or title list. When present and no crawl:discover node is needed, the scatter reads directly from this.
useJsdombooleannoPass fetched HTML through JSDOM before parsing. Enables synchronous script execution.
jsdomLoadTimeoutMsinteger ≥ 1000noCeiling for the JSDOM load event wait. Defaults to max(10000, retryMaxDelayMs ?? 30000).
parallelWorkersbooleannoRoute scatter items to a WorkerThreadContainer pool. Requires npm run build:workers.
includeRawContentbooleannoInclude _raw field in output records. Default true.
outputSchemastringnoPath to a JSON Schema file for output record validation.
onSchemaError"halt" | "skip" | "warn"noDisposition when a record fails schema validation.

output

KeyTypeRequiredNotes
basePathstringyesBase directory for all written output files.
format"json" | "jsonl"noOutput file format. Default "json".
prettybooleannoPretty-print JSON output. Default false.
splitByTaskNamebooleannoWhen true, output is partitioned into per-task subdirectories beneath basePath.

cache

KeyTypeRequiredNotes
dirstringyesDirectory for cache files.
modeenumyesread-write, read-only, write-only, or off. off requires includeRawContent: false.
ttlMsinteger ≥ 0noEntries older than this are treated as misses.

crawler

Configures the crawl:discover embedded DAG. All regex fields are strings compiled internally.

KeyTypeRequiredNotes
startUrlsstring[]yesAbsolute URLs where the crawl begins. At least one required.
domainregex stringyesLinks must match to enter the crawl at all. Bounds traversal to one site.
targetregex stringyesLinks matching domain + delimiter + target are collected as scrape targets.
delimiterregex stringyesLinks matching domain + delimiter are added to the traversal frontier.
rateLimitMsinteger ≥ 0noGap between crawler requests, independent of the target rate limit.
jitterMsinteger ≥ 0noRandom jitter added on top of crawler rateLimitMs.
maxPagesinteger ≥ 1noHard ceiling on collected target URLs. Omit for an unbounded crawl.
concurrencyinteger 1–32noFrontier URLs fetched concurrently per BFS depth level. Defaults to 1.

reservoir

Controls reservoir scatter on the orchestration's ScatterNode for very large URL lists. When enabled, the engine processes capacity items concurrently instead of loading the full list into memory at once.

KeyTypeRequiredNotes
keyFieldstringyesState field name used as the reservoir slot key. Must match itemKey on the scatter node (typically currentItem).
capacityinteger 1–1000yesMaximum concurrent scatter slots. The engine pulls items in batches of this size, releasing a slot only on item completion.
idleMsinteger ≥ 1000noMilliseconds after which an idle, source-exhausted reservoir is considered complete. Default 30000.

Activate reservoir scatter by adding the matching reservoir block to the ScatterNode in the .dag.jsonld file — the state.json entry documents intent and is reflected in the example DAG.

Full example

json
{
  "baseUrl":          "https://2e.aonprd.com",
  "rateLimitMs":      1000,
  "jitterMs":         250,
  "maxRetries":       3,
  "retryBaseDelayMs": 500,
  "retryMaxDelayMs":  30000,
  "headers": {
    "User-Agent": "ripperoni/3.0 (+https://github.com/Studnicky/ripper)"
  },
  "output": {
    "basePath": "./output",
    "format":   "json",
    "pretty":   true
  },
  "cache": {
    "dir":   "./output/.cache/aonprd",
    "mode":  "read-write",
    "ttlMs": 86400000
  },
  "crawler": {
    "startUrls": [
      "https://2e.aonprd.com/Feats.aspx",
      "https://2e.aonprd.com/Spells.aspx",
      "https://2e.aonprd.com/Monsters.aspx"
    ],
    "domain":      "2e\\.aonprd\\.com",
    "target":      "\\?ID=",
    "delimiter":   "\\.aspx",
    "rateLimitMs": 1000,
    "jitterMs":    250,
    "maxPages":    5000
  }
}

Output folder layout

Records land under output.basePath in a subdirectory named after the plugin's task. With basePath: ./output and a plugin task named aonprd, records land in ./output/aonprd/. When splitByTaskName: true, output is further partitioned into per-task subdirectories.

output/
  aonprd/
    Feats.aspx?ID=750.json
    Spells.aspx?ID=1.json
  .cache/
    aonprd/
      a3/
        b7c9d2e1f4.meta.json
      bodies/
        a3/
          b7c9d2e1f4.body

Failed pages are written to failures.json in the output directory.

Raw content

When includeRawContent is true (the default), each output record carries a _raw field:

json
{
  "_raw": {
    "contentType": "text/html",
    "content":     "<html>...</html>",
    "fetchedAt":   "2026-05-07T04:00:00.000Z"
  }
}

Set includeRawContent: false to strip _raw from output. Setting cache.mode: "off" while includeRawContent is true is rejected at startup — raw content output without a write-capable cache exhausts disk on large scrapes. To disable caching, set includeRawContent: false first, then cache.mode: "off".

  • Authoring a DAG: placement types, DAGBuilder API, built-in nodes
  • Plugins: node contract and the services bag
  • Crawler: crawl:discover DAG and regex decision tree
  • Cache: read/write modes, TTL, eviction

Released under the MIT License.