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
| Resource | Operation | Purpose |
|---|---|---|
| Prompt | List | Browse prompts in your workspace |
| Prompt | Get | Fetch a prompt snapshot (defaults to latest published; optional draft) |
| Prompt | Get Variables | Read variable definitions (defaults to latest published; optional draft) |
| Version | List Versions | View version history for a prompt |
| Version | Get Version | Fetch a published snapshot (defaults to latest when version not specified) |
| Rendering | Preview (Inject) | Render the live draft (lenient, reports missing variables) |
| Rendering | Invoke | Render 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:readscope
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:
| Scope | Why |
|---|---|
prompts:read | List/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:
- Open API Keys in your workspace.
- Confirm prompts:read is selected (the link above pre-selects it).
- Name the key (for example
n8n Integration) and click Create Key. - 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
- Open Settings → Community nodes.
- Click Install.
- Enter the package name:
@optiqlabs/n8n-nodes-promptcache - Accept the risk prompt and wait for the install to finish.
- 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
-
In n8n, go to Credentials → Add credential → PromptCache API.
-
Paste your
pk_…API key. -
Set API Base URL to your PromptCache API origin (no
/apisuffix).Default production URL:
Codehttps://api.promptcache.appSelf-hosted or staging: use your API origin, for example
https://api.example.com. -
Click Test, n8n calls
GET /api/v1/organizationsto verify the key. -
Save the credential and select it on each PromptCache node.
Configure a node
- Add a PromptCache node to your workflow.
- Select your PromptCache API credential.
- Choose Resource (Prompt, Version, or Rendering) and Operation.
- 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
previeworproductionslot
Example: invoke a published prompt
- Resource: Rendering
- Operation: Invoke
- Prompt ID: your prompt’s ID
- Variables:
{"customer_name":"Alex","issue":"billing"} - Environment: Production (optional)
Output includes renderedContent, resolvedVersion, and invokedAt.
Example: preview a draft before publish
- Resource: Rendering
- Operation: Preview (Inject)
- 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.
Related guides
- Authentication, API keys and scopes
- Prompts API, HTTP reference for invoke and inject
- Using MCP in Claude, similar read/render tools for AI assistants
