Skip to content

Fortified IDDocs

Subpipes

Reusable named valve sequences that run in the calling pipe's context.

A subpipe is a named, reusable sequence of valves defined at module level. When a pipe includes a subpipe using the Pipe Include valve, the subpipe's valves execute inside the calling pipe's context. They share the same request, session, state, and items — no new context is created.

This is useful when several pipes share a common set of steps, such as enriching request data, validating a token, or building a set of items, and you want to maintain that logic in one place.

Subpipes are defined in the module configuration. The preferred approach is to use the top-level subpipes attribute alongside the pipes array.

NameDescriptionDefaultMandatory
idUnique identifier of the subpipe. Used when referencing the subpipe from the Pipe Include valve.
enabledFlag to enable or disable the subpipe.true
display_nameOptional display name used in logs. If omitted, the id is used.id
config.valvesOrdered list of valves forming the subpipe.[]

A subpipe is included in a pipe using the Pipe Include valve. The subpipe property references the subpipe by its id.

{
"name": "PipeInclude",
"config": {
"subpipe": "shared-auth"
}
}

The exec_if_expr property can be used on a PipeInclude valve to conditionally include the subpipe, the same as with any other valve.

The following valves are not allowed inside a subpipe and will cause an error at startup:

  • PipeInclude — subpipes cannot include other subpipes
  • PipeExec — subpipes cannot execute other pipes
  • PipeCall — subpipes cannot call other pipes

When a subpipe executes, each valve logs with context identifying both the calling pipe and the subpipe:

pipe=<pipe-id> subpipe=<subpipe-display-name> valve=<valve-name>[<index>]

This makes it possible to trace execution across pipes and subpipes in the same log stream.