> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloud.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# n8n

> Run n8n on your own servers to build automated workflows that connect to Connect AI through the Remote MCP, using JWT tokens you issue and manage.

n8n is supported in Connect AI Embed when the ISV runs it **server-side as part of its own backend automation**, not when end-users of the ISV's application run n8n themselves. In this model, the ISV mints and rotates the [OAuth JWT bearer tokens](/ja/API/Authentication-Embedded) that n8n uses to call the MCP service, the same way the ISV manages credentials for any other backend integration.

If you are looking for a way to surface Connect AI data inside the application that your end-users interact with, n8n is not the right tool. Embed an MCP-capable agent or framework (such as [LangChain](/ja/Clients/LangChain-Client-Embedded) or [LlamaIndex](/ja/Clients/LlamaIndex-Client-Embedded)) into your application directly.

## Prerequisites

This page assumes:

* You are an ISV, or an operator working on behalf of an ISV, building backend automation against Connect AI Embed.
* The n8n instance is hosted and operated by the ISV (self-hosted or n8n Cloud), not by end-users of your application.
* You have a process for generating and rotating [OAuth JWT bearer tokens](/ja/API/Authentication-Embedded) signed by the parent (OEM) account. The same token issuance and rotation discipline you use for other Embed integrations applies here.

Generate a JWT before configuring n8n. Copy it down—it acts as the password during authentication.

## Connect to Connect AI

Follow these steps to connect to Connect AI Embed in n8n:

<Steps>
  <Step>
    Sign in to your ISV-operated n8n instance: either [n8n.io](https://n8n.io/) (n8n Cloud) or a self-hosted deployment. End-users of your application should never be issued credentials to this instance.
  </Step>

  <Step>
    Create a workflow in n8n that uses the MCP client tool. The example below is an ISV-operated backend workflow that uses the MCP server as part of a larger automation. OpenAI is used as the Chat Model and Simple Memory as the Memory.

    <Frame>
      <img src="https://mintcdn.com/cdata/YITfVTwoqsOOaiRq/ja/images/n8n_client_workflow.png?fit=max&auto=format&n=YITfVTwoqsOOaiRq&q=85&s=09d5748aec2b1c90187c987df1c5cd3a" alt="n8n Client Workflow" width="1848" height="678" data-path="ja/images/n8n_client_workflow.png" />
    </Frame>
  </Step>

  <Step>
    Configure the MCP Client node in the Workflow:

    * **Endpoint**–enter *[https://mcp.cloud.cdata.com/mcp](https://mcp.cloud.cdata.com/mcp)*.
    * **Server Transport**–select **HTTP Streamable**.
    * **Authentication**–select **Header Auth**.

    <Frame>
      <img src="https://mintcdn.com/cdata/YITfVTwoqsOOaiRq/ja/images/n8n_client_mcp.png?fit=max&auto=format&n=YITfVTwoqsOOaiRq&q=85&s=31f0a3721198ac595375145090f08d1c" alt="n8n Client MCP" width="491" height="603" data-path="ja/images/n8n_client_mcp.png" />
    </Frame>
  </Step>

  <Step>
    Edit the **Header Auth account**. In the **Connection** tab, set the following properties to use Basic Authentication:

    * **Name**–enter *Authorization*.
    * **Value**–enter the value in the form *Bearer OAUTH\_JWT\_TOKEN*.

    <Frame>
      <img src="https://mintcdn.com/cdata/YITfVTwoqsOOaiRq/ja/images/n8n_client_connection.png?fit=max&auto=format&n=YITfVTwoqsOOaiRq&q=85&s=2ccee93c14da089c01984746ac19febd" alt="n8n Client Connection" width="831" height="647" data-path="ja/images/n8n_client_connection.png" />
    </Frame>
  </Step>

  <Step>
    (Optional) Give the AI Agent context. This establishes the AI Agent's role and provides context for the conversation through the System Message parameter in the AI Agent node. By providing a system message that explicitly informs the agent about its role as an MCP Server expert and lists the available tools, you can enhance the agent's understanding and response accuracy.

    The following is an example System Message:

    ```text theme={null}
    You are an expert at using the MCP Client tool connected which is the Connect AI MCP Server. Always search thoroughly and use the most relevant MCP Client tool for each query. Below are the available tools and a description of each:
    queryData: Execute SQL queries against connected data sources and retrieve results. When you use the queryData tool, ensure you use the following format for the table name: catalog.schema.tableName
    execData: Execute stored procedures against connected data sources
    getCatalogs: Retrieve a list of available connections from Connect AI. The connection names should be used as catalog names in other tools and in any queries to Connect AI. Use the `getSchemas` tool to get a list of available schemas for a specific catalog.
    getColumns: Retrieve a list of available database columns from Connect AI for a specific catalog, schema, and table.
    getExportedKeys: Retrieve a list of foreign key relationships from Connect AI for a specific catalog, schema, and table.
    getImportedKeys: Retrieve a list of foreign key relationships from Connect AI for a specific catalog, schema, and table.
    getIndexes: Retrieve a list of indexes from Connect AI for a specific catalog, schema, and table.
    getPrimaryKeys: Retrieve a list of primary keys from Connect AI for a specific catalog, schema, and table.
    getProcedures: Retrieve a list of stored procedures from Connect AI for a specific catalog and schema
    getProcedureParameters: Retrieve a list of stored procedure parameters from Connect AI for a specific catalog, schema, and procedure.
    getSchemas: Retrieve a list of available database schemas from Connect AI for a specific catalog. Use the `getTables` tool to get a list of available tables for a specific catalog and schema.
    getTables: Retrieve a list of available database tables from Connect AI for a specific catalog and schema. Use the `getColumns` tool to get a list of available columns for a specific table.
    ```
  </Step>

  <Step>
    Now that you created the Workflow in n8n and connected the MCP Client, you can interact with your data. The MCP Client node allows you to send queries and receive responses from the data source in real time.
  </Step>

  <Step>
    Open the Workflow in n8n and execute it to start interacting with your data. You can ask questions, retrieve data, and perform actions on your data using the MCP Client node:

    <Frame>
      <img src="https://mintcdn.com/cdata/YITfVTwoqsOOaiRq/ja/images/n8n_client_execute.png?fit=max&auto=format&n=YITfVTwoqsOOaiRq&q=85&s=a54d628c6a2bf0ff22c646245adbb91a" alt="n8n Client Execute" width="1356" height="745" data-path="ja/images/n8n_client_execute.png" />
    </Frame>
  </Step>
</Steps>
