Build your first automation without writing a line of code
The full method for automating a repetitive task with n8n and Claude Code, even if you are not a developer.
Most repetitive tasks in a company fit into one sentence: "every week, someone opens emails, copies figures into a spreadsheet, and sends out a summary." That is exactly the kind of thing you can automate in an afternoon, even without being a developer.
Here is the full method, with a concrete case: receiving weekly revenue PDFs by email, extracting the data, and filling a Google Sheet automatically.
The principle
Two tools are enough:
- n8n, a visual automation platform. You build "workflows" in it: read an email, extract a PDF, write to a spreadsheet, send an alert.
- Claude Code, which writes the workflow for you from a description in plain language.
You do not code. You describe what you want, you get a file, you import it. That is all.
1. Install n8n for free on your own machine
n8n exists as a paid hosted version, but also as a free version you run on your own computer. That is what self-hosting means.
The term scares people for no good reason. Self-hosting does not mean "I have to be a developer", nor "I am putting something on the internet". It is like installing Word or Spotify: the application runs on your computer, full stop. It is free, and your data never leaves your machine.
The simplest route is to ask Claude: "Help me install n8n self-hosted on Mac (or Windows). I am a complete beginner." It walks you through it, one command at a time.
2. Set up your workspace
Download Visual Studio Code, a free text editor. Create a folder on your desktop, for example automation-revenue-v1, and open it in VS Code through File → Open Folder.
Remember this simple rule: one project = one folder. Keep that logic for every automation you build. It will save you from hunting for your files six months from now.
3. Connect Claude Code
Claude Code is an extension that lets you talk to Claude directly inside VS Code, with access to your project folder.
- Click the Extensions icon in the left sidebar
- Search for "Claude Code"
- Install the Anthropic extension
- Click the Claude icon that appears in the sidebar
- Sign in with your account
The chat opens inside the editor. That is where everything happens.
4. Describe your automation, step by step
This is the heart of the method, and where most people get it wrong. Do not describe your need in one vague paragraph. Number the steps, in order, with the expected formats.
Here is an example that works:
I want an n8n automation that does this:
1. Every week, read the emails whose subject contains
"Revenue Week [number] - [Month Year]" and collect
the attached PDFs (Gmail connection from n8n).
2. Extract from each PDF:
- Client name → column A
- Revenue → column B (number with no symbol, e.g. 12500)
- Comment → column C (free text)
3. Fill my Google Sheet, ID: [your sheet ID]
Generate the JSON file to import into n8n.
The numbered-step format genuinely changes the quality of the result. Sequential, explicit instructions produce a cleaner workflow than a request written in prose. Always specify the exact name of your columns and the data format: "number with no symbol", "date as DD/MM/YYYY". Every ambiguity you leave behind is a badly filled row later on.
5. Import the file into n8n
Claude generates a .json file describing your workflow. To install it:
- Open n8n in your browser (local address, usually
http://localhost:5678) - Click "Create workflow", the orange button at the top right
- Click the three dots "···" at the top right
- Select "Import from file..."
- Choose the generated
.jsonfile
The workflow appears as boxes connected to one another. You finally see what you described.
6. Test without risking your real data
Golden rule: never test on your real spreadsheet. Duplicate it, and connect the copy to n8n for the duration of your trials.
This is also the moment when you enter your connection credentials (Gmail, Google Sheets) in the "Credentials" section of n8n. If you do not know where to find a given access key, ask Claude, service by service.
7. Backfill: handling the history
Once the weekly automation is in place, you will want to fill the spreadsheet with the older files. Ask for a separate automation, one that reads a folder (Google Drive or local) and processes everything in one pass.
This is often the longest step to configure, because n8n needs access to your files. Allow 30 to 60 minutes. But it is a one-off operation: you run it, you check it, you are done.
8. Get notified when it works, and when it breaks
A silent automation is a dangerous automation. Add a Slack node at the end of the workflow:
Add a Slack node to my n8n workflow:
- On success → #automations channel: "Revenue processed: X rows added"
- On error → #alerts channel: "Revenue workflow error: [error detail]"
You will need to create a Slack app and get a token. Five minutes, with Claude guiding you.
9. Add a layer of analysis
Once the data is extracted, you can ask for an analysis inside the workflow itself. In our example: instead of getting "14 rows added", getting "three clients are down more than 20%, here they are".
Add an HTTP Request node after the extraction. Four settings, in this order.
Method: POST
URL: https://api.anthropic.com/v1/messages
Headers: three lines, all three required. The second one is the one people forget, and without it the request is rejected.
| Name | Value |
|---|---|
x-api-key |
your key |
anthropic-version |
2023-06-01 |
content-type |
application/json |
Body: pick the JSON mode, then paste this. The shape is fixed: your question goes in content, nowhere else.
{
"model": "claude-opus-5",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Here are the figures extracted from the PDF:\n\n{{ $json.text }}\n\nIn three sentences: which clients are down compared with last month, and by how much?"
}
]
}
{{ $json.text }} is the n8n syntax for reusing a value from the previous node. Replace text with the actual field name coming out of your extraction.
Getting the answer back. It does not arrive as plain text. The next node reads it from {{ $json.content[0].text }}, and that is what you wire into your Slack or your spreadsheet.
The key. Create it at console.anthropic.com, under API Keys. It is a separate account from your Claude subscription, billed by usage. Store it in n8n's Credentials, never in plain text inside the workflow. That is the kind of detail that costs you dearly when you forget it.
What it costs. Billing is per token, a unit worth roughly four characters, counted separately on the way in and on the way out. For Claude Opus 5, the model in the example: $5 per million tokens sent, $25 per million received. On a one-page report, an analysis costs two or three cents. Current rates are at anthropic.com/pricing.
What you have gained
A weekly manual task becomes an automated one, built from instructions written in plain language, without a single line of code typed by hand.
The real lesson is not technical: it is learning to break a need down into explicit steps. Once you know how to do that, the automation platform becomes an implementation detail.
- automation
- n8n
- no-code
- ai
- productivity
