プロジェクトの反復 – 入門例

中級

これはContent Creation, Multimodal AI分野の自動化ワークフローで、8個のノードを含みます。主にSet, Code, ManualTrigger, SplitInBatches, Agentなどのノードを使用。 プロジェクトの反復処理 - 入門例

前提条件
  • OpenAI API Key
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "meta": {
    "instanceId": "efb474b59b0341d7791932605bd9ff04a6c7ed9941fdd53dc4a2e4b99a6f9439",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "bdd87769-9f12-4bd1-8dd9-1b90ec218209",
      "name": "ループ処理",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        600,
        -540
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "6209e2d5-4c6e-4239-8275-a8d3411cb6f9",
      "name": "OpenAI チャットモデル",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        820,
        -120
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "ghJTvay8CvwXDsXz",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "8e3ecba2-5a55-40bc-ba3a-b3cb0d581630",
      "name": "ツール: Inject Creativity",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        1060,
        -100
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a73bc4ac-78f7-4410-ac1a-0952415dbe9f",
      "name": "付箋3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -740,
        -900
      ],
      "parameters": {
        "width": 2260,
        "height": 1140,
        "content": "## 📬 Need Help or Want to Customize This?\n📧 [robert@ynteractive.com](mailto:robert@ynteractive.com)  \n🔗 [LinkedIn](https://www.linkedin.com/in/robert-breen-29429625/)\n\n\n## 🔧 Step-by-Step Setup\n\n### 1️⃣ Run Workflow\n\n- **Node**: `Manual Trigger (Run Workflow)`\n- **Purpose**: Manually start the workflow for testing or learning.\n\n\n### 2️⃣ Create Random Data\n\n- **Node**: `Create Random Data (Code)`\n- **What it does**: Simulates incoming data with multiple content ideas.\n\n\n### 3️⃣ Loop Over Items\n\n- **Node**: `Loop Over Items (SplitInBatches)`\n- **Purpose**: Sends one record at a time to the next node.\n- **Why It Matters**: Loops in n8n are created using this node when you want to iterate over multiple items.\n\n\n### 4️⃣ Create Captions with AI\n\n- **Node**: `Create Captions (LangChain Agent)`\n- **Prompt**: \n```text\nidea: {{ $json.idea }}\n```\n- **System Message**: \n```text\nYou are a helpful assistant creating captions for a LinkedIn post. Please create a LinkedIn caption for the idea.\n```\n- **Model**: GPT-4o Mini or GPT-3.5\n- **Credentials Required**:\n  - **OpenAI Credential**  \n    - Go to: [OpenAI API Keys](https://platform.openai.com/account/api-keys)\n    - Create a key and add it in n8n under credentials as “OpenAi account”\n\n\n### 5️⃣ Inject Creativity (Optional)\n\n- **Node**: `Tool: Inject Creativity (LangChain Tool)`\n- **Purpose**: Demonstrates optional LangChain tools that can enhance or manipulate input/output.\n- **Why It’s Cool**: A great way to show chaining tools to AI agents.\n\n\n\n\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "a523d13f-653d-4a91-a672-b0bd5d558f27",
      "name": "Run Workflow",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        220,
        -680
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f0e1af9b-2785-47b1-a38c-3e108bff67f8",
      "name": "Create Random Data",
      "type": "n8n-nodes-base.code",
      "position": [
        380,
        -540
      ],
      "parameters": {
        "jsCode": "return [\n  {\n    json: {\n      row_number: 2,\n      id: 1,\n      Date: '2025-07-30',\n      idea: 'n8n rises to the top',\n      caption: '',\n      complete: ''\n    }\n  },\n  {\n    json: {\n      row_number: 3,\n      id: 2,\n      Date: '2025-07-31',\n      idea: 'n8n nodes',\n      caption: '',\n      complete: ''\n    }\n  },\n  {\n    json: {\n      row_number: 4,\n      id: 3,\n      Date: '2025-08-01',\n      idea: 'n8n use cases for marketing',\n      caption: '',\n      complete: ''\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "8891b681-a7cf-44c0-aff7-79e7774120d1",
      "name": "Create Captions",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        860,
        -380
      ],
      "parameters": {
        "text": "=idea: {{ $json.idea }}",
        "options": {
          "systemMessage": "You are a helpful assistant creating captions for a linkedin post. Please create a linkedin caption for the idea. "
        },
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "fa53cf32-03de-4667-80bb-b28f8c3a16aa",
      "name": "Output Table",
      "type": "n8n-nodes-base.set",
      "position": [
        960,
        -600
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "331d2ca1-da0d-41ec-ac82-abe78052b84c",
              "name": "idea",
              "type": "string",
              "value": "={{ $('Create Random Data').item.json.idea }}"
            },
            {
              "id": "019369d9-ae99-4c29-b31d-013e29c4fdb6",
              "name": "output",
              "type": "string",
              "value": "={{ $json.output }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    }
  ],
  "pinData": {},
  "connections": {
    "a523d13f-653d-4a91-a672-b0bd5d558f27": {
      "main": [
        [
          {
            "node": "f0e1af9b-2785-47b1-a38c-3e108bff67f8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "8891b681-a7cf-44c0-aff7-79e7774120d1": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "fa53cf32-03de-4667-80bb-b28f8c3a16aa",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "8891b681-a7cf-44c0-aff7-79e7774120d1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "8891b681-a7cf-44c0-aff7-79e7774120d1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "f0e1af9b-2785-47b1-a38c-3e108bff67f8": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tool: Inject Creativity": {
      "ai_tool": [
        [
          {
            "node": "8891b681-a7cf-44c0-aff7-79e7774120d1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}
よくある質問

このワークフローの使い方は?

上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。

このワークフローはどんな場面に適していますか?

中級 - コンテンツ作成, マルチモーダルAI

有料ですか?

このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。

ワークフロー情報
難易度
中級
ノード数8
カテゴリー2
ノードタイプ8
難易度説明

経験者向け、6-15ノードの中程度の複雑さのワークフロー

作成者
Robert Breen

Robert Breen

@rbreen

Professional services consultant with over 10 years of experience solving complex business problems across industries. I specialize in n8n and process automation—designing custom workflows that integrate tools like Google Calendar, Airtable, GPT, and internal systems. Whether you need to automate scheduling, sync data, or streamline operations, I build solutions that save time and drive results.

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34