AI

AI

AI

How to Build Your First AI Workflow with n8n in 10 Minutes (Beginner's Guide)

July 8, 2025

How to Build Your First AI Workflow with n8n in 10 Minutes
How to Build Your First AI Workflow with n8n in 10 Minutes
How to Build Your First AI Workflow with n8n in 10 Minutes

Have you ever wanted to make a computer do smart things automatically, like summarize text or answer questions, but felt lost with complex code?

This guide is for you!

We'll show you how to build your very first AI workflow using n8n, a fantastic automation platform, in just about 10 minutes. No coding needed for this start, just simple clicks and clear instructions.

Let's get your AI automation journey started!

What is an AI Workflow? Understanding AI Automation Basics

Before we build, let's quickly understand what an AI workflow means. Imagine a simple chain of actions:

  1. Something happens (like you getting a new piece of text).

  2. An Artificial Intelligence (AI) tool then does something smart with that text (like summarizing it).

  3. Based on what the AI did, something else happens automatically (like sending the summary to you).

This entire automated chain, from start to finish, is an AI workflow. We're making computers work smarter, for you, automatically!

Getting Started with n8n: Your Workflow Automation Platform

To build your first AI workflow, you need n8n. Think of n8n as a digital whiteboard where you connect different pieces of software and AI tools together. It's a no-code automation tool that makes building AI automations visual and easy.

Choose Your n8n Setup: Cloud or Self-Hosted n8n

For this 10-minute AI workflow guide, the easiest way to start is with n8n Cloud. This means n8n handles all the technical setup for you.

  • n8n Cloud: Simply sign up at n8n.io/cloud. You'll get instant access to your n8n workspace. This is the fastest way to build AI workflows without any installation.

  • Self-Hosted n8n: If you're more technically inclined, you can also install n8n on your own computer or server using Docker. For this quick guide, n8n Cloud is recommended.

Once you have access to your n8n workspace, you're ready for the next step.

Secure Your AI Access: Setting Up AI Credentials (OpenAI Example)

To let n8n talk to an AI tool like OpenAI (which powers ChatGPT), you need a special key. Think of this key as a password that proves you have permission to use the AI service. In n8n, these are called credentials.

How to Get Your OpenAI API Key

  1. Go to platform.openai.com.

  2. Log in or create an account.

  3. Look for "API keys" (usually under your profile or settings).

  4. Click "Create new secret key."

  5. Important: Copy this key immediately! OpenAI shows it only once. If you lose it, you'll need a new one.

Add Your OpenAI Credential in n8n

  1. In your n8n workspace, look at the left sidebar. Find "Credentials" (it often looks like a key icon). Click it.

  2. Click the "+ Create New Credential" button.

  3. In the search box, type "OpenAI" and select it.

  4. A small form will appear. Paste the OpenAI API key you just copied into the field labeled "API Key."

  5. Give your credential a simple name, like "My OpenAI Key."

  6. Click "Save." n8n will securely store this key. Now, n8n can securely use OpenAI for your AI workflows!

Build Your First AI Workflow: Text Summarization Automation

Our goal for this first AI workflow is simple: we'll give n8n some text, it will send that text to OpenAI for summarization, and then show you the summary. This is a core AI automation basic.

Step 1: Start Your AI Workflow - The Start Node

Every n8n workflow begins with a "trigger" – something that tells the workflow to start. For our first AI workflow, we'll use a simple "Start" node.

  1. In your n8n workspace, you'll see a blank canvas.

  2. Find the Start node (it's usually there by default, or you can search for "Start" and drag it onto the canvas).

  3. This Start node is your workflow trigger.

Step 2: Provide Input Text - The Set Node

We need to give our AI workflow the text we want summarized. We'll use a "Set" node for this.

  1. Click the + button next to the Start node on the canvas.

  2. In the search box that appears, type "Set" and select the Set node. Connect it to the Start node.

  3. Click on the Set node to open its settings on the right side.

  4. Under "Values," click "Add Value."

    • For "Value Name," type textToSummarize.

    • For "Value," paste a short paragraph of text you want to summarize. For example: "Artificial intelligence (AI) is intelligence—perceivable by humans—exhibited by machines or software. It is also the study of the field of inquiry that studies the behavior of, and designs, such intelligent agents. AI research is highly technical and specialized, deeply divided into sub-fields that often fail to communicate with each other."

  5. This Set node now holds the text your AI will process.

Step 3: Connect to AI - The OpenAI Node

This is where the AI magic happens! We'll use the OpenAI node to send our text for summarization.

  1. Click the + button next to your Set node.

  2. Search for "OpenAI" and select the OpenAI node. Connect it to the Set node.

  3. Click on the OpenAI node to open its settings.

  4. Under "Credentials," select "My OpenAI Key" (or whatever you named your credential). This tells n8n how to securely talk to OpenAI.

  5. Under "Resource," choose Chat.

  6. Under "Model," select gpt-3.5-turbo. This is a common AI model from OpenAI.

  7. Now, the most important part: the AI instructions (called "messages" or "prompts"). Click "Add Message" twice:

    • Message 1:

      • "Role": system

      • "Content": You are a helpful assistant that summarizes text concisely. (This tells the AIits job.)

    • Message 2:

      • "Role": user

      • "Content": Please summarize the following text: {{ $node["Set"].json.textToSummarize }}

      • Understanding {{ }}: This special {{ }} is an "expression." It tells n8n to take the content from our textToSummarize value (which we set in the previous Set node) and put it right here into the AI's prompt. This is how n8n makes your AI workflows dynamic.

Step 4: See the Summary - The Respond to Webhook Node

To see the result of our AI workflow immediately, we'll use a "Respond to Webhook" node. This will show the summary in your web browser.

  1. Click the + button next to your OpenAI node.

  2. Search for "Respond to Webhook" and select it. Connect it to the OpenAI node.

  3. Click on the Respond to Webhook node.

  4. Under "Body," click "Add Expression."

  5. You need to tell n8n exactly where the summary is in the OpenAI node's output. Select {{ $node["OpenAI"].json.choices[0].message.content }}. This expression points directly to the summarized text generated by the AI model.

Run Your First AI Workflow! Automate with AI Now!

You've built your first AI workflow! Now, let's run it.

  1. Save Your Workflow: Click the "Save" button in the top right corner of your n8n workspace. Give it a name like "My First AI Summarizer."

  2. Activate Your Workflow: Click the "Active" toggle switch in the top right corner, next to the "Save" button. This makes your workflow ready to run.

  3. Copy the Webhook URL: Click on the Webhook node (our very first node). In its settings on the right, you'll see a "Webhook URL." Click the "Copy" button next to it.

  4. Trigger Your Workflow: Open a new tab in your web browser. Paste the copied "Webhook URL" into the address bar.

  5. Press Enter!

What you should see:

  • In your web browser, after a moment, you should see the AI-generated summary of the text you provided.

  • In your n8n workspace, you'll see the nodes light up as the workflow executes, showing the data flowing through each step. You can even click on the nodes after execution to inspect the exact input and output at each stage – a great way to understand workflow automation.

Congratulations! You've successfully built and run your first AI workflow with n8n. You've mastered the basics of AI automation, connected to an AI model, and automated a smart task. This simple setup is the foundation for much more complex and powerful AI automations you can build with n8n.

Want to read more about n8n?

https://community.n8n.io

Passionfruit guides:

Generative Engine Optimisation Guide (GEO) for ChatGPT, Perplexity, Gemini, Claude, Copilot

Can ChatGPT Replace Google Search? ChatGPT vs Google Search




Read More
Read More

The latest handpicked blog articles

Grow with Passion.

Create a systematic, data backed, AI ready growth engine.

Grow with Passion.

Create a systematic, data backed, AI ready growth engine.

Grow with Passion.

Create a systematic, data backed, AI ready growth engine.