Automate URL Shortening with Bitly Using Llama3 Chat Interface - n8n Workflow

Use this powerful n8n workflow to create a local AI Agent powered by Ollama/Llama 3. Users submit URL shortening requests via a chat interface, and the AI uses the specialized Bitly n8n node tool to execute the action. A perfect n8n template for AI tooling.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

AI Enthusiasts: Users keen on deploying local Large Language Models (LLMs) like Llama 3 via Ollama within a functional n8n template.
Marketing Professionals: Individuals who frequently need to shorten URLs quickly based on natural language instructions.
n8n Developers: Anyone looking for advanced examples of using the n8n AI Agent node framework and custom tools.
Technical Teams: Groups requiring internal chat-based tools integrated with business services like Bitly.

Overview

This sophisticated n8n workflow demonstrates the power of combining local AI models with external service providers. The primary challenge this n8n template solves is turning complex API calls into simple, natural language conversations. Instead of manually navigating the Bitly interface or constructing a specialized API request, a user can simply chat with the automation, saying something like 'Please shorten Google's homepage URL.'

The automation uses the n8n AI Agent structure to intelligently determine the user's intent. It leverages the Ollama Chat Model (allowing for local, private AI processing) and provides it with a specific tool—the Bitly Create Link n8n node. This approach makes service automation extremely accessible and dramatically expands the utility of your self-hosted n8n instance.

How it Works

This n8n workflow operates entirely based on the LangChain Agent structure within n8n, ensuring that the AI handles all decision-making regarding tool use.


  1. Trigger (Open Chat): The process initiates when a user submits a message via the n8n built-in Chat Interface. This acts as the main n8n trigger for the entire operation.

  2. AI Agent Activation: The user's input immediately feeds into the AI Agent n8n node. This node acts as the orchestrator, determining if the request requires external action.

  3. Language Model Connection: The AI Agent is connected to the Ollama Chat Model n8n node. This node provides the large language model (LLM, assumed Llama 3) that the agent uses for reasoning, instruction following, and determining if the Bitly tool is necessary.

  4. Tool Provision: The Create Link (Bitly) n8n node is provided to the AI Agent as an available tool. The Agent is trained to recognize that if the user mentions URLs, shortening, or links, it should invoke this specific n8n node.

  5. Execution: If the Agent decides to shorten a URL, it generates the appropriate parameters and passes control to the Bitly n8n node, which executes the link shortening action.

  6. Response: The final shortened URL (or confirmation of the action) is returned by the AI Agent back through the Open Chat n8n trigger interface to the user.

Installation Guide

To deploy this specialized n8n workflow, follow these steps:


  1. Import the n8n template: Copy the provided JSON data and import it directly into your n8n instance using the 'New' -> 'Import from JSON' function.

  2. Ollama Setup: Ensure you have an accessible Ollama endpoint running a model like Llama 3. You will need to configure the credentials for the Ollama Chat Model n8n node, pointing it to your local or remote Ollama server.

  3. Bitly Credentials: Create a new Bitly credential in your n8n setup. You will need a personal access token from your Bitly account and must associate these credentials with the Create Link n8n node.

  4. Activate the n8n workflow: Once all credentials are set up, switch the primary n8n trigger ('Open Chat') to active.

  5. Testing: Access the workflow's built-in chat interface (found via the webhook URL or the 'Open Chat' node documentation) and start conversing with your new AI Agent.

Node Details

This n8n workflow leverages several specialized nodes to achieve seamless AI-driven automation:

Open Chat (n8n trigger):
Function: Serves as the primary starting point (n8n trigger) for the entire workflow, receiving user input from a chat UI.
Key Configuration: Activated via a unique webhook URL, designed to pass the user's chat message content to the next node.

AI Agent:
Function: The central intelligence unit of this n8n template. It orchestrates the process, utilizing the connected LLM (Ollama) to reason and decide whether to call the provided tool (Bitly) based on the input from the n8n trigger.
Key Configuration: Connects simultaneously to one language model and one or more tools.

Ollama Chat Model:
Function: Provides the Large Language Model capabilities, allowing the AI Agent to understand the user's intent. This crucial n8n node facilitates private, local processing.
Key Configuration: Requires configuration of the Base URL for the Ollama server and the specific model name (e.g., llama3).

Create Link (Bitly n8n node):
Function: The specific utility tool available to the AI Agent. Its sole purpose in this n8n workflow is to communicate with the Bitly API to shorten a specified URL.
Key Configuration: Needs valid Bitly API credentials.

Related n8n Workflows

Paid

Nodes: 5 Nodes
Updated: December 26 2025
View all
Created by

Featured*