Random Dog Image Fetcher API Endpoint via Webhook - n8n Workflow

Create a custom API endpoint using this n8n workflow. It uses an n8n trigger to fetch a random dog image URL from the Dog CEO API and instantly returns the result.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Developers needing a lightweight, serverless wrapper for simple external APIs.
Users learning how to use the webhook n8n node for custom endpoints.
Anyone seeking fundamental n8n templates demonstrating request/response cycles.
Automation specialists looking to integrate fun, random data into applications.

Overview

This fundamental n8n workflow provides an excellent demonstration of setting up a public, custom API endpoint without requiring any dedicated server infrastructure. The automation solves the problem of needing immediate access to external API data, wrapped inside your own controlled environment. By using the webhook n8n trigger, the workflow can be called by any external application or service, instantly executing the data fetch logic.

This particular n8n template retrieves a random dog image URL from the highly available Dog CEO API. It showcases the core functionality of connecting an incoming request directly to a subsequent action (HTTP request) and then cleanly returning the result, making it a powerful example for building more complex custom endpoints within n8n.

How it Works

The logic of this n8n workflow is straightforward and efficient, consisting of three main stages:


  1. External Activation (n8n Trigger): The process begins when an external system sends an HTTP request (configured to respond to POST or GET based on the setup) to the dedicated path configured in the webhook n8n trigger node (get-dog-image). This instantly starts the workflow execution.

  2. Data Fetching: Once triggered, the Fetch Random Dog Image n8n node executes. This is an HTTP Request type configured to send a GET request to the public Dog CEO API endpoint (https://dog.ceo/api/breeds/image/random). This API returns a JSON payload containing the image URL.

  3. Response Handling: The data (the JSON response from the Dog CEO API) is immediately passed to the Respond with Image URL n8n node. This special n8n node is configured to take all incoming data items and package them as the final HTTP response, returning the dog image URL directly back to the original caller of the n8n workflow endpoint.

Installation Guide

To deploy this n8n workflow, follow these steps:


  1. Import: Copy the provided JSON code and import it directly into your n8n instance via the 'New' button or the 'Import from JSON' option.

  2. Activation: Ensure the workflow is marked as 'Active' in the top-right corner. This initializes the webhook n8n trigger.

  3. Obtain Endpoint: Double-click the 'Trigger Webhook' n8n node and copy the 'Webhook URL'. This is the endpoint you will call externally.

  4. Testing: Send an HTTP request (using tools like cURL, Postman, or integrating it into another n8n workflow) to the copied URL. The response should be a JSON object containing the message property with a random dog image URL.

No external credentials are required for this specific n8n template, as the Dog CEO API is public.

Node Details

Trigger Webhook (n8n Trigger Node):
Function: Acts as the entry point for the entire n8n workflow, listening for external HTTP requests on the specified path (get-dog-image).
Key Configuration: Set to use 'Response Node' mode, ensuring the final response is controlled by the subsequent Respond to Webhook n8n node.
Fetch Random Dog Image (HTTP Request n8n Node):
Function: Performs the core action of fetching the data by making a GET request to the external Dog CEO API. This determines the content returned by the entire n8n workflow.
Key Configuration: URL is set to https://dog.ceo/api/breeds/image/random.
Respond with Image URL (Respond to Webhook n8n Node):
Function: Closes the request/response loop initiated by the n8n trigger. It sends the data received from the previous Fetch Random Dog Image n8n node back to the client that called the webhook.
* Key Configuration: Set to 'Respond With: All Incoming Items', ensuring the full API response is returned.

Related n8n Workflows

Free

Nodes: 4 Nodes
Updated: December 26 2025
View all
Created by
ist00dent
ist00dent

I’m a dedicated automation engineer passionate about no-code and low-code solutions. I design and implement robust n8n workflows—integrating APIs, databases, and messaging—to eliminate manual tasks and accelerate delivery. Leveraging Python and C#, I build scalable, adaptable automations that empower teams to focus on high-value work.

Featured*