WorkflowOtherOpen

n8n LLM chain prompt chaining examples with Claude

This n8n workflow shows several ways to chain LLM prompts, using Anthropic chat models on content fetched from a web page. It is for builders deciding how to structure multi step prompts in n8n who want working patterns with their pros and cons written next to each.

What it does

It fetches a page, converts it to markdown and runs an array of prompts through different setups. The notes compare naive chaining, which is easy and beginner friendly but slow and hard to maintain, with iterative agent processing, which keeps all inputs and outputs in a single node and scales better.

How to use it

Connect the start to any trigger, such as chat input, an external system or a CRON schedule, and add an Anthropic credential.

Requirements and limits

Cloud users must replace the placeholder webhook URL with their own n8n instance URL.

More in Other and the n8n workflow library.

Full text

Front matter
name: LLM Chaining examples
description: Triggered by a webhook. Connects HTTP request, Markdown, Split Out, Webhook. # Connect to one of the blue sections --> ## This can be anything: - Chat input - Trigger from external system - CRON-scheduled event # An array of prompts here ## Make sure URL matches ### ⚠️ Cloud users! Replace `{{ $env.WEBHOOK_URL }}` with your n8n instance URL # 1 - Naive Chaining ### PROs: - Easy to setup - Beginner-friendly ### CONs - Not scalable - Hard to maintain long chains - SLOOOW! # 2 - Iterative Agent Processing ### PROs: - Scalable - All inputs & outputs in a single node - Sup
category: Automation
kind: Workflow
software: HTTP request|Markdown|Split Out|Webhook

LLM Chaining examples

Triggered by a webhook. Connects HTTP request, Markdown, Split Out, Webhook. # Connect to one of the blue sections -->

This can be anything:

  • Chat input
  • Trigger from external system
  • CRON-scheduled event # An array of prompts here ## Make sure URL matches

⚠️ Cloud users!

Replace {{ $env.WEBHOOK_URL }} with your n8n instance URL # 1 - Naive Chaining

PROs:

  • Easy to setup
  • Beginner-friendly

CONs

  • Not scalable
  • Hard to maintain long chains
  • SLOOOW! # 2 - Iterative Agent Processing

PROs:

  • Scalable
  • All inputs & outputs in a single node
  • Sup

Steps

  • When clicking ‘Test workflow’ (manualTrigger)
  • HTTP Request (httpRequest)
  • Markdown (markdown)
  • Sticky Note (stickyNote)
  • Anthropic Chat Model (noOp)
  • Anthropic Chat Model1 (noOp)
  • Anthropic Chat Model2 (noOp)
  • Anthropic Chat Model3 (noOp)
  • Merge (merge)
  • Simple Memory (noOp)
  • Clean memory (noOp)
  • Initial prompts (set)
  • Split Out (splitOut)
  • Reshape (set)
  • Sticky Note1 (stickyNote)
  • Anthropic Chat Model4 (noOp)
  • Merge2 (merge)
  • Sticky Note2 (stickyNote)
  • Basic LLM Chain4 (noOp)
  • Split Out1 (splitOut)
  • Anthropic Chat Model5 (noOp)
  • Webhook (webhook)
  • CONNECT ME (noOp)
  • CONNECT ME1 (noOp)
  • CONNECT ME2 (noOp)
  • Sticky Note3 (stickyNote)
  • Sticky Note4 (stickyNote)
  • Sticky Note5 (stickyNote)
  • Sticky Note6 (stickyNote)
  • Initial prompts1 (set)
  • LLM Chain - Step 1 (noOp)
  • LLM Chain - Step 2 (noOp)
  • LLM Chain - Step 3 (noOp)
  • LLM Chain - Step 4 (noOp)
  • All LLM steps here - sequentially (noOp)
  • LLM steps - parallel (httpRequest)
  • Merge output with initial prompts (merge)
  • Merge output with initial prompts1 (merge)

Import

Download the JSON from the GitHub source and import it in n8n (Workflows, Import from file).

Source and license

Source: https://github.com/Zie619/n8n-workflows/blob/main/Splitout/0958_Splitout_Webhook_Automation_Webhook.md

Author: Zie619, n8n workflow collection. License: MIT.

Shown here with formatting for the web. Keep the author and license notice when you reuse it.

Related entries

There are more like this in the members library

The n8n workflow library holds 1,814 entries. Members can search all of them by meaning and read every one in full.