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

# n8n integration guide

n8n is a no-/low-code workflow automation framework. This guide shows you how to connect [SambaCloud](https://cloud.sambanova.ai?utm_source=n8n\&utm_medium=external\&utm_campaign=cloud_signup) models to n8n through its OpenAI-compatible Chat Model node.

## Prerequisites

Before you begin, ensure you have:

* An n8n account, cloud or self-hosted, on a current release. The Advanced AI cluster nodes this guide uses have shipped since the 1.x line and n8n is now on 2.x, so any maintained version has them. If you self-host an older build, confirm **AI Agent** appears in the node search before going further
* A SambaCloud API key. Get one by creating a [SambaCloud](https://cloud.sambanova.ai?utm_source=n8n\&utm_medium=external\&utm_campaign=cloud_signup) account and generating a key from the API keys tab

<Note>
  The OpenAI Chat Model node is a sub-node – it can't run on its own. It must be attached to a root node such as **AI Agent** or **Basic LLM Chain**. This guide uses AI Agent.
</Note>

## Open or create a workflow

Log in to the n8n platform and select the **+** button. Alternatively, select the **Create Workflow** button to start a new workflow.

<Frame>
  <img src="https://mintcdn.com/sambanova-systems/tKEjjixpklKce6C2/images/docs/integrations/n8n/n8n_new.png?fit=max&auto=format&n=tKEjjixpklKce6C2&q=85&s=3caaf635df60a334ca6a78d74aa91ea6" alt="n8n workflow editor with the Create Workflow button" width="3023" height="1420" data-path="images/docs/integrations/n8n/n8n_new.png" />
</Frame>

## Add an AI Agent node

On the canvas, select **Add first step** or the **+** button, search for **AI Agent**, and add it. The AI Agent node is the root node that runs the model and any tools you attach. It appears on the canvas with empty connector slots underneath, one of which is **Chat Model**.

## Add the OpenAI Chat Model sub-node

Select the **+** on the AI Agent node's **Chat Model** connector and choose **OpenAI Chat Model**. SambaCloud is OpenAI-compatible, so this node works against it without a SambaNova-specific node.

<Frame>
  <img src="https://mintcdn.com/sambanova-systems/tKEjjixpklKce6C2/images/docs/integrations/n8n/n8n_openai.png?fit=max&auto=format&n=tKEjjixpklKce6C2&q=85&s=fc4f762eea9432de34a740fdbe0e4943" alt="n8n canvas with an OpenAI Chat Model sub-node connected to an AI Agent node" width="3024" height="1417" data-path="images/docs/integrations/n8n/n8n_openai.png" />
</Frame>

## Configure your credentials

In the OpenAI Chat Model panel, open the **Credential to connect with** dropdown and select **Create new credential**. Enter your SambaCloud API key as the **API Key**, then set **Base URL** to `https://api.sambanova.ai/v1`.

<Frame>
  <img src="https://mintcdn.com/sambanova-systems/tKEjjixpklKce6C2/images/docs/integrations/n8n/n8n_credential.png?fit=max&auto=format&n=tKEjjixpklKce6C2&q=85&s=43c376779b102925efb0f8394dad7f47" alt="n8n OpenAI Chat Model panel showing the Credential to connect with dropdown" width="1067" height="707" data-path="images/docs/integrations/n8n/n8n_credential.png" />
</Frame>

The **Base URL** field is the part that is easy to miss. Leave it at its OpenAI default and every request goes to OpenAI with a SambaNova key, which fails on the first call rather than at save time.

<Frame>
  <img src="https://mintcdn.com/sambanova-systems/tKEjjixpklKce6C2/images/docs/integrations/n8n/n8n_api.png?fit=max&auto=format&n=tKEjjixpklKce6C2&q=85&s=ff80d86b4e50503bdfada289c1888cfb" alt="n8n credential panel with the SambaNova API key and base URL filled in" width="1184" height="631" data-path="images/docs/integrations/n8n/n8n_api.png" />
</Frame>

Save the credential. n8n runs a connection test and shows **Connection tested successfully** when the key and Base URL are both accepted.

## Select a model

Click the **Model** dropdown. n8n populates it by calling `/models` on the Base URL you configured, so once the credential saves you see SambaCloud's current catalog.

| Your workflow | Model to pick |
| :- | :- |
| An agent that calls tools, which is most AI Agent workflows | `Meta-Llama-3.3-70B-Instruct` |
| Reads images, and attaches no tools | `gemma-4-31B-it` |

<Warning>
  These two needs cannot be met by one model today. AI Agent drives tools through function calling, and `gemma-4-31B-it` is not listed under [Function calling](/docs/en/features/function-calling), so an agent on gemma with tools attached answers from the model alone and never calls them. Nothing in the n8n execution log reports this, so it reads as the agent ignoring your tools. Pick `gemma-4-31B-it` only for image input without tools.
</Warning>

<Frame>
  <img src="https://mintcdn.com/sambanova-systems/tKEjjixpklKce6C2/images/docs/integrations/n8n/n8n_model.png?fit=max&auto=format&n=tKEjjixpklKce6C2&q=85&s=d345da06a53f4aeba17a06fdc1d9d9eb" alt="n8n OpenAI Chat Model panel showing the Model dropdown" width="1047" height="1060" data-path="images/docs/integrations/n8n/n8n_model.png" />
</Frame>

<Note>
  The model IDs in the screenshot above are from an earlier catalog and several have since been retired. Trust the dropdown, which lists what SambaCloud serves right now, over the names in the image. You can check the same list yourself with `curl https://api.sambanova.ai/v1/models`, which needs no API key, or see [SambaCloud models](/docs/en/models/sambacloud-models).
</Note>

If the dropdown is empty, see [Troubleshooting](#troubleshooting).

## Troubleshooting

<AccordionGroup>
  <Accordion title="Model dropdown is empty">
    This usually means the credential test succeeded but the `/models` call failed. Confirm the Base URL is exactly `https://api.sambanova.ai/v1` with no trailing slash issues, and that the API key is valid.
  </Accordion>

  <Accordion title="Credential test passes but the node returns a 404 at runtime">
    This was reported against n8n's standalone **OpenAI** node (v2, "Message a model") with a custom Base URL: the credential test passes because it and the runtime node do not build the same final URL. See [n8n-io/n8n#21651](https://github.com/n8n-io/n8n/issues/21651), filed against a different OpenAI-compatible provider and closed as completed on 2026-05-26, so a current n8n should not hit it.

    If you do, check whether `/v1` ends up missing or duplicated in the final URL, and use the **OpenAI Chat Model** sub-node with AI Agent as this guide does, which was unaffected.
  </Accordion>

  <Accordion title="Agent doesn't use tools you've attached">
    Two causes. Built-in tool calling with the OpenAI Chat Model node works only when it is connected to an **AI Agent** node, not a Basic LLM Chain. If you are already on AI Agent, check the model: tool calling needs a model listed under [Function calling](/docs/en/features/function-calling), and `gemma-4-31B-it` is not one of them, so an agent using it answers without ever calling your tools and logs no error.
  </Accordion>

  <Accordion title="401 Unauthorized">
    Re-check the API key was copied without extra whitespace, and that it hasn't been revoked in the SambaCloud dashboard.
  </Accordion>
</AccordionGroup>

## Example: Household budgeting agent

For a concrete example, check out [this sample workflow](https://github.com/sambanova/integrations/tree/main/n8n) that builds a simple household budgeting agent. It can serve as a template for building more advanced agentic workflows using SambaCloud and n8n.
