ctx.route
The current route matching information, corresponding to the route concept in React Router. It is used to retrieve the current matching route configuration, parameters, and more. It is typically used in conjunction with ctx.router and ctx.location.
Use Cases
Note:
ctx.routeis only available in RunJS environments that contain a routing context (such as JSBlocks within a page, Flow pages, etc.). It may be null in pure backend or non-routing contexts (such as background workflows).
Type Definition
Common Fields
Relationship with ctx.router and ctx.location
ctx.route focuses on the "matched route configuration," while ctx.location focuses on the "current URL location." Together, they provide a complete description of the current routing state.
Examples
Reading pathname
Branching based on params
Displaying in a Flow page
Related
- ctx.router: Route navigation. When
ctx.router.navigate()changes the path,ctx.routewill update accordingly. - ctx.location: Current URL location (pathname, search, hash, state), used in conjunction with
ctx.route.

