Tips > Data, APIs & Webhooks

Use Path Parameters in Webhook URLs for Dynamic Routing

Instead of creating separate webhook nodes for every resource, use path parameters to build dynamic routes.

n8n webhook paths support Express-style :param segments, so one endpoint can serve many resources. Set a path like webhook/orders/:orderId/status, and n8n extracts the value into $json.params.orderId for any downstream node or expression. This replaces one webhook per resource with a single parameterized route and removes hard-coded IDs from the workflow.

What are path parameters in n8n webhook URLs?

Instead of creating separate webhook nodes for every resource, use path parameters to build dynamic routes. n8n supports Express-style :param syntax in webhook paths, letting you extract values like order IDs, user IDs, or action types directly from the URL. This keeps your workflow count manageable and centralizes related logic.

Real-world example: An e-commerce platform sends order status updates to your n8n instance. Rather than one webhook per order, use a single parameterized endpoint that extracts the order ID from the URL path.

How do you configure a parameterized webhook route?

Set the Webhook node path to:

webhook/orders/:orderId/status

Then in a downstream Code node or expression, access the parameter:

// In any expression field downstream
{{ $json.params.orderId }}

// In a Code node
const orderId = $input.first().json.params.orderId;
const body = $input.first().json.body;

return [{
  json: {
    orderId,
    newStatus: body.status,
    updatedAt: new Date().toISOString()
  }
}];

A POST to https://your-n8n.example.com/webhook/orders/ORD-4829/status will make ORD-4829 available as $json.params.orderId throughout the workflow. This eliminates hard-coded IDs and lets one workflow serve thousands of resources.

Related: Set a Unique Encryption Key and Back It Up · Use the HTTP Request Node as a Universal Connector

Showcase builds

19 complete workflows from my own projects, each with its n8n workflow JSON to import. Showcase entries link the file at the end of the article.

See the showcase builds

Keep reading

190 entries grouped by topic, from first workflow to queue mode. Free, no signup.

Browse the encyclopedia

Need it built?

I design, build and run n8n systems for clients. Every engagement starts with a $1,500 diagnostic audit, credited toward the build.

Book an introductory call