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(value)Attach one or more tags for filtering and discovery.
.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
07.transform(fn)Replace the body with the function's return value.
.header(name, value)Set or override an exchange header.
.authenticate(resolver)Mint a principal from claims the resolver has verified.
.delegate(resolver)Mark the principal as exercised by an actor (an agent) on the subject’s behalf.
.map(mapping)Map fields from source to target via a declarative mapping.
.process(fn)Transform with full read-write access to the exchange.
.enrich(enricher, aggregator?)Pull data in; the result replaces the body unless an aggregator merges it.
Flow Control
12.filter(predicate)Drop exchanges that fail the predicate.
.validate(validator)Check the body with a validator; the coerced result replaces it.
.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(fn?)Fold the children of a split back into one exchange.
.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 } | { interval })Pass every Nth exchange, or the first per time window.
.debounce({ wait })Release only the last exchange in a burst after a quiet period.