Runoob Tutorial ArchiveEnglish

AI workflow automation

AI workflow automation

Everyone has probably experienced this:

These repetitive tasks consume a lot of your time, but they actually don't require much thinking.

AI workflow automation is the solution to these kinds of problems: entrusting repetitive tasks with clear rules to AI to complete automatically.

The core goal of workflow automation is:To free up your time from execution and dedicate it to decision-making..


What is an AI workflow?

An AI workflow is connecting multiple AI capabilities and tools to form an automated process.

Simply put, when an event occurs, a series of operations is triggered, and AI performs understanding, judgment, and generation in the middle.

The concept of workflow automation

A typical workflow consists of three parts:

Components Function Common examples
Trigger When it starts executing Receiving a new email, scheduled time, someone submits a form
Action What operation to perform Send messages, save data, generate content
Condition Handle differently based on the situation If it is an urgent email, notify; otherwise, summarize

For example:

This is a complete AI workflow. Once set up, it runs automatically without any action from you.

AI Workflow vs Traditional Automation

The biggest difference between AI workflows and traditional automation is that AI can process unstructured content and make judgments.

Comparison Items Traditional Automation AI Workflow
Content Processing Can only process structured data Can understand text, images, and speech
Rule source Requires humans to hardcode rules AI can make judgments based on content
Flexibility Rules must be rewritten when they change Behavior can be changed by adjusting prompts
Applicable scenarios Simple, repetitive, deterministic tasks Complex tasks requiring understanding and judgment

For example, forwarding an email to Zhang San after receiving it—this is traditional automation with clear rules.

After receiving an email, the AI judges its importance, immediately notifies for important ones, and summarizes unimportant ones to be sent weekly—this is an AI workflow that requires understanding and judgment.


n8n workflow platform

n8n is an open-source workflow automation tool that can be self-hosted or used as a cloud version.

A feature of n8n is fully visual operation, allowing complex workflows to be built by dragging and dropping.

Open source address:https://github.com/n8n-io/n8n

n8n installation

Experience n8n with one command using npx (requires Node.js environment to be installed beforehand):



npx n8n

You can also deploy and run it using Docker:

Original prompt (Chinese, left untranslated)



# Create data persistence volume

docker volume create n8n_data

# Start n8n container

docker run -it --rm --name n8n -p 5678:5678 -v n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8n

After deployment, you can see the n8n interface by opening http://localhost:5678 in your browser.

n8n screenshot readme scaled

If you don't want to set it up yourself, you can also use the n8n Cloud versionhttps://n8n.io/and start using it by registering directly.

Core concepts: nodes, connections, triggers

The n8n interface consists of a canvas and nodes; understanding these three core concepts allows you to start using it:

Concept Function Description
Node Executes specific operations For example, "Send Email," "Call OpenAI," or "Save Data"
Connection Connect nodes Drag from one node to another node to define the execution order
Trigger Start the workflow The first node of each workflow, defining "when to start"

Basic steps to create a workflow:

Integrate OpenAI node

n8n has a built-in OpenAI node that can directly call GPT models.

Configuration steps:

A typical prompt configuration might look like this:

Original prompt (Chinese, left untranslated)



Please summarize the email content below into a 3-sentence abstract:



{{$json.body}}



摘要:

Where {{$json.body}} references the body content of the previous email node.

Practical Application: Automatically summarize emails and send Slack notifications

We will build a complete workflow: after receiving an email, the AI summarizes the content, and then sends it to Slack.

This workflow requires three nodes:

Configuration points:

Connect these three nodes, and once testing is successful, activate it, and the workflow will run automatically.

The n8n node library is very rich, supporting hundreds of services such as Gmail, Notion, Airtable, and Google Sheets. Take some time to explore the node library, and you will find many scenarios that can be automated.


Make (formerly Integromat)

Make is another popular workflow automation platform, formerly known as Integromat and renamed to Make in 2021.

