Overview
This node integrates with the Shlink URL shortener service to create shortened URLs. It is useful for scenarios where you want to generate compact, shareable links that redirect to longer URLs, such as in marketing campaigns, social media posts, or tracking clicks. The node supports creating short URLs with customizable options like custom slugs, tags, and domain selection.
For example, you can use this node to:
- Generate a short link for a long product URL to share on Twitter.
- Create branded short URLs by specifying a custom slug and domain.
- Automatically reuse existing short URLs if they match the long URL, avoiding duplicates.
Properties
| Name | Meaning |
|---|---|
| Long URL | The original URL that you want to shorten. |
| Title | An optional display title for the short URL. |
| Crawlable | Whether the short URL should be included as 'Allow' in Shlink's robots.txt (boolean). |
| Forward Query | Whether query parameters from the short URL should be forwarded to the long URL (boolean). |
| Find If Exists | If true, returns an existing matching short URL instead of creating a new one. |
| TAG(s) | One or more tags to attach to the short URL for categorization or filtering. |
| Domain | The domain under which the short URL will be created. Required. |
| Path Prefix | A prefix prepended to the custom slug or auto-generated short code. |
| URL Generation Method | How to generate the short URL: either "Short Code" (auto-generated) or "Custom Slug" (user-defined). |
| Custom Slug | A unique custom slug to use instead of an auto-generated short code (only shown if "Custom Slug" chosen). |
| Short Code Length | Length of the generated short code; minimum 4 characters, default is 5 (only shown if "Short Code" chosen). |
Output
The node outputs JSON data representing the created short URL object returned by the Shlink API. This typically includes fields such as the short URL itself, the long URL it redirects to, metadata like tags and title, and other relevant details about the short URL.
If binary data were involved (e.g., QR codes), it would be summarized here, but this node focuses on JSON output only.
Dependencies
- Requires access to a Shlink instance with its REST API enabled.
- Needs an API key credential configured in n8n to authenticate requests to the Shlink server.
- The base URL for the API is constructed dynamically from the provided credentials.
Troubleshooting
Common issues:
- Invalid or missing API credentials will cause authentication errors.
- Providing a custom slug that already exists may result in a conflict error.
- Using an invalid domain or one not configured in Shlink could cause failures.
- Setting the short code length below 4 will likely be rejected.
Error messages:
- Authentication errors: Check your API key and host URL configuration.
- Conflict errors when using custom slugs: Choose a different slug or enable "Find If Exists" to reuse existing URLs.
- Validation errors: Ensure required fields like Long URL and Domain are correctly set.