If you have ever wished you could make ChatGPT or Claude do things automatically in the background—summarize emails, clean up data, draft replies, or write reports for you—n8n is one of the most powerful (and still beginner-friendly) ways to do it.

The problem is that your first AI workflow can feel overwhelming. Nodes, triggers, credentials, webhooks, agents… it is easy to open the n8n editor, stare at the empty canvas, and close the tab.

You do not need to. In this post, you will learn how to set up your very first AI-powered workflow in n8n, step by step. By the end, you will have a simple but real automation: you press a button, n8n sends a prompt to an AI model, and saves the answer somewhere useful. Think of it as going from “copy‑paste into ChatGPT” to “click once and let the machine handle it.”

What n8n Actually Does for AI (In Plain English)

n8n is a workflow automation platform: you connect apps and services together with a visual interface. Each node is like a Lego brick that does one small job—read an email, call an API, talk to an AI model, write to a spreadsheet—and a workflow is just a chain of these bricks.

For AI, n8n gives you:

  • Dedicated AI nodes (chat models, agents, text tools)
  • Native integrations with OpenAI, Google Gemini, Anthropic Claude, and others
  • The ability to mix AI steps with “boring but essential” steps like databases, CRMs, email, drive storage, and webhooks

The official n8n docs show a typical AI workflow as: trigger → data preparation → AI node → formatting/cleanup → sending or storing the result. Their introductory AI tutorial walks through exactly this chain, using an AI Agent and chat model to turn raw input into a shaped answer.

You are going to build the simplest version of that pattern.

Step 1: Choose How You Will Run n8n

You can run n8n in two main ways:

  • n8n Cloud: Hosted by n8n, with a free trial. You create an account and you are in the editor in a few minutes.
  • Self-hosted: Run n8n on your own server, Docker, or local machine. This gives you more control, especially if you are wiring in sensitive systems.

If you are just starting out and only care about learning AI workflows, it is much faster to use the hosted version. Recent beginner guides and tutorials, including n8n’s own Quickstart course, assume you are on n8n Cloud so you can focus on building workflows, not infrastructure. The official Quickstart is built exactly around that idea.

Later, if you hit limits or want everything under your own roof, you can move to self-hosting. There are fresh walkthroughs on doing this with Docker and basic Linux hosting that get you from nothing to a running editor in under an hour. TechRadar’s self-host how‑to is a good example.

For this article, assume you are using n8n Cloud:

  1. Sign up for n8n Cloud.
  2. Open the Workflow Editor (you will see a blank canvas).
  3. Click “New” → “Workflow” (or “Start from scratch”).

You are ready to build.

Step 2: Understand the 3 Core Pieces of an AI Workflow

Before dragging anything around, it helps to know the three pieces you are always looking for:

  1. Trigger – How the workflow starts. Examples:

    • A manual button (great for testing)
    • A webhook (trigger when something calls a URL)
    • A schedule (e.g., run every morning at 9)
    • An app event (new email, new row, etc.)
  2. AI Step – Where the “thinking” happens:

    • A Chat Model node (OpenAI GPT‑4o, Gemini, Claude, etc.)
    • An AI Agent node (n8n’s AI orchestration node that can call multiple tools) as shown in their official “Build your first AI agent” template. That template uses an AI Agent node plus a Gemini model node to route and respond.
  3. Output – Where the result goes:

    • Email, Slack, Telegram
    • Google Sheets, Notion, a database
    • A webhook response, or just the n8n UI while testing

Almost every AI workflow follows this pattern: Trigger → AI → Output. The fancier stuff you see online—multi‑step agents, retrieval, tools—is just more steps in the middle.

Step 3: Create a “Button‑Driven” AI Workflow

You will now build your first minimal workflow: click a button in n8n, send some text to an AI model, and see the answer.

3.1 Add a Manual Trigger

In the node picker, search for Manual Trigger and drop it on the canvas. This node lets you run the workflow on demand from inside the editor. It is perfect for learning because you can run, tweak, and run again instantly.

The Manual Trigger does not need configuration. Think of it as “Start here when I hit Execute.”

3.2 Connect an AI Chat Model

Next, add your AI node:

  1. Click the “+” button and search for:
    • “OpenAI” if you want to use GPT‑4o / ChatGPT’s API
    • “Gemini” for Google models
    • “Claude” if you have Anthropic access (there are native and community integrations)

The official n8n OpenAI integration exposes chat completion models and lets you plug in prompts and variables. The integrations page shows dozens of real workflows using GPT‑4o and related models inside n8n.

  1. Choose a Chat Model style node (for OpenAI, this is typically a Chat/LLM node).
  2. When the node opens, you will be asked for credentials:
    • In n8n, credentials are separate from nodes, so you can reuse them safely.
    • Paste your API key from OpenAI, Google AI Studio (for Gemini), or Anthropic.
  3. Select a model (e.g., “gpt‑4o”, “gpt‑4o‑mini”, a Gemini model, or a Claude model).

Now, connect the Manual Trigger → AI node.

3.3 Write a Simple Prompt

In the AI node’s fields, you will see something like “System prompt” or “Instruction” and a “User message” or similar.

For your first workflow, keep it very simple:

  • System / Instruction:
    “You are a helpful assistant that rewrites text in a clearer, more professional tone.”
  • User message:
    “Rewrite the following text in 3 bullet points: {{ $json.text }}”

The {{ $json.text }} part is an n8n expression. It pulls the text field from the incoming data. You will add that data in a moment.

If you do not want to deal with expressions yet, you can hardcode the text:

  • User message:
    “Rewrite the following in a friendlier tone: I am writing to inform you that your invoice is overdue and requires immediate payment.”

Run it once just to see that it works: click “Execute Workflow”. You should see the AI’s response in the AI node’s output.

Step 4: Give the Workflow Something to Work On

Right now, your AI is talking to itself. To make this useful, you want to pass in dynamic text—maybe something you type in, or content coming from another node.

For a first timer, there are two easy ways:

  1. Use the Manual Trigger’s input:

    • Add a node like “Set” between the Manual Trigger and the AI node.
    • In the Set node, create a field called text and paste any text you want the AI to rewrite.
    • Now the AI node can use {{ $json.text }}.
  2. Pull from Google Sheets, which is a very common beginner pattern:

    • Add a Google Sheets node after the Manual Trigger.
    • Configure credentials and point it at a sheet with a “Text” column.
    • Set it to read a specific row.
    • Map the “Text” column to the AI prompt (using expressions so your prompt references data from the Sheets node).

A recent step‑by‑step beginner guide demonstrates a very similar pattern: trigger → AI call via Ollama → clean the answer → save into Google Sheets as a simple content pipeline. That tutorial is a good example of how quickly you can turn a one‑off prompt into a repeatable workflow.

The key idea: the AI node does not care where the text comes from. As long as a previous node outputs data and you reference it with an expression, you are good.

Step 5: Decide Where the AI’s Answer Should Go

Seeing the AI output inside the editor is nice, but you probably want to use that result somewhere.

Some starter options:

  • Write to Google Sheets:

    • Add a new Google Sheets node after the AI node.
    • Use the “Append” or “Update” operation.
    • Map fields from the AI node’s output (like {{$json.choices[0].message.content}} or whatever the node exposes in its UI) to a “Result” column.
  • Send an email:

    • Add a Gmail or generic Email node.
    • Use the AI’s output as the email body.
    • Trigger this via schedule or webhook later.
  • Return it to another app via webhook:

    • Replace the Manual Trigger with a Webhook Trigger.
    • Return the AI answer as the HTTP response so a low‑code front‑end, Zapier, or Make scenario can call it.

This “Trigger → AI → Output” skeleton is the foundation for more advanced use cases: lead qualification, support replies, research assistants, and even multi‑agent systems. A mid‑2024 tutorial on AI workflow automation with n8n shows how this same pattern extends to sales, customer support, and content pipelines by just changing the trigger and output nodes. Their step‑by‑step guide is worth scanning once you are comfortable with the basics.

Step 6: Level Up with AI Agents and Multiple Models

Once a simple chat-model step feels comfortable, you can explore AI Agents in n8n. Agents are like mini coordinators: instead of just responding to a prompt, they can decide which tools to call—like search, a database, or other workflows—before answering.

The official “Build your first AI agent” template from n8n shows:

  • An AI Agent node as the brain
  • A connected chat model node (e.g., Gemini)
  • Several tools the agent can invoke
  • A simple UI so you can chat with the agent from n8n’s front-end

You can import and inspect that template directly from n8n’s workflow gallery. The template page explains how the AI Agent node routes requests and chooses tools, so you do not have to guess how the orchestration works.

At this stage you can also:

  • Compare OpenAI, Claude, and Gemini in parallel by dropping three chat nodes in a row and seeing how each model answers the same prompt.
  • Use other tools (ChatGPT, Claude, or Gemini in their own UIs) to help you design prompts and data structures for your n8n workflows.
  • Let an external coding assistant (e.g., Claude Code or Cursor) help you craft complex expressions or custom functions inside n8n when you are ready.

Step 7: Make Your Workflow Feel “Real”

A lot of people stop at “it works in the editor,” but a real automation does three extra things:

  1. Error handling: Add simple checks—e.g., if the AI output is empty or the API fails, send yourself a Slack notification instead of silently breaking.
  2. Logging: Store the original input, the AI’s response, and maybe a timestamp in a sheet or database. This is crucial if you are using AI for customer‑facing content.
  3. Guardrails: Keep prompts stable, set maximum lengths, and be clear about the tone and format you expect. n8n’s AI docs emphasize shaping instructions and output format so the AI’s answers plug cleanly into the rest of your workflow.

Once these are in place, you can activate the workflow so it runs automatically and starts saving you time instead of just being a cool demo.

Bringing It All Together

Your first AI workflow in n8n does not need to be fancy. If you understand:

  • Triggers (how it starts)
  • AI nodes (where the model thinks)
  • Outputs (where the answer goes)

…you already have 80% of what you need to build serious automations.

To move from reading to doing, here are three concrete next steps:

  1. In n8n Cloud, create a new workflow with a Manual Trigger and a single Chat Model node (OpenAI or Gemini) and get a “rewrite this text” example working end to end.
  2. Replace the hardcoded text with data from a Google Sheets node, then save the AI’s output back into another column so you have a mini “AI content cleaner” pipeline.
  3. Import n8n’s “Build your first AI agent” workflow from their gallery and study how the AI Agent node connects to tools; then adapt it to a simple use case in your own work, like summarizing support tickets or generating daily summaries.

Once you have those three under your belt, you are no longer just “using AI” — you are running your own AI workflows. And from there, scaling up to multi‑step automations, customer‑facing agents, and complex business logic is just a matter of stacking more of the same Lego bricks.