n8n

How to Automate Dub Link Creation and Updates?

Create and maintain branded short links without leaving n8n. Ideal for marketing teams that need fast, reliable links for campaigns and content.

The flow starts when you click Test Workflow. A setup node collects your Dub API key, the long URL, the project slug, and optional custom slug and domain. The system first tries to create the short link in Dub. If the call succeeds, it returns the final short link. If the slug already exists, the flow looks up the link and then updates it to point to the new destination. Requests include your project slug and a Bearer token header. Batch controls and a rate note help you run larger lists safely without hitting limits.

You only need a Dub account, an API token, and your project slug. Fill the fields in the API Auth node and run a quick test. Expect link setup to drop from several minutes to under a minute per link with fewer mistakes. Use it for campaign launches, seasonal offers, and quick fixes when landing pages change.

What are the key features?

  • Manual start with a test trigger for safe runs
  • Input collection for API key, long URL, project slug, and optional slug and domain
  • HTTP POST to create links with Authorization header and project slug query
  • Condition check on status code to choose create or update path
  • HTTP GET to retrieve an existing link by slug and domain
  • HTTP UPDATE to change the destination when the slug already exists
  • Shortened URL output that returns the final short link string
  • Batch settings to control volume and respect API limits
  • Requests set to never stop the run so logic can handle responses

What are the benefits?

  • Reduce manual work from 10 minutes to 1 minute per link
  • Automate short link creation and updates in one flow
  • Cut copy paste and wrong slug errors by up to 90%
  • Process up to 10 links per minute by default with batching
  • Keep links current across campaigns without logging into Dub

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Dub. See the Tools Required section above for links to create accounts with these services.
  3. Open the API Auth node and enter your Dub API key, the long URL to shorten, your project slug, and optional custom slug and custom domain.
  4. Create an API token in your Dub account and copy it. In n8n Cloud, paste the token into the Dub API Key field in the API Auth node. No extra credential is required because the HTTP header uses this field.
  5. Open the CREATE node and confirm the URL is https://api.dub.co/links and the Authorization header uses Bearer followed by the API key from the API Auth node.
  6. Open the RETRIEVE node and verify the query parameters pull project slug, slug, and domain from the API Auth node fields.
  7. Open the UPDATE node and confirm it is set to update the link. Leave the prefilled settings in place unless your Dub project requires different fields.
  8. Optional batching: in the HTTP Request nodes, check Options then Batching and keep the default 10 items per minute or adjust to match your volume and the Dub rate limits.
  9. Click When clicking Test Workflow to run a test. In the executions panel, confirm the Shortened URL node shows the expected short link.
  10. Run a second test with the same slug but a different long URL to confirm the update path works and the destination changes.
  11. Troubleshoot common issues: 401 means the API token is wrong or missing, 404 means the slug or project slug is not found, and 429 means rate limit so lower batch size or increase the interval.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Free: $0 / mo — includes API access (60 requests/min) and 25 new links / mo

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.