Webデータに基づくAIチャート生成とWordPressアップロード

中級

これはContent Creation, Multimodal AI分野の自動化ワークフローで、15個のノードを含みます。主にCode, HttpRequest, ManualTrigger, Agent, OpenAiなどのノードを使用。 Webデータに基づくAI駆動のチャート生成。GPT-4oを使用し、WordPressにアップロードします。

前提条件
  • ターゲットAPIの認証情報が必要な場合あり
  • OpenAI API Key
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "meta": {
    "instanceId": "52254486b159b349334953c1738da94e90477c7604aa8db2062d11afc0120739",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "502f1b86-95d7-49c1-9503-2a38e37ff9ba",
      "name": "別のワークフローから実行時",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        992,
        -224
      ],
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "prompt"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "88196843-a411-4ef0-ba4e-df54fc8f924f",
      "name": "QuickChartオブジェクトスキーマ",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1920,
        -16
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"slug\": {\n      \"type\": \"string\",\n      \"description\": \"Proposed image filename or identifier (e.g., 'ev-sales-2024')\"\n    },\n    \"width\": {\n      \"type\": \"string\",\n      \"description\": \"Pixel width of the image canvas (e.g., '500')\"\n    },\n    \"height\": {\n      \"type\": \"string\",\n      \"description\": \"Pixel height of the image canvas (e.g., '300')\"\n    },\n    \"devicePixelRatio\": {\n      \"type\": \"number\",\n      \"description\": \"Device pixel ratio (e.g., 2)\"\n    },\n    \"format\": {\n      \"type\": \"string\",\n      \"enum\": [\"png\", \"jpeg\", \"webp\", \"svg\", \"pdf\"],\n      \"description\": \"Output format of the image\"\n    },\n    \"backgroundColor\": {\n      \"type\": \"string\",\n      \"description\": \"Canvas background color in hex or named CSS color, make it white #FFFFFF by default\"\n    },\n    \"version\": {\n      \"type\": \"string\",\n      \"description\": \"Chart.js version (e.g., '3.9.1')\"\n    },\n    \"chart\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"type\": {\n          \"type\": \"string\",\n          \"enum\": [\"line\", \"bar\", \"doughnut\", \"pie\", \"polarArea\"]\n        },\n        \"data\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"labels\": {\n              \"type\": \"array\",\n              \"items\": { \"type\": \"string\" },\n              \"minItems\": 1\n            },\n            \"datasets\": {\n              \"type\": \"array\",\n              \"items\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"label\": { \"type\": \"string\" },\n                  \"data\": {\n                    \"type\": \"array\",\n                    \"items\": { \"type\": \"number\" },\n                    \"minItems\": 1\n                  },\n                  \"backgroundColor\": {\n                    \"type\": [\"string\", \"array\"],\n                    \"items\": { \"type\": \"string\" }\n                  },\n                  \"borderColor\": {\n                    \"type\": [\"string\", \"array\"],\n                    \"items\": { \"type\": \"string\" }\n                  },\n                  \"fill\": { \"type\": [\"boolean\", \"string\"] },\n                  \"borderWidth\": { \"type\": \"number\" }\n                },\n                \"required\": [\"label\", \"data\"]\n              },\n              \"minItems\": 1\n            }\n          },\n          \"required\": [\"labels\", \"datasets\"]\n        },\n        \"options\": {\n          \"type\": \"object\",\n          \"description\": \"Chart.js configuration options including title, plugins, scales, etc.\"\n        }\n      },\n      \"required\": [\"type\", \"data\"]\n    }\n  },\n  \"required\": [\"slug\", \"chart\"],\n  \"default\": {\n    \"format\": \"png\",\n    \"backgroundColor\": \"white\"\n  }\n}\n"
      },
      "typeVersion": 1.2
    },
    {
      "id": "9a398d7a-0435-44d2-9cbb-e5156fbad68f",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1664,
        -16
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "k5QLUV8boAepwce0",
          "name": "OpenAi account - default project"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "0afadfd3-348a-4df7-958b-c14eca32b316",
      "name": "画像アップロード2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2272,
        -224
      ],
      "parameters": {
        "url": "https://your.wordpress.com/wp-json/wp/v2/media",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "binaryData",
        "sendHeaders": true,
        "authentication": "predefinedCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Disposition",
              "value": "=attachment; filename=\"chart-{{ $json.output.slug }}.png\""
            }
          ]
        },
        "inputDataFieldName": "data",
        "nodeCredentialType": "wordpressApi"
      },
      "credentials": {
        "wordpressApi": {
          "id": "G1G8jDdEoWAVytQb",
          "name": "Wordpress  - author@email.com"
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2,
      "waitBetweenTries": 5000
    },
    {
      "id": "bb57c519-8dff-4bf5-8db6-a1c17c9bfb78",
      "name": "チャート生成AIエージェント",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1664,
        -224
      ],
      "parameters": {
        "text": "={{ $json.message.content }}",
        "options": {
          "systemMessage": "You are a Chart.js configuration agent. Your task is to transform a user-provided data table into a valid QuickChart JSON object compatible with line, bar, pie, doughnut, or polarArea charts.\n\nInstructions:\n1. Read and interpret the markdown table input provided by the data agent.\n2. Based on structure, choose the most appropriate chart type from:\n   - \"line\", \"bar\" → for time series or value comparison\n   - \"pie\", \"doughnut\", \"polarArea\" → for proportion-based data\n3. Construct a valid Chart.js object following QuickChart format.\n4. Always include:\n   - `type`\n   - `data.labels`\n   - `data.datasets` (with `label`, `data`, `backgroundColor`)\n   - `options.plugins.title.text` with a suitable chart title\n\nOutput only valid JSON matching the schema:\n- No code blocks\n- No markdown\n- No explanations"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.7
    },
    {
      "id": "e6235b7c-6b11-4cba-bc0c-9e22db2e8220",
      "name": "「ワークフロー実行」クリック時",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        992,
        -32
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "9570f247-b9f1-49b2-b104-6adcbe32e450",
      "name": "モデルへのメッセージ",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1248,
        -224
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-search-preview",
          "cachedResultName": "GPT-4O-SEARCH-PREVIEW"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are a data aggregation AI agent with access to real-time web search. Your goal is to collect relevant, structured, and up-to-date data from trusted sources based on the user's query.\n\nInstructions:\n1. Search the web for reliable, factual, and recent data related to the query.\n2. Extract the data into a clean, readable table format (markdown table).\n3. The table should contain categories (e.g. country, platform, year) as rows or columns depending on structure.\n4. Include source URLs for each data group, appended below the table.\n\nRules:\n- Do not interpret or visualize the data.\n- Do not generate charts.\n- Do not summarize or paraphrase data.\n- Return only the data table and source list in markdown format."
            },
            {
              "content": "={{ $json.prompt }}"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "k5QLUV8boAepwce0",
          "name": "OpenAi account - default project"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "5002b0f9-036d-4416-b36a-818c699e0b71",
      "name": "思考1",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        1792,
        -16
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "7612a971-459f-4106-8b0d-eda11b23f46a",
      "name": "QuickChart作成",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2032,
        -224
      ],
      "parameters": {
        "url": "=https://quickchart.io/chart",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ $json.output }}",
        "sendBody": true,
        "specifyBody": "json"
      },
      "typeVersion": 4.2
    },
    {
      "id": "b654b232-2e12-4864-a829-752b77abc3c4",
      "name": "コード",
      "type": "n8n-nodes-base.code",
      "position": [
        2496,
        -224
      ],
      "parameters": {
        "jsCode": "return {\n  \"research\" : $('Message a model').first().json,\n  \"graph_data\" :  $('Generate Chart AI agent').first().json.output,\n  \"graph_image\" : $('Upload image2').first().json,\n  \"result_image_url\" : $('Upload image2').first().json.guid.raw\n}"
      },
      "typeVersion": 2
    },
    {
      "id": "6e184446-0d1c-43fa-8bc0-862bca3b17a2",
      "name": "付箋",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1216,
        -320
      ],
      "parameters": {
        "color": 5,
        "width": 336,
        "height": 448,
        "content": "## Search the web\nUsing Gpt 4o search preview and generate a table"
      },
      "typeVersion": 1
    },
    {
      "id": "abca6241-a82c-4a6f-b604-fecdb4268533",
      "name": "付箋1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1568,
        -320
      ],
      "parameters": {
        "color": 4,
        "width": 624,
        "height": 448,
        "content": "## Generate chart\nUsing openchart / chart.js "
      },
      "typeVersion": 1
    },
    {
      "id": "acfa1a4d-d900-445b-a1a1-90147ee441d9",
      "name": "付箋2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2208,
        -320
      ],
      "parameters": {
        "color": 6,
        "width": 224,
        "height": 448,
        "content": "## Upload chart image to WP\n"
      },
      "typeVersion": 1
    },
    {
      "id": "5a9349d9-6d61-4aac-9ead-a3bb44506d5d",
      "name": "付箋3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1568,
        144
      ],
      "parameters": {
        "color": 7,
        "width": 864,
        "height": 576,
        "content": "## Convert the table to chart.js\n![openchart graph](https://articles.emp0.com/wp-content/uploads/2025/07/chart-apple-market-share-q1-2025.png)"
      },
      "typeVersion": 1
    },
    {
      "id": "3e89f9d7-d068-49c2-a22c-3424fa2de70e",
      "name": "付箋4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        960,
        144
      ],
      "parameters": {
        "color": 7,
        "width": 592,
        "height": 576,
        "content": "## Search the web and generate a table\n```\n[\n  {\n    \"index\": 0,\n    \"message\": {\n      \"role\": \"assistant\",\n      \"content\": \"Here is the data on Apple's market share in the mobile phone market for Q1 2025:\\n\\n\n| Q1 2025 |  Shipments | Market Share | Shipments | Market Share | Annual Growth |\\n\n|---------|------------|--------------|-----------|--------------|---------------|\\n\n| Samsung | 60.5       | 20%          | 60.0      | 20%          | 1%            |\\n\n| Apple   | 55.0       | 19%          | 48.7      | 16%          | 13%           |\\n\n| Xiaomi  | 41.8       | 14%          | 40.7      | 14%          | 3%            |\\n\n| vivo    | 22.9       | 8%           | 21.4      | 7%           | 7%            |\\n\n| OPPO    | 22.7       | 8%           | 25.0      | 8%           | -9%           |\\n\n| Others  | 94.0       | 32%          | 100.5     | 34%          | -6%           |\\n\n| Total   | 296.9      | 100%         | 296.2     | *100%        | 0%            |\\n\\n\n*Note: Percentages may not add up to 100% due to rounding.*\\n\\nSource: [Canalys Newsroom - Global smartphone market grows just 1% in Q1 after rocky start to 2025](https://www.canalys.com/newsroom/global-smartphone-market-q1-2025)\\n\\nAdditionally, according to Counterpoint Research, Apple achieved a 19% market share in Q1 2025, marking the first time it secured the top position in global smartphone sales during a first quarter. This success was driven by the launch of the iPhone 16e and strong demand in markets such as Japan and India. ([counterpointresearch.com](https://www.counterpointresearch.com/insight/post-insight-global-smartphone-market-grows-3-in-q1-2025-but-future-uncertain-apple-takes-1-spot-in-q1-for-first-time/?utm_source=openai))\\n\\n*Note: Different research firms may report varying figures due to differences in data collection methodologies.* \",\n      \"refusal\": null,\n      \"annotations\": [\n        {\n          \"type\": \"url_citation\",\n          \"url_citation\": {\n            \"end_index\": 2146,\n            \"start_index\": 1935,\n            \"title\": \"Global Smartphone Market Grows 3% in Q1 2025 But Future Uncertain; Apple Takes #1 Spot in Q1 For First Time\",\n            \"url\": \"https://www.counterpointresearch.com/insight/post-insight-global-smartphone-market-grows-3-in-q1-2025-but-future-uncertain-apple-takes-1-spot-in-q1-for-first-time/?utm_source=openai\"\n          }\n        }\n      ]\n    },\n    \"finish_reason\": \"stop\"\n  }\n]\n```"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {
    "When clicking ‘Execute workflow’": [
      {
        "prompt": "Generate a graph of apple's market share in the mobile phone market in q1 2025"
      }
    ]
  },
  "connections": {
    "5002b0f9-036d-4416-b36a-818c699e0b71": {
      "ai_tool": [
        [
          {
            "node": "bb57c519-8dff-4bf5-8db6-a1c17c9bfb78",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "0afadfd3-348a-4df7-958b-c14eca32b316": {
      "main": [
        [
          {
            "node": "b654b232-2e12-4864-a829-752b77abc3c4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "9570f247-b9f1-49b2-b104-6adcbe32e450": {
      "main": [
        [
          {
            "node": "bb57c519-8dff-4bf5-8db6-a1c17c9bfb78",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "7612a971-459f-4106-8b0d-eda11b23f46a": {
      "main": [
        [
          {
            "node": "0afadfd3-348a-4df7-958b-c14eca32b316",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "9a398d7a-0435-44d2-9cbb-e5156fbad68f": {
      "ai_languageModel": [
        [
          {
            "node": "bb57c519-8dff-4bf5-8db6-a1c17c9bfb78",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "bb57c519-8dff-4bf5-8db6-a1c17c9bfb78": {
      "main": [
        [
          {
            "node": "7612a971-459f-4106-8b0d-eda11b23f46a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "88196843-a411-4ef0-ba4e-df54fc8f924f": {
      "ai_outputParser": [
        [
          {
            "node": "bb57c519-8dff-4bf5-8db6-a1c17c9bfb78",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "502f1b86-95d7-49c1-9503-2a38e37ff9ba": {
      "main": [
        [
          {
            "node": "9570f247-b9f1-49b2-b104-6adcbe32e450",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e6235b7c-6b11-4cba-bc0c-9e22db2e8220": {
      "main": [
        [
          {
            "node": "9570f247-b9f1-49b2-b104-6adcbe32e450",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
よくある質問

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

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

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

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

有料ですか?

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

関連ワークフロー

コンテンツジェネレーター v3
AI驱动ブログ自動化:使用GPT-4生成并公開SEO記事至WordPressとTwitter
If
Set
Code
+
If
Set
Code
144 ノードJay Emp0
コンテンツ作成
OpenAI、ElevenLabs、Fal.ai を使用した動画・パ odcast・ASM R向けのウイルス性コンテンツ自動作成
OpenAI、ElevenLabs、そして Fal.ai を使って動画、ポッドキャスト、ASMR に向けたウイルスのコンテンツ作成を自動化
Set
Code
Wait
+
Set
Code
Wait
97 ノードAdam Crafts
コンテンツ作成
💥 NanoBanana、Seedream 4、ChatGPT Image、Veo 3 を使って動画広告を自動化 - VIDEO
AI(NanoBanana、Seedream、GPT-4o、Veo 3)を使って動画広告キャンペーンを自動化し公開
Set
Code
Wait
+
Set
Code
Wait
63 ノードDr. Firas
コンテンツ作成
YouTube 動画に基づく自律ブログ公開
YouTube 動画から ChatGPT、Sheets、Apify、Pexels、WordPress を使用してブログの自主公開
If
Set
Code
+
If
Set
Code
80 ノードOriol Seguí
コンテンツ作成
再生リスト詳細設定ボットコピー
Suno、GPT-4、Runway、Creatomate を使って AI 生成の YouTube ミュージックプレイリストを作成
If
Set
Code
+
If
Set
Code
203 ノードJoseph
コンテンツ作成
OpenAI、ElevenLabs、Hedraを使用してウイルスのな赤ちゃんポッドキャストYouTubeショートビデオを作成する
OpenAI、ElevenLabs、およびHedraを使用してウイルスのな赤ちゃんPodcastのYouTubeショートビデオを作成する
Code
Wait
Merge
+
Code
Wait
Merge
38 ノードElectrabot
コンテンツ作成
ワークフロー情報
難易度
中級
ノード数15
カテゴリー2
ノードタイプ10
難易度説明

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

作成者
Jay Emp0

Jay Emp0

@jay-emp0

AI and Automation developer. Im implementing n8n and ai tools to automate marketing and sales in companies

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34