How to create AI workflows with N8N

by SkillAiNest

N8N is a visual, node -based automation platform that allows you to automate tasks with drag and drop nodes. It is famous for multi -phase automation and AI chains thanks to built -in nodes for agents and app integration.

In this tutorial, you will create a small personal calendar agent that listens to the chat message, extracts the event details, and produces Google Calendar entry. On the way, you will learn how to set N8N, add AI agent node, and pass structural data between nodes.

The table of content

  1. Provisions

  2. How to make a personal calendar agent

  3. Conclusion

Provisions

  • N8N Account – Setup Steps below.

  • Google Account – You will create events in the Google Calendar.

How to configure your N8N account

You can set up N8N on the cloud or locally.

Setting it on the cloud (the easiest option) L you, you can create a free trial account on it N8n website.

If you want to host yourself by NPM, you can install free N8n npm package And drive it to your local host (here are these Measures For it)

You can also host yourself Doctor And run the N8N image on your machine. How do I do it now?

First, download and install Doer desktop Application

The screenshot of the Dokar website that shows navigation links and buttons "Download Dokar Desktop" And "Learn about the Dokar for AI" Under the title "The development of agents".

Then click “Search photos” and select n8nio/n8n Picture:

The Dokar desktop interface is looking for "n8nio" Under the pictures. Several photos of the container are listed with download and star counting. The options are seen to be pulling and running the selected image.

Click run Set your local host port on the picture and options.

Showing a screenshot of the browser window "Set up the owner's account" Page for N8N, a workflow automation tool. Form requires email, first name, last name, and password.

Now you should be able to access N8N on your local host.

How to make a personal calendar agent

Now for the entertainment part! We are going to create a workflow that listens to chat message, uses an AI agent to understand the user’s request, and automatically creates a Google Calendar event. This easy workflows highlight N8N’s new AI capabilities.

An error of the steps that passed down here is:

  1. Add a chat node to send a message to the agent.

  2. AI agent to analyze the message and extract key details (title, location, times).

  3. Create a Google Calendar event with these details.

Step 1: Set up a chat trigger

Each work starts with the flu trigger. This is an event that kicks everything. Use a chat trigger that listens to new messages.

  1. Go to the dashboard https://.app.n8n.cloud/home/workflows And click Create Workflow.

  2. “Add the first step ..” Click and add On chat message As stimulating.

  3. In the Properties panel of the node, make it worth Make Chat Publicly Available (This will provide a URL that you can share with friends to book the program in your calendar).

N8n workflow where you click "On Chat Message" As a starting node

Step 2: Configure AI Agent

This is the “brain” of nodework flu. The AI ​​agent node can understand, make decisions, and make structural data. Each agent has 4 main modules: model, quick, tools and output.

1. Model setup

Click on + After the icon trigger node and add AI Agent Node. The AI ​​agent needs a model to strengthen its reasoning. Click the bottom + Chat Model And select OpenAI Chat Model Node.

Then select n8n free OpenAI API credits For now your certificate **. ** In the future, you can sign up on it Openi platform Go to the website and the “API Keys” section to create a new secret key

Click "AI agent" Select Node and Open AI Chat Model

2. Enable the date of date of date

A tool is an associated node that can call the agent during execution to perform the process (such as recovering data, formating dates, or running a code) instead of arguing in the text only. We will use the “Date Time” tool to convert the user reading date to the readable date Unix Time Stamp Before calling Google Calendar API.

These are the steps to enable this device:

  1. Click the + button below the AI ​​agent tool

  2. Find the date and time tool

  3. Set the operation Format a Date

  4. Select the date Defined automatically by the model (Allow the agent to pass the date itself)

  5. Select the format Unix Timestamp

  6. Change Output Field name unixTime

N8N Workflow where we click on the tool under AI Agent and select the Date Time Tool and select "Unix Time Stamp" For the format

3. Add the agent indication

