ArticleOctober 12, 2025Free to read

Let AI Automatically Generate Workflows

By configuring n8n MCP, Claude can generate workflows in JSON format, creating a closed loop of AI generation and AI usage.

Originally published . English translation: . Read the Chinese original.

Original video in Chinese.

Key Takeaway

  • I share how to use AI, especially Claude, to automatically generate n8n workflows.
  • n8n is an open-source workflow automation tool with a high degree of flexibility, broad integrations, and support for importing and exporting workflows in JSON format.
  • n8n’s MCP Trigger feature can turn workflows into services callable by external systems, making “workflow as a service” possible.
  • By configuring n8n MCP, Claude can generate workflows in JSON format, creating a closed loop of AI generation and AI usage.
  • Even for complex workflows, if errors occur, you can feed the error message back to Claude for modifications.

It’s totally fine if you don’t know how to build workflows—you can have AI generate them automatically.

You can see here that I asked Claude to help me build an n8n workflow. It directly generates a JSON file. After it’s done, I copy the code from the file, go back to an empty n8n workflow, and paste it in. Finally, I configure a few nodes, and the workflow is ready to use.

Friends in China may not have heard much about n8n. It’s an open-source workflow automation tool. n8n is extremely flexible and widely integrated, ranging from common services like Slack to all kinds of databases and CRMs. It covers almost everything, which is why it’s so popular overseas.

For me, if I’m going to use a workflow tool, n8n is my first choice. Besides the flexibility and broad integrations I just mentioned, there are two more reasons:

First, n8n supports importing and exporting in JSON format. In other words, the entire workflow, including nodes, configurations, and connections, can be exported as a JSON file. Likewise, you can directly import a JSON file to fully reproduce a workflow.

Second, n8n supports turning workflows into MCP servers. It launched the MCP Trigger feature three months ago. You only need to add an MCP Server Trigger node at the beginning, and the workflow becomes a service that external systems can call through MCP—in other words: workflow as a service.

Put these two things together, and you get a way for AI to “produce and consume” on its own. Just like the demo I showed at the beginning, Claude can directly generate a JSON file. Import the JSON file, and a workflow is born. Then turn that workflow into an MCP server and expose it for AI clients to use.

AI generates, AI uses. Isn’t that a closed loop?

Hello everyone, welcome back to my channel. Modestly speaking, I’m one of the few creators in China who can clearly explain both the Why and the How of AI. What I provide is far more valuable than tutorials. Remember to follow. If you want to connect with me, come join our newtype community. This community has been running for 500 days, and more than 1,500 friends have paid to join.

Back to today’s topic: letting AI automatically generate workflows.

To get Claude to automatically generate n8n workflows, you need to install n8n MCP. You can think of it as a huge n8n guide. Once you set it up for Claude, it will have all the background knowledge.

Configuring this MCP is very simple—anyone can do it.

Step one: run the command npx n8n-mcp.

Step two: in Claude’s configuration file, paste in a few lines. Replace the link and API Key with your own.

Step three: create a project in Claude. In Project Instructions, copy and paste this whole block in. Its purpose is to tell Claude how to build the workflow.

Once these three steps are done, we can start generating. For the demo, I’ll directly choose a simple workflow from the official Template:

The user enters a YouTube link; the transcript is fetched through Apify’s service; finally, an LLM is called to summarize the transcript.

Back in Claude, paste in the requirements. Claude will first analyze them and ask questions so we can add more details. Once it has all the information, it will build the project architecture and then start generating the JSON document.

Basically, simple workflows can usually be done in one go. For complex workflows, if an error pops up, just paste the error back and let Claude revise it.

Once Claude has generated and verified everything, you can click the Copy button in the upper right corner. Go back to n8n, paste directly, and the workflow is imported.

What we need to do is finish configuring certain nodes inside it. For example, the Apify and OpenAI nodes need credentials configured before they can run.

As you can see, the whole process is this simple and direct. It’s just like AI coding: as long as your requirements are clear, Claude can handle it. I’m using the Sonnet model here. Everyone can also try the Opus model—it’ll be even more powerful.

OK, that’s it for this episode. If you want to understand AI, want to become a super individual, and want to find like-minded people, come join our newtype community. See you in the next episode!