---
# System prepended metadata

title: 1140124 n8n實作練習
tags: [AI Agent, n8n]

---

1. [OpenAI API Key](https://platform.openai.com)

### 想法
```plaintext
we will be write an article about:
{{ $json.topic }}

Come up with 10 interesting ideas about this topic that we could write a thought - provoking 1000 word article. List the 10 ideas only and nothing else.

```

### 大綱
```plaintext
Select one idea listed below that our target audience would be most interested in
knowing more about the following topic:
{{ $('Edit Fields').item.json.topic }}

Write an engaging, comprehensive and actionable outline for a 1000 word article. You must include counterarguments, criticisms and negative points against the topic and then re-affirm your argument. Output the idea you selected and the outline in JSON format and nothing else.

Use the following JSON format:
{
"Idea": "idea",
"Outline": {},
}

Here is the list of ideas:
{{ $json.text }}

```

### 標題
```plaintext
Using the intriguing headline examples list below, create one intriguing headline for
the following topic content outline. The main goal of the headline is to entice the
reader to continue reading the article. We will write an article based on this topic
and the headline you output.
Intriguing headline lexamples list:
1. X Little known [Something] That Could Be Causing Your [Problem]
2. Is [Thing] A Scam? Here's My Honest Review
3. How To Get Rid Of [Something] Forever, Even If You're Tried Everything
4. A Step-By-Step Guide For Doing X
5. The Secret To Achieving [Something Desirable]
6. 9 Out Of Every 10 People [Make This Mistake]. Are You One Of Them?
7. How To Survive Your First [Meaningful Experience]
8. What [Someone Credible] Can Teach Us About [Topic]
9. The Ultimate Guide To [Something]
10. X Lessons Learned [From Doing Something]
11. Why Something Happens (According To Science)
12. X Things [This Detail] Say About You
13. A Guaranteed Method For [Achieving Something / Avoiding Something]
14. How To Achieve [Something] Without Needing To Give Up [Some other thing]
15. How To [Achieve Something] In [A Short Amount Of Time]
16. The X Things Most People Don't Know About [Topic]
17. The X Biggest Mistakes People Make When [Doing Something]
18. X Tips For [Overcoming Some Obstacle]
19. The Best Ways To Get [Something] Without Needing [Something]
20. Want [Something]? Try [This]

```

### 文章
```plaintext
The following is the headline and outline for an award-winning article regarding the
following topic:
{{ $('Edit Fields1').item.json.topic }}

Your task is to write an approximately 1000 word article. Write content for each section in the outline that will collectively flow together as a complete and congruent article. The final article should perfectly answer or explain the headline and end with a compelling call to action. The content must be unique and not copied from any other sources. Make each section informative, engaging, and relevant. Where appropriate, use examples and practical tips to help the reader understand the subject better. Make sure the content is SEO optimized and flows logically. Ensure the pace and cadence of the article is easy to read. Write in the active voice to make the content more engaging, and double-check for plagiarism to ensure the originality of your work. Add bullet points sparingly where appropriate to make the content easier to read and digest. Use conversational and casual. Be concise. Minimize excess prose. Use less corporate and sales jargon. Don't use sales-speak; avoid words or phrases that are associated with sales people. Write the article in Markdown format. The reading level of your output should be at a grade 5 level.

Headline:
{{ $json.text }}

Outline:
{{ $('Outline').item.json.text }}

```



====

用ChatGPT寫n8n語法
```plaintext
You are a skilled, professional computer programmer. You specialize in writing code snippets for the automation software n8n. Here are some important practices when coding for n8n:

1. n8n code output must always return an object at the end like { "variable": "value" } or { }.
2. Variables from preceding nodes are accessed by looping through ’$input.all()’. For example:

for (const item of $input.all()){
console.log(item.json.description);
console.log(item.json.tempC);
}

```
