Memuat
Memuat
Want to go deeper?
Join one of our courses or ask us directly on WhatsApp.
Picked from the software, topic, and level of “Claude from Zero to Expert Class #93: Connecting Claude to n8n”.
Other ways we can help with Claude.
Learn with a mentor
Scheduled AI & Machine Learning courses with live guidance and a certificate.

Midjourney Course: Create Stunning AI Images from Text
★ 4.9

DALL-E Course: Creating Professional AI Images from Text
★ 4.9

Stable Diffusion Course: AI Art from Beginner to Professional
★ 4.9
Have it built for you
No time to learn Claude? Our team can do the project for you.

AI Image Creation with Stable Diffusion — Unlimited Custom Visual Production
★ 4.9

AI Image & Video Creation with Leonardo AI — All-in-One Visuals for Business
★ 4.9

AI Image Creation with Midjourney — Cinematic AI Art for Business
★ 4.9
Get notified about new Claude classes
At most one email a week. Unfollow anytime with one click.
The full narration of this video. The current sentence is highlighted while the video plays; click any sentence to jump there.
Hi, and welcome back. The Sunset Coffee bot can answer questions now, but it stops when Raka turns off his laptop. Today we connect Claude to n8n, an automation tool that keeps running, and build a flow that sorts customer reviews automatically.
There are two ways to use the Claude API. The first is code written by Claude Code, in the form of program files in a project folder. The second is an n8n flow, made of boxes called nodes that are connected to each other. Your own code runs on a laptop or server that you have to look after. An n8n flow keeps running on the n8n server, whether that's the cloud version or one you host yourself. To change code, we ask Claude Code. To change an n8n flow, we just click a node and edit its fields. Your own code suits custom logic or your own interface. n8n is best for connecting many apps, such as forms, Google Sheets, and Telegram. One doesn't rule out the other. Today we use both: n8n for the flow, and Claude Code to prepare the prompt and the test data. Before we start, prepare three things. First, an n8n account. It can be the cloud version you simply sign up for, or a version you install on your own server. Check n8n's official site for the options and costs. Second, a Claude API key. You can create a separate key just for n8n, so that if you ever need to revoke it, the Telegram bot keeps working. Third, an empty Google Sheet with columns for date, name, sentiment, and summary. This is where the review recap will collect. The habit of one key per purpose also makes it easier to track usage. In the console, we can see how much n8n costs and how much the bot costs.
Every week Sunset Coffee receives dozens of reviews through a form. Laras doesn't have time to read them all. The first step of our flow: a review arrives from the form. Second, Claude rates the review's sentiment, positive, neutral, or negative, then sums it up in one sentence. Third, the result is logged in Google Sheets, so Laras has a tidy recap every week. Fourth, the flow checks: is this review negative? Fifth, if it is, Telegram alerts Laras right away so she can contact the customer quickly. Positive reviews are simply logged.
Raka opens n8n and creates a new workflow called Sunset Coffee Reviews. The first node is the trigger: the review form. Every time the form is submitted, the flow runs. The second node is Claude. Depending on your n8n version, you can use the built-in Claude model node or an HTTP Request node that calls the API directly. They do the same job. The third node, Google Sheets, adds one row with the review and Claude's rating. The fourth node is called If. It checks whether the sentiment is negative. The fifth node, Telegram, only runs when the answer is yes, marked by the true label on its connecting line. Now click the Claude node to fill in its settings. The panel on the right has five fields. Field one, the credential. The API key goes into n8n's credentials menu once, then you simply pick it from a list. The key is never written in the prompt text, so it stays safe even if the workflow is shared with a coworker. Field two, the model. Pick from the available list and check the official documentation for a suitable model. For sorting reviews, a lighter model is usually enough. Field three, the prompt. The purple part in curly braces is an expression: it's automatically replaced with the review text from the form. Field four is the most important: the answer format. We ask Claude to answer in JSON with a sentiment, a summary, and a suggested reply. A fixed format like this lets the Sheets and If nodes read the result. Field five, an answer limit of two hundred tokens. A one-sentence summary doesn't need more, and this limit keeps costs low.
A prompt that produces a fixed format needs careful design. Raka asks Claude Code for help in a new folder: write a prompt to sort reviews, plus ten test reviews. Claude Code writes the prompt file, complete with two sample answers. Examples like these help Claude answer in the same shape every time. It also creates a CSV file with ten test reviews under made-up names. Remember, never use real customer data for testing. Claude Code explains why: the prompt asks for JSON only, with no opening sentence. If Claude writes a lead-in like sure, here's the result, the If node in n8n may fail to read it. Here's part of the test data, moved into Google Sheets. The expected column holds the answer we hope to get. First, Putri praises the taste and the delivery: we expect positive. Joko complains that the cold brew spilled because the packaging leaked: we expect negative, and Laras must be alerted. Sari writes a mixed review: the taste is fine, but she waited forty minutes. Cases like this test whether Claude is careful enough. Andi uses slang. Claude still needs to understand that this is praise. Budi submits an empty form. A good flow should stay calm when it meets odd data, not stop with an error.
Time to test. Raka submits Joko's review through the form, then clicks Execute workflow. Every node turns green, which means each step succeeded. Claude rates Joko's review as negative, Sheets logs it, and the If node passes it on to Telegram. Raka repeats this for all ten test reviews and compares the results with the expected column. Budi's empty review caused an error, so he asks Claude Code to add a rule: skip empty reviews. Once everything passes, Raka clicks the Active toggle. From now on the flow runs on its own every time a review arrives, even with his laptop turned off. Meanwhile, the Google Sheet fills up neatly. In the first row, Putri's review is rated positive, with a one-sentence summary. In the second row, Joko's review is rated negative. This is the row that also goes to Laras on Telegram. In the third row, Sari's mixed review is rated neutral. Raka thinks that's fair, but Laras could decide that complaints about waiting time count as negative. That rule can simply be added to the prompt. In the fourth row, Andi's slang review is understood as praise. Casual language is no problem for Claude. At the end of the month, Laras just filters the sentiment column to see which complaints come up most often. Data that used to be scattered is now material for improving the business. This is what Laras receives on Telegram. Only negative reviews are sent, each with a one-sentence summary, so she isn't flooded with notifications. Claude also includes a suggested reply. Notice the note at the end: it needs Laras's approval. A free resend is a business decision, so Laras decides, not Claude. The n8n screens in this video are simulations, and node names may differ slightly depending on your version. The pattern stays the same: trigger, Claude with a fixed format, log, check, then alert a person.
Claude now works inside an n8n flow that keeps running. The key is stored in credentials, the prompt asks for a fixed format, the test data uses made-up names, and important decisions stay in Laras's hands. This flow runs for every review, and every call to Claude has a cost. In the next episode we calculate costs and tokens, and learn how to save. See you there!
Try these on your own after watching to lock in what you learned.
Type a question or keyword; we find the part of this episode that explains it and jump the video there.
Notes are saved with the current video time and are only visible to you.
Stuck on a step? Ask here; the instructor and other learners can answer.
No questions yet.

Cerdas Inovasi Digital Team
Software developers, BIM & 3D engineers, and AI practitioners
We build software, BIM models, games and AI automations for clients every day, and turn that hands-on work into step-by-step classes: every step is shown on screen and comes with a PDF guide you can keep.
See our clients →