An agent’s gesture is a combination of instructions and contexts that you give AI agents to explain its behavior, goals, and to interpret or respond to user inputs.

  1. Double -click on the AI ​​agent to edit the gesture.

  2. Select the Source for Indicator (User Message) Define below

  3. Copy the following indications in the quick (user message)

## Overview
You are an agent which helps parse the user message to identify the following details:
1. The title for the meeting
2. The location of the meeting
3. The meeting start and end Unix times.

Here is the User Message: {{ $json.chatInput }}

## Rules for event time identification:
- The current date time now is: {{ $now }}
- Resolve relative phrases like "tomorrow", "next Friday", "in 2 hours" relative to now.
- If duration given (e.g., "30 min" or "2 hours"), compute end_time from start_time.
- If only a start time given, default duration = 60 minutes.

## Getting event_start and event_end unix
- Use the "Date & Time" tool to convert the computed event start and end time to unixtime.

N8N Workflow Editor's user interface named a workflow "My workflow 2." The screen includes nodes "When Chat Message received," "AI agent," And the open chat model and history and time contact. The user is interacting with the interface, and there are different menu options on the left sidebar.

4. Sort the structural output

  1. Enable Require Specific Output Format Switch to AI agent

  2. Click + on the bottom of the output parsar and select Structured Output Parser

  3. Copy the following example JSON we want to remove from the user’s message

{
    "meeting_title": "Learn Geometry",
    "meeting_location": "Library",
    "event_start": 1759644763,
    "event_end": 1759644764
}

The screenshot of the AI ​​agent interface with the dialog box shows the parameters such as the user's message source and the option to activate the specific output format. The workpace also shows input and output parts that do not contain data.

Step 3: Add Google Calendar Node

The last step is to take structural data from the AI ​​agent and create a calendar event.

  1. Click on + AI agent node after the icon and search Google Calendar Node.

  2. Choose as a resource Event And as an operation Create

  3. Create new Outh2 certificates and sign in to your Google Account. You will be indicated to sign in Google and allow N8N.

Now, you are going to map a data from AI agent to fields in the Google Calendar Node. This is the place where magic is.

  1. Select like starting {{ DateTime.fromSeconds($json.output.event_start).toFormat("yyyy-MM-dd HH:mm:ss") }}

  2. As select the end {{ DateTime.fromSeconds($json.output.event_end).toFormat("yyyy-MM-dd HH:mm:ss") }}

  3. As the location select {{ $json.output.meeting_location }}

  4. Choose summary {{ $json.output.meeting_title }}

Workflow automation interface, using nodes for an AI agent, exhibition of chat messages integration, open AI chat model, date and time, and structure output parsar. Sidebar shows options for AI, app operations, data changes, and more. A safe button and trial information appear at the top. Add "Google Calendar" Make an event node

Step 4: Test time!

This is! Now you have AI -powered workflow that creates events in your calendar. You can activate your workflow by using the toggle in the upper part of the screen. Click “Chat” to start a chat conversation and send a message. You will see the whole workflow in action with each node’s input and output

You can also click on the Google Calendar Node to find htmlLink The column will provide a URL where you can see the event you create.

A workflow automation setup in N8N is showing a process where the chat message triggers AI agent, which interacts with an open chat model and a systematic output parsing to make the event. The interface includes various options such as adding projects, templates, and access to the admin panel.

Conclusion

In this tutorial, you have learned how to create a simple, AI-driving automation workflow in N8N’s visual interface. The real strength lies in meeting your own agent, prompt, and tools easily customized to meet your exact needs.

N8N’s ecosystem develops Community templatesAllow you to use thousands of pre -built solutions or divide your creations with the community. If this leader has helped you, try to expand the workflow yourself and find N8N documents for more nodes. Happy coding!

You may also like

Leave a Comment

At Skillainest, we believe the future belongs to those who embrace AI, upgrade their skills, and stay ahead of the curve.

Get latest news

Subscribe my Newsletter for new blog posts, tips & new photos. Let's stay updated!

@2025 Skillainest.Designed and Developed by Pro