Guides

n8n

Use your stack as the language model behind any n8n AI node, through the n8n-nodes-stac community package.

n8n-nodes-stac is a community node package that adds a Stac Chat Model sub-node to n8n. It plugs into the Model input of any AI root node — AI Agent, Basic LLM Chain, Question and Answer Chain — so a workflow runs on your stack instead of a per-token provider.

The node talks to the same OpenAI-compatible surface as everything else here, so nothing about your stack changes: same key, same base URL, same fixed monthly price no matter how often the workflow fires.

Install the node

  1. Open Settings → Community nodes

    You need to be the instance owner. See n8n's installation guide if the section isn't there.

  2. Install n8n-nodes-stac

    Click Install a community node, enter the package name, accept the risks prompt, and install. n8n restarts the node registry on its own — no container restart needed.

  3. Or install it manually

    On a self-hosted instance you can skip the GUI and install into n8n's custom nodes directory:

    bash
    cd ~/.n8n/nodes
    npm install n8n-nodes-stac

    Restart n8n afterwards.

Create the credential

The package ships one credential type, Stac API, shared by every node in it.

FieldValue
API KeyA key from your stack's API keys page. Stored encrypted by n8n and never shown again after saving
Base URLhttps://api.trystac.com/v1 — leave it unless you were given a dedicated endpoint

Authentication is a bearer token (Authorization: Bearer <key>), the same as every other Stac client. The credential's Test button calls GET /v1/models, so a green test confirms the key and the base URL in one shot.

Add it to a workflow

  1. Add an AI root node

    An AI Agent is the usual starting point, but any node with a Model input works.

  2. Connect Stac Chat Model to its Model input

    Search for "Stac" in the node panel — it's listed under Language Models → Chat Models.

  3. Pick the model

    The Model dropdown is populated at edit time from GET /v1/models, so it lists exactly what your key can call — for most plans that's a single entry, the model your stack runs.

Parameters

Everything except Model lives under Options and is optional.

ParameterDefaultNotes
ModelRequired. Loaded from your plan; can also be set with an expression
Sampling Temperature0.702. Lower is more deterministic
Maximum Number of Tokens2048Upper bound on generated tokens. The API clamps to its own floor and ceiling — see Chat completions
Timeout120000Milliseconds. Under saturation Stac degrades speed rather than failing, so a tight timeout cuts off responses that would have arrived
Max Retries2Retries per failed request

How it plugs into n8n

The node builds the model through supplyModel from @n8n/ai-node-sdk, which n8n provides at runtime. Two consequences worth knowing:

  • No bundled LangChain. n8n-workflow and @n8n/ai-node-sdk are peer dependencies, so the process keeps a single @langchain/core instance instead of two fighting over it.
  • Executions are traced by n8n itself. Model calls show up in n8n's own logging and tracing view, with prompts and token counts, not just as an opaque HTTP call.

Developed and tested against n8n 2.36.9. Older releases ship earlier versions of that SDK and are untested.

Troubleshooting

  • Model dropdown is empty. The credential can't reach GET {baseUrl}/models — wrong key, wrong base URL, or the instance has no outbound network access. Run the credential test to see which.
  • 401 invalid_api_key. The key was revoked or belongs to a deleted stack. Generate a new one; see Errors.
  • 429 on a busy workflow. Rate limits are per key. Give n8n its own key so a retry storm in a workflow doesn't throttle your application.
  • Node doesn't appear after installing. Check that N8N_COMMUNITY_PACKAGES_ENABLED isn't set to false, then reload the editor.

Resources

Next steps

  • OpenAI compatibility — the surface the node speaks, and what differs from OpenAI.
  • Authentication — key format, scoping, rotation.
  • Knowledge base — ground workflow answers in your own documents, with no retrieval nodes in the canvas.