Privacy choices

Optional Google Analytics and advertising are off until you choose. Read our privacy details.

Run n8n Locally and Summarise Text With the Claude API

Install n8n from npm, keep it on loopback, and run a Claude summariser on a tiny invented paragraph

n8n workflow editor with a Claude summariser workflow
FIELD GUIDE · AUTOMATION · MAY 6, 2026

n8n runs on your computer. When you click Execute, the workflow sends your example paragraph to Anthropic's API and shows the summary in your local editor. You'll try that once with invented text. You can then put the same workflow on a schedule.

Two things are out of scope on purpose: public webhook recipes and anything that exposes n8n to other devices. Nothing below needs an inbound URL.

What you'll build

n8n installed from npm on a machine you control, reachable only from that same machine, with a small workflow: a fixed example paragraph goes into a Basic LLM Chain, which uses the Anthropic Chat Model to write a three-bullet summary. Roughly 30 minutes.

n8n editor with a Claude summariser workflow Caption: the n8n workflow editor with a Claude-backed summariser.

Prerequisites

  • A computer you control, with a terminal and a browser on the same machine
  • Node.js 20.19 through 24.x inclusive, plus npm. This is the supported range in the n8n npm install docs, checked on 24 November 2026. Run node --version first.
  • An Anthropic API key on a Console (platform) account with credit. This is direct, pay-per-token API billing. See the billing section below.

Step 1, install n8n via npm

npm install n8n -g
n8n --version

n8n install output

If npm complains about permissions, fix your npm global prefix rather than reaching for sudo. Find the binary with command -v n8n. By default n8n keeps its data in ~/.n8n/: workflows, credentials and a SQLite database. Remember that folder, because it matters again in Step 5.

Step 2, start n8n on loopback only

Here is the catch that trips people up. Opening http://localhost:5678 in your browser does not mean n8n is listening only on loopback. The URL is just what you typed. What the server binds to is a separate setting, N8N_LISTEN_ADDRESS, and its documented default in the n8n deployment environment variables is ::, which is every interface, not just your own machine.

So pin it explicitly:

N8N_LISTEN_ADDRESS=127.0.0.1 n8n start

n8n first launch

Then open http://localhost:5678. The first launch asks you to create an owner account. Use a strong password.

Confirm the bind from a second terminal:

ss -ltn | grep 5678

You want to see 127.0.0.1:5678. If you see *:5678 or [::]:5678, stop n8n and recheck how you launched it. Don't switch off n8n's secure-cookie or login settings to silence a browser warning; go back to the localhost URL instead.

Step 3, add the Anthropic credential

In n8n go to Credentials, create an Anthropic credential, and paste your API key into that form. The key goes there and nowhere else: not into workflow JSON, not into a screenshot, not into a chat or a git repo. This page has no screenshot of that form for exactly that reason.

n8n stores credentials encrypted inside ~/.n8n/, and the encryption key lives in that same folder. If you back it up, treat the whole thing as secret, and keep the key with the database or restored credentials won't decrypt.

Step 4, build the manual summariser

Create a new workflow with these nodes:

  1. Manual Trigger

  2. Edit Fields (Set), one string field named text, with this invented paragraph:

    The Maplewood Community Garden opens for the season on the first Saturday of April. Volunteers will repair the raised beds, mix compost, and label the herb rows. Plots are shared, tools are kept in the blue shed, and a short orientation is held at 10 a.m. for anyone new. Seedlings left over from the spring sale will be given away at the gate.
    
  3. Basic LLM Chain, with an Anthropic Chat Model attached to its model input

Basic LLM Chain settings:

Prompt (user message): "{{ $json.text }}"
Chat message (system): "Summarise the text in three bullets. English only, no fluff."

Anthropic Chat Model: pick a model from the dropdown the node offers. For plain summarising, a smaller, cheaper model is usually enough. If you ever import a template, open every model node and check which model it picked, because some templates default to a large and expensive one.

n8n workflow canvas with a model node

Click Execute workflow. The three bullets show up in the Basic LLM Chain output panel. Every test run is a real API call and is billed.

The sample is deliberately invented and public-safe. Keep it that way while you learn the tool: no real emails, customer text or private documents until you have decided where that data is allowed to go.

Optional: put it on a schedule

Add a Schedule Trigger, connect it to Edit Fields as well, and set a daily interval and the workflow time zone. Save and publish the workflow so the trigger runs automatically. n8n's Schedule Trigger guide

Be honest about what that gives you:

  • A schedule only fires while n8n is running. A laptop that is asleep or switched off cannot execute a timed job. Don't expect a missed run to be replayed when it wakes up; if a run matters, treat it as lost.

  • n8n start in a terminal dies with the terminal. For a schedule you need an always-on process that restarts after a reboot, which means a service manager. Here is a systemd unit as a starting point, with the placeholders replaced from your own machine:

    [Unit]
    Description=n8n (local only)
    After=network.target
    
    [Service]
    Type=simple
    User=YOUR_USER
    Environment="N8N_LISTEN_ADDRESS=127.0.0.1"
    Environment="N8N_PORT=5678"
    ExecStart=/FULL/PATH/FROM/command-v/n8n start
    Restart=on-failure
    
    [Install]
    WantedBy=multi-user.target
    
    sudo systemctl daemon-reload
    sudo systemctl enable --now n8n
    

    Notice there is no WEBHOOK_URL and no 0.0.0.0. If your Node comes from nvm, the unit needs that environment's paths, so check what command -v n8n and command -v node print.

  • Reboot recovery needs two things: a service that comes back on its own, and the saved data in ~/.n8n/ still being there. Lose the folder and you lose the workflow, the credential and the encryption key together.

  • Execution history grows. n8n keeps past runs, and an unpruned SQLite file keeps getting bigger. On one small box mine grew to several hundred MB after a month of frequent runs before I turned pruning on. Look up the current names and units of the execution-pruning environment variables (EXECUTIONS_DATA_PRUNE and EXECUTIONS_DATA_MAX_AGE are the ones to look for) in n8n's environment variable docs. Pruned runs are really gone, so keep the age long enough to debug with.

If you want timed runs without leaving a machine on, that is a different product choice (hosted n8n, or Claude Code's own scheduling). The Claude Code scheduled tasks docs are clear about the difference between session-scoped prompts and cloud routines.

What it costs: one small example

Running n8n on your own machine does not change what the Anthropic API charges. A direct API call costs the same whether n8n runs on your desk or in a hosted service. The per-token prices, which do change, are on the Anthropic pricing page.

Billing line to be clear on: a Claude subscription's included usage is not what a direct model node spends. Per the Claude Code authentication docs, signed-in eligible Pro, Max or Ultra use draws on the subscription, while an API key uses a Console account and direct model nodes use the platform account. Don't assume plan credit covers a separate account.

Assumed prices, for arithmetic only: $3 per million input tokens and $15 per million output tokens. Check the pricing page for your chosen model before you rely on any of this.

Assumed run: about 400 input tokens (the paragraph plus the instruction) and about 100 output tokens (three bullets).

cost per run = (400 x 3 + 100 x 15) / 1,000,000
             = (1,200 + 1,500) / 1,000,000
             = $0.0027   (about a quarter of a cent)

30 daily scheduled runs = 30 x $0.0027 = $0.081   (about 8 cents)

Those token counts are estimates. Measure actual input and output tokens in the Anthropic Console and redo the sum with your model's prices. Include tokens processed during tests and retries when you budget.

Item Cost
n8n on your own machine Governed by the n8n licence; see below
Anthropic API Per token, at the current pricing page
Electricity for an always-on box Whatever your own bill says

When NOT to use this

  • Your workflows change daily and a hosted tool's polish is worth more to you than the setup effort.
  • You don't have an always-on machine and you need the schedule to actually fire.
  • You want to trigger things from outside the machine. That needs a deliberate security design that this guide doesn't cover.

If you drive automations from a terminal agent rather than a visual canvas, the equivalent move is to build a custom MCP server in Python, so Claude Code can trigger the same actions as typed tools. For the Claude side of things generally, the Claude playbook is the maintained reference.

Licence note

For commercial use, check how the terms apply to your workflow in n8n's licence.

Filed under