Yourls URL Shortener

This workflow automates URL shortening, stats retrieval, and expansion using Yourls via a webhook. Key nodes include Webhook (receives POST requests), Input Validation (sanitizes inputs), Check Input Valid (verifies operation), Validate and Prepare URL (ensures valid URLs), Yourls Shorten URL (creates short URLs), Check Shortening Success (confirms shortening), Get URL Stats (fetches click data), Expand Short URL (resolves URLs), Process Operations Result (summarizes output), Success Response (returns JSON), and error responses (Invalid Input, Shortening Error, Yourls Operations Error). It uses the Yourls API. Setup Requirements Install n8n from n8n.io or sign up at cloud.n8n.io. Import the JSON into n8n’s workflow editor. Install Yourls on a server or use a hosted instance. Obtain Yourls API credentials (signature token or username/password) from the Yourls admin panel (Tools > API). In n8n, configure yourlsApi credentials under yourls-credentials with the Yourls base URL (e.g., https://your-domain.com/yourls-api.php) and signature token or username/password. Configure the Webhook node by copying its URL (/yourls-operations). Set allowedOrigins (e.g., 'https://your-domain.com') for security. The workflow expects a JSON payload with 'operation' (e.g., shorten_and_test), 'url', 'title', 'keyword', or 'shortUrl'. Handle errors like invalid URL (400: Invalid input) or API failure (502: Failed to shorten). Secure credentials and webhook URL. Testing and Deployment Import the JSON into n8n and activate the workflow. Configure Yourls credentials. Test the Webhook with a POST request (e.g., curl -X POST [webhook-url] -d '{"operation": "shorten_and_test", "url": "https://example.com"}' -H 'Content-Type: application/json'). Verify URL shortening, stats retrieval, expansion, and Success Response JSON with operation details (e.g., short_url, clicks). Test error cases: invalid URL (400: Invalid input), invalid token (401: Unauthorized), or non-existent short URL (502: Yourls operations failed). Check n8n and Yourls logs for errors. Integrate the webhook URL into your application, secure credentials, activate the workflow, and deploy for automated URL operations. Monitor Yourls API response times and click tracking.

$6.99

Workflow steps: 13

Integrated apps: webhook, set, if

Yourls URL Shortener preview