Ollama Qwen LLMとPostgresメモリ管理を使用してAppianタスクを処理

中級

これはAI Chatbot, Multimodal AI分野の自動化ワークフローで、13個のノードを含みます。主にSet, Webhook, Agent, HttpRequestTool, RespondToWebhookなどのノードを使用。 Ollama Qwen LLMとPostgresのメモリ管理でAppianのタスクを管理する

前提条件
  • HTTP Webhookエンドポイント(n8nが自動生成)
  • ターゲットAPIの認証情報が必要な場合あり
  • PostgreSQLデータベース接続情報
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "nodes": [
    {
      "id": "template-vars-0001",
      "name": "テンプレート変数",
      "type": "n8n-nodes-base.set",
      "position": [
        480,
        704
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "a1",
              "name": "baseUrl",
              "type": "string",
              "value": "https://YOUR-APP-BASE/suite/webapi"
            },
            {
              "id": "a2",
              "name": "defaultBatchSize",
              "type": "number",
              "value": "10"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "chat-trigger-0001",
      "name": "チャットメッセージ受信時",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        672,
        624
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "webhook-0001",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        672,
        832
      ],
      "parameters": {
        "path": "your-webhook-path",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode",
        "authentication": "headerAuth"
      },
      "typeVersion": 2
    },
    {
      "id": "set-normalize-0001",
      "name": "チャット入力の正規化",
      "type": "n8n-nodes-base.set",
      "position": [
        976,
        704
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "set-chatInput",
              "name": "chatInput",
              "type": "string",
              "value": "={{  $json?.body?.text || $json?.chatInput || $json.body?.chatInput }}"
            },
            {
              "id": "set-sessionId",
              "name": "sessionId",
              "type": "string",
              "value": "={{ $json?.body?.conversation?.id || $json?.sessionId || $json.body?.sessionId}}"
            },
            {
              "id": "set-username",
              "name": "username",
              "type": "string",
              "value": "={{ $json?.body?.user || $json?.username || 'user@example.com' }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "agent-0001",
      "name": "AIエージェント",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1360,
        704
      ],
      "parameters": {
        "options": {
          "maxIterations": 15,
          "systemMessage": "You are a helpful assistant that can list and create Appian tasks using the provided tools. Keep responses concise and format dates as 'mmmm d, yyyy'.",
          "returnIntermediateSteps": true
        }
      },
      "typeVersion": 1.6
    },
    {
      "id": "ollama-llm-0001",
      "name": "Ollama チャットモデル",
      "type": "@n8n/n8n-nodes-langchain.lmChatOllama",
      "position": [
        1152,
        928
      ],
      "parameters": {
        "model": "qwen2.5:7b",
        "options": {
          "numCtx": 8147
        }
      },
      "typeVersion": 1
    },
    {
      "id": "pg-memory-0001",
      "name": "Postgresチャットメモリ",
      "type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "position": [
        1360,
        928
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "tool-list-tasks-0001",
      "name": "タスク一覧表示 (Appian)",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        1600,
        928
      ],
      "parameters": {
        "url": "={{ $('Template Vars').item.json.baseUrl }}/tasks",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "oAuth2Api",
        "queryParameters": {
          "parameters": [
            {
              "name": "username",
              "value": "={{ $('Normalize Chat Input').item.json.username }}"
            },
            {
              "name": "startIndex",
              "value": "={{ parseInt($fromAI('parameters1_Value', 'First result index, default 1', 'string')) || 1 }}"
            },
            {
              "name": "batchSize",
              "value": "={{ parseInt($('Template Vars').item.json.defaultBatchSize) || 10 }}"
            }
          ]
        },
        "toolDescription": "List all user tasks. Use startIndex and batchSize to page the results."
      },
      "typeVersion": 4.2
    },
    {
      "id": "tool-list-types-0001",
      "name": "タスクタイプ一覧表示 (Appian)",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        1808,
        928
      ],
      "parameters": {
        "url": "={{ $('Template Vars').item.json.baseUrl }}/tasktypes",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "oAuth2Api",
        "toolDescription": "Lists all of the available task types."
      },
      "typeVersion": 4.2
    },
    {
      "id": "tool-create-task-0001",
      "name": "タスク作成 (Appian)",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        2032,
        928
      ],
      "parameters": {
        "url": "={{ $('Template Vars').item.json.baseUrl }}/tasks",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "username",
              "value": "={{ $('Normalize Chat Input').item.json.username }}"
            },
            {
              "name": "title",
              "value": "={{ $fromAI('parameters1_Value', 'Short task title', 'string') }}"
            },
            {
              "name": "description",
              "value": "={{ $fromAI('parameters2_Value', 'Detailed task description', 'string') }}"
            },
            {
              "name": "estimatedHours",
              "value": "={{ $fromAI('parameters3_Value', 'Estimated hours (optional)', 'string') }}"
            },
            {
              "name": "estimatedCost",
              "value": "={{ $fromAI('parameters4_Value', 'Estimated cost (optional)', 'string') }}"
            }
          ]
        },
        "genericAuthType": "oAuth2Api",
        "toolDescription": "Creates a new task. Execute only once per task."
      },
      "typeVersion": 4.2
    },
    {
      "id": "set-output-0001",
      "name": "応答の準備",
      "type": "n8n-nodes-base.set",
      "position": [
        1808,
        704
      ],
      "parameters": {
        "options": {
          "dotNotation": true
        },
        "assignments": {
          "assignments": [
            {
              "id": "set-output",
              "name": "output",
              "type": "string",
              "value": "={{ $json.output }}"
            },
            {
              "id": "set-sessionId-out",
              "name": "sessionId",
              "type": "string",
              "value": "={{ $('Normalize Chat Input').item.json.sessionId }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "respond-0001",
      "name": "Webhook への返信",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        2048,
        704
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.3
    },
    {
      "id": "note-0001",
      "name": "備考",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        520
      ],
      "parameters": {
        "width": 900,
        "height": 420,
        "content": "Appian Tasks Chat Agent\nThis template shows a local AI chat agent that lists and creates tasks via an Appian-compatible API. Configure Template Vars and attach your own credentials after import."
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "webhook-0001": {
      "main": [
        [
          {
            "node": "set-normalize-0001",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "agent-0001": {
      "main": [
        [
          {
            "node": "set-output-0001",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "set-output-0001": {
      "main": [
        [
          {
            "node": "respond-0001",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ollama-llm-0001": {
      "ai_languageModel": [
        [
          {
            "node": "agent-0001",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "tool-list-tasks-0001": {
      "ai_tool": [
        [
          {
            "node": "agent-0001",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "tool-create-task-0001": {
      "ai_tool": [
        [
          {
            "node": "agent-0001",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "set-normalize-0001": {
      "main": [
        [
          {
            "node": "agent-0001",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "pg-memory-0001": {
      "ai_memory": [
        [
          {
            "node": "agent-0001",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "tool-list-types-0001": {
      "ai_tool": [
        [
          {
            "node": "agent-0001",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "chat-trigger-0001": {
      "main": [
        [
          {
            "node": "set-normalize-0001",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
よくある質問

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

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

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

中級 - AIチャットボット, マルチモーダルAI

有料ですか?

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

関連ワークフロー

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

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

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34