Compared to n8n, Make is more geared towards business users, has a more polished interface, and offers stronger features in its paid version.

Comparison between Make and n8n

Comparison items n8n Make
Open source Yes, self-hostable No, pure SaaS
Free version Self-hosting is completely free Yes, with limited features
Interface Technical-oriented More friendly and refined
Number of nodes Hundreds Thousands
Enterprise features Requires paid version Perfected
Learning curve Slightly steep Relatively gentle

Simple summary: If you want to take control yourself and have technical skills, choose n8n; if you want something simpler and easier to use with enterprise-grade support, choose Make.

AI Module Usage

Make has built-in multiple AI-related modules:

OpenAI Module: Calls models such as GPT, DALL-E, and Whisper.

Make AI Module: Make's own AI features, which can intelligently process data.

Other AI Tools: Supports Anthropic Claude, Google AI, Midjourney, and others.

The process of using AI in Make:

A feature of Make is the AI prompt assistant—you can describe what you want to do in natural language, and it will help you generate the prompt.

Practical example

We use Make to create a "social media content automatic generation" workflow:

Once the entire process is set up, it will run automatically every Monday. You only need to review and fine-tune the content, not write the copy from scratch.


Zapier AI automation

Zapier is a pioneer in workflow automation, founded in 2011.

Zapier's features include the largest number of connected applications (over 6000) and ease of use.

Basic Zapier usage

Zapier calls a workflow a Zap. The steps to create a Zap are:

Zapier's interface is simpler than n8n and Make, with each step being form-based and no need for drag-and-drop connections.

AI Actions feature

Zapier has released a dedicated AI Actions feature that allows you to describe what you want to do in natural language, and it automatically configures the entire Zap.

For example, if you input:

Original prompt (Chinese, left untranslated)



当我收到带有"发票"标签的邮件时,把附件保存到 Google Drive,

然后用 AI 提取金额和日期,记录到 Airtable,

最后给我发一条 Slack 通知。

Zapier AI will automatically recognize which steps are needed and help you configure each node.

You can also use AI to help you write prompts. For example, when calling GPT, if you say "Help me write a prompt to summarize this email," the AI will generate a professional prompt template.

Suitable scenarios

Zapier is best suited for these scenarios:

Scenario Why choose Zapier
Connecting niche applications Zapier supports 6000+ applications, many others do not
Simple personal automation Simplest interface, fastest to learn
Non-technical users No technical background required
Rapid prototype validation A workflow can be set up in minutes

Tool selection recommendations:Beginners should start with Zapier, those who want deeper control should use n8n, and enterprise-level needs should choose Make. In fact, the core idea of the three tools is the same; learning one makes it easy to switch to another.


Custom GPTs and Claude Projects

In addition to chaining multiple services with workflow tools, you can also create dedicated AI assistants to handle specific tasks.

OpenAI's GPTs and Anthropic's Claude Projects are examples of such tools.

Create a Custom AI Assistant

Example using OpenAI GPTs, the steps to create a custom assistant are:

The creation process for Claude Projects is similar, performed in the Projects feature on the Claude official website.

Knowledge base upload

One of the major advantages of a custom AI assistant is the ability to upload your own knowledge base.

Supported file formats usually include:

Format Description
PDF Most commonly used, suitable for documents, reports, and books
TXT Plain text, simple and universal
DOCX Word document
CSV Table data
JSON Structured data

After uploading, the AI will answer questions based on this knowledge.

For example, you can upload your company's product documentation, customer service manuals, and historical cases to create an "Internal Knowledge Assistant," and employees can ask it questions directly.

Or you can upload all the articles you have written to create a "Writing Style Assistant" that will write new content imitating your style.

Prompt customization

Instructions are the core of a custom assistant; they define the AI's role, behavior, and output format.

A good prompt usually includes:

An example of a prompt:

Original prompt (Chinese, left untranslated)



你是 runoob 的技术文档助手。



你的任务是把复杂的技术概念解释得通俗易懂,适合初学者。



Please follow these rules when answering:

1. 先用一句话简单解释是什么

2. 然后用生活中的例子类比

3. 最后给出一个最简单的代码示例

4. 如果有重要的注意事项,用加粗标出



不要使用太深的术语,必要术语要解释。

保持语气友好、鼓励,像老师在教学生。

The more specific the prompt, the more stable the AI's performance.


Webhook and triggers

Webhook is a very important concept in workflow automation; it allows external systems to trigger your workflow in real-time.

How Webhooks work

Simply put, a Webhook is a "URL callback address."

The traditional way is "polling": your system asks the external system every so often, "Is there new data?"—this is very inefficient.

Webhook is "pushing": when the external system has new data, it actively sends you an HTTP request to notify you.

Webhook workflow:

Webhooks are real-time, triggering the workflow within milliseconds of the event occurring.

Event-driven automation

Webhooks enable event-driven automation.

Common Webhook event sources:

Event source Typical event Usage examples
GitHub Someone submits code, someone raises an Issue Automatically reply to an Issue using AI upon receipt
Stripe Someone makes a payment, subscription expires Send a thank-you email upon receiving a payment
Typeform A form has been submitted After the form is submitted, AI analyzes the content and assigns it
Shopify New orders, inventory alerts Automatically generate shipping orders when a new order arrives
Your website User registration, comments Welcome email when a new user registers

We use Python to implement a simple Webhook receiving + AI processing workflow:

Example

============================================

Simple Webhook Server + AI Processing Workflow

Use Flask to receive Webhook and call OpenAI for processing

============================================

from

flask

import

Flask

,

request

,

jsonify

import

openai

import

json

Initialize Flask application

app

=

Flask

(

name

)

Configure OpenAI (please replace with your API Key)

openai.

api_key

=

"sk-your-api-key-here"

def

process_with_ai

(

content:

str

)

str

:

   

"""
Process the received content with AI
Perform a simple "content classification + summarization" here
"""

prompt

=

f

"""
Please analyze the following content and do two things:
1. Category: Determine if it is a "question", "suggestion", or "thanks"
2. Summary: Summarize the core content in one sentence

Content:
{content}

Please return in JSON format, as follows:
{{
"category": "question/suggestion/thanks",
"summary": "Summary content"
}}
"""

response

=

openai.

ChatCompletion

.

create

(

model

=

"gpt-3.5-turbo"

,

messages

=

[

           

{

"role"

:

"system"

,

"content"

:

"You are runoob's content analysis assistant."

}

,

           

{

"role"

:

"user"

,

"content"

: prompt

}

       

]

,

temperature

=

0.7

   

)

   

return

response.

choices

[

0

]

.

message

.

content

@

app.

route

(

"/webhook"

,

methods

=

[

"POST"

]

)

def

webhook_handler

(

)

:

   

"""
Endpoint for receiving Webhooks
External systems send POST requests to this URL
"""

   

Get request data

data

=

request.

get_json

(

)

   

print

(

f

"Received Webhook data: {data}"

)

   

Extract the content we need (adjust field names according to the actual situation)

   

Here we assume the incoming data has a "content" field

content

=

data.

get

(

"content"

,

""

)

   

if

not

content:

       

return

jsonify

(

{

"status"

:

"error"

,

"message"

:

"Missing content field"

}

)

,

400

   

Process content with AI

   

try

:

ai_result

=

process_with_ai

(

content

)

       

print

(

f

"AI processing result: {ai_result}"

)

       

Parse the JSON returned by the AI

parsed_result

=

json.

loads

(

ai_result

)

       

Here you can store the result in the database, send notifications, etc.

       

For demonstration, we just print it out

category

=

parsed_result.

get

(

"category"

,

"Unknown"

)

summary

=

parsed_result.

get

(

"summary"

,

""

)

       

print

(

f

"Category: {category}"

)

       

print

(

f

"Summary: {summary}"

)

       

Return success response

       

return

jsonify

(

{

           

"status"

:

"success"

,

           

"category"

: category

,

           

"summary"

: summary

       

}

)

   

except

Exception

as

e:

       

print

(

f

"Error processing: {e}"

)

       

return

jsonify

(

{

"status"

:

"error"

,

"message"

:

str

(

e

)

}

)

,

500

@

app.

route

(

"/test"

,

methods

=

[

"GET"

]

)

def

test_page

(

)

:

   

"""
A simple test page for testing Webhooks
"""

   

return

"""
   
       
           

Test Webhook


           

               
               

               
           

       
   
"""

if

name

==

"main"

:

   

print

(

"Webhook server started at http://localhost:5000"

)

   

print

(

Webhook URL: http://localhost:5000/webhook

)

   

print

(

"Test page: http://localhost:5000/test"

)

app.

run

(

port

=

5000

,

debug

=

True

)

After running this server, you can test it by opening http://localhost:5000/test in a browser, or by sending a test request with curl:

Instance

Send test Webhook request

curl

-X

POST http:

//

localhost:

5000

/

webhook \

 

-H

"Content-Type: application/json"

\

 

-d

'{
    "content": "runoob's tutorials are great! It would be even better if there were more practical examples of AI workflows."
  }'

If everything is normal, you will see the categories and summaries returned by the AI.

When using Webhook in a production environment, remember to add a verification mechanism—such as signature verification, checking the source IP, or using an API Key. Otherwise, anyone can send requests to your Webhook, which may cause security issues.


Collection of Practical Projects

In this section, we provide three complete practical project ideas that you can directly apply as templates.

Automatically Generate Daily News Briefing

Goal: Automatically collect industry news every morning, have AI filter and summarize it, and send it to your email or Slack.

Required Tools: n8n/Make/Zapier, RSS feed, OpenAI, Email/Slack.

Workflow Steps:

Prompt example:

Original prompt (Chinese, left untranslated)



请阅读下面这篇新闻的标题和摘要,判断它是否与"AI 技术应用"相关。



只需要回答"是"或"否",不要解释。



新闻标题:{{$json.title}}

新闻摘要:{{$json.summary}}

Automatic social media content publishing

Goal: Automatically generate multi-platform social media copy based on product updates, and schedule it for publishing after review.

Required tools: Make/Zapier, Airtable, OpenAI, Buffer/Hootsuite.

Workflow steps:

This process is both automated and retains manual review control—after all, social media is directly facing customers, so oversight is necessary.

Automatic Customer Feedback Classification

Goal: After receiving customer feedback, AI automatically classifies it, analyzes sentiment, and assigns it to the corresponding person in charge.

Required Tools: n8n, Typeform/form tool, OpenAI, Airtable, Slack.

Workflow Steps:

  1. Email node: Send the automated reply to the customer.

This workflow allows customers to receive an immediate reply while enabling internal teams to quickly respond to important issues.

A principle for designing workflows:First, automate mechanical tasks like "collecting, organizing, and distributing," leaving "judgment, decision-making, and creativity" to humans.Do not try to let AI make all the decisions; human-machine collaboration yields the best results.


Comparison summary of three tools

We provide a comprehensive comparison of three mainstream tools, n8n, Make, and Zapier, to help you choose:

Comparison items n8n Make Zapier
Open source Is No No
Self-hosted Supports Does not support Not supported
Free plan Self-hosting is completely free Free version limits the number of operations Free version limits the number of Zaps
Number of connected applications Hundreds Thousands 6000+
Interface style Visualization canvas Refined canvas Step form
Learning curve Medium Lower Minimum
Enterprise features Paid version required Improved Improved
Technical threshold Slightly high (self-hosted) Low Minimum
Target audience Developers, technical teams Small and medium-sized enterprises, teams Individuals, beginners