Skip to content

Guide

n8n integration

Read-only PromptCache community node for n8n workflows

API base URL

https://api.promptcache.app

Use the PromptCache community node in n8n to read prompts, inspect versions and variables, and render templates in workflows, without write access to your prompt library.

What the node can do

ResourceOperationPurpose
PromptListBrowse prompts in your workspace
PromptGetFetch a prompt snapshot (defaults to latest published; optional draft)
PromptGet VariablesRead variable definitions (defaults to latest published; optional draft)
VersionList VersionsView version history for a prompt
VersionGet VersionFetch a published snapshot (defaults to latest when version not specified)
RenderingPreview (Inject)Render the live draft (lenient, reports missing variables)
RenderingInvokeRender a published template (strict, fails if required vars are missing)

Write operations, create, update, delete, publish, fork, are not exposed in the n8n node.

Prerequisites

  • A PromptCache account with at least one workspace
  • n8n (self-hosted or cloud) where you can install community nodes
  • An API key with prompts:read scope

Create an API key

The n8n node uses the same pk_… API keys as the REST API and MCP read tools. You do not need a separate key type.

Required scope:

ScopeWhy
prompts:readList/get prompts, versions, variables, inject, and invoke

Optional: add other scopes only if you extend workflows beyond this node (the node itself never calls write routes).

Create an n8n API key in the dashboard , opens the key form with prompts:read pre-selected. Name it, adjust scopes if needed, then copy the key once.

Steps in the dashboard:

  1. Open API Keys in your workspace.
  2. Confirm prompts:read is selected (the link above pre-selects it).
  3. Name the key (for example n8n Integration) and click Create Key.
  4. Copy the pk_… value immediately. It is shown only once.

See Authentication for scope details and key safety.

Install the node

Install the @optiqlabs/n8n-nodes-promptcache community package from your n8n instance:

Self-hosted n8n

  1. Open SettingsCommunity nodes.
  2. Click Install.
  3. Enter the package name: @optiqlabs/n8n-nodes-promptcache
  4. Accept the risk prompt and wait for the install to finish.
  5. Restart n8n if prompted.

n8n Cloud

Community nodes must be enabled for your instance. In the n8n Cloud admin panel, allow community nodes, then install @optiqlabs/n8n-nodes-promptcache the same way as above (Settings → Community nodes → Install).

After installation, PromptCache appears in the node palette when you add a step to a workflow.

See n8n’s community node docs if your version of n8n uses a different menu path.

Configure the credential

  1. In n8n, go to CredentialsAdd credentialPromptCache API.

  2. Paste your pk_… API key.

  3. Set API Base URL to your PromptCache API origin (no /api suffix).

    Default production URL:

    Code
    https://api.promptcache.app

    Self-hosted or staging: use your API origin, for example https://api.example.com.

  4. Click Test, n8n calls GET /api/v1/organizations to verify the key.

  5. Save the credential and select it on each PromptCache node.

Configure a node

  1. Add a PromptCache node to your workflow.
  2. Select your PromptCache API credential.
  3. Choose Resource (Prompt, Version, or Rendering) and Operation.
  4. Fill in parameters:
    • Prompt ID, from the dashboard or a prior List/Get step
    • Content Source (Get / Get Variables), Published (default, latest published when Version Number is 0) or Draft (live)
    • Version Number, optional published version on Get, Get Variables, Get Version, and Invoke (0 = latest published)
    • Version ID (Get Version), optional MongoDB version document ID from List Versions
    • Variables (Rendering), JSON object, e.g. {"topic":"onboarding","tone":"friendly"}
    • Environment (Invoke), optional preview or production slot

Example: invoke a published prompt

  1. Resource: Rendering
  2. Operation: Invoke
  3. Prompt ID: your prompt’s ID
  4. Variables: {"customer_name":"Alex","issue":"billing"}
  5. Environment: Production (optional)

Output includes renderedContent, resolvedVersion, and invokedAt.

Example: preview a draft before publish

  1. Resource: Rendering
  2. Operation: Preview (Inject)
  3. Prompt ID + partial variables

Output includes renderedContent and unresolvedVariables for any placeholders still missing.

Audit and scopes

All node operations call existing REST routes guarded by prompts:read. API key usage is recorded in your workspace audit log (list, read, variables, versions, inject, invoke) with the key ID attached.