สอน n8n พื้นฐาน ฉบับจัดเต็ม | เหมาะสำหรับมือใหม่ เชื่อม Gmail, Sheet, AI และ Image gen ง่ายนิดเดียว!
Table of Contents
Introduction
This tutorial provides a comprehensive guide for beginners looking to use n8n, a powerful open-source automation tool. You will learn how to connect various services like Gmail and Google Sheets, utilize AI commands, and generate images using APIs. By following these instructions, you can create your own automation workflows without needing extensive coding knowledge.
Step 1: Overview of n8n
- Understand what n8n is: An open-source tool for automating tasks by connecting different applications and services.
- Familiarize yourself with key concepts:
- Workflow: A series of connected tasks that automate a process.
- Trigger: An event that starts a workflow.
- Node: Individual tasks within a workflow.
Step 2: Installation of n8n
-
Install Docker Desktop
- Visit the Docker website: Docker Desktop
- Follow the installation instructions for your operating system (Windows, macOS, or Linux).
-
Set Up n8n
- Once Docker is installed, open your terminal.
- Run the following command to start n8n:
docker run -it --rm \ -p 5678:5678 \ n8n n8n start
- Access n8n by navigating to
http://localhost:5678
in your web browser.
Step 3: Create Your First Workflow
-
Start a New Workflow
- Click on the “New” button to create a new workflow.
-
Add a Trigger Node
- Search for and select a trigger node (e.g., Webhook, Cron, etc.) based on your needs.
-
Configure the Trigger
- Set up the necessary parameters for your chosen trigger to specify when the workflow should start.
-
Add Action Nodes
- For example, to connect Gmail:
- Search for the Gmail node.
- Connect the trigger to the Gmail node and configure it with your Gmail account details.
- For example, to connect Gmail:
-
Save and Activate the Workflow
- Click on the save button and then activate the workflow to start the automation.
Step 4: Create a Second Workflow
-
Follow Similar Steps as Above
- Create another new workflow focusing on Google Sheets or another application.
-
Add Nodes for Data Management
- Use nodes to read, write, or update data in Google Sheets. Make sure to set the required permissions.
-
Test the Workflow
- Run the workflow to ensure it performs the intended actions correctly.
Step 5: Create a Third Workflow with AI Integration
-
Add AI Node
- Explore options to send requests to AI services such as Ollama.
- Configure the node with the API endpoint and any necessary parameters.
-
Connect to an Image Generation API
- Add a node to handle image generation based on text inputs.
- Set up API credentials and required fields for the image generation service.
-
Run and Validate the Workflow
- Test the entire workflow from start to finish to confirm that it works as expected.
Conclusion
By following these steps, you have successfully set up and created multiple workflows using n8n. You have learned how to connect Gmail, manage data in Google Sheets, and integrate AI functionality. For further learning, consider exploring advanced features in n8n or joining the community for support and ideas. Start automating your tasks today!