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.

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.

Set the Webhook node path to:

webhook/orders/:orderId/status
```text
Then in a downstream Code node or expression, access the parameter:

```javascript
// 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()
  }
}];
```text
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](../security-best-practices/01-set-a-unique-encryption-key-and-back-it-up.md) | [Use the HTTP Request Node as a Universal Connector](../integration-patterns/01-use-the-http-request-node-as-a-universal-connector.md)

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

191 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 a 20-minute call