Reference
Operations
Every verb in the Routecraft DSL. Each row opens its own reference page with the full signature, options, and examples.
craft()
.id('my-route')
.from(simple('x'))
.filter((s) => s.length > 0)
.transform((s) => s + '!')
.to(log())
Route
10.id(name)Set the unique identifier for the route.
.title(text)Display title for tooling and docs.
.description(text)Free-text description for the route.
.input({ body, headers })Validate the incoming exchange against a Standard Schema.
.output({ body, headers })Validate the outgoing exchange against a Standard Schema.
.tag(key, value)Attach metadata for filtering and metrics.
.batch(options?)Process exchanges in batches instead of one at a time.
.error(handler)Catch route-scope errors before from(), or wrap the next step after from().
.from(source)Set the source that produces exchanges.
Wrapper
07.retry(options?)Retry the next operation (or the whole pipeline) on failure.
.throttle({ rate, per })Rate-limit the next operation (or the whole pipeline).
.timeout(ms)Fail the next operation (or the whole pipeline) after a deadline.
.delay(ms)Pause before the next operation.
.cache({ key, ttl })Cache and reuse the result of the next operation.
.circuitBreaker({ failureThreshold })Trip after repeated failures and fast-fail until the target recovers.
.concurrency({ max })Bound how many exchanges run the next operation (or the whole pipeline) at once (bulkhead).
Transform
06.transform(fn)Replace the body with the function's return value.
.header(name, value)Set or override an exchange header.
.authenticate(claims)Mint a principal from verified claims.
.map(mapping)Map fields from source to target via a declarative mapping.
.process(fn)Transform with full read-write access to the exchange.
.enrich(fn)Merge extra data into the current body.
Flow Control
12.filter(predicate)Drop exchanges that fail the predicate.
.validate(schema)Halt the exchange if the body fails the schema.
.schema(schema)Strip unknown fields per a schema, fail on validation errors.
.dedupe({ key })Drop exchanges whose derived key has already been seen.
.choice(when(...), otherwise(...)?)Branch the pipeline by predicate.
.split(fn?)Fan out one exchange into many.
.aggregate({ key, every })Collect exchanges into a batch by key or interval.
.multicast(...paths)Fan the exchange out to multiple paths in parallel.
.dispatch(strategy, ...targets)Run exactly one target, chosen by load-balancing strategy.
.loop(condition)Repeat a sub-pipeline while a condition holds.
Planned.sample({ every })Pass every Nth exchange, or the first per time window.
.debounce({ waitMs })Release only the last exchange in a burst after a quiet period.