PromptCache icon

PromptCache

Read prompts, versions, variables, and render templates from PromptCache

Actions7

Prompt → Get Variables

AI-generated

Summary

Retrieve variable definitions for a PromptCache prompt from its live draft or a published snapshot. Published reads use the latest version by default; you can select a specific published version.

Inputs

  • Prompt ID (required) — PromptCache prompt ID.
  • Content Source — Choose Published (default) to read a published snapshot, or Draft to read the live draft in the editor.
  • Version Number — For published content only, choose a version number; leave at 0 to resolve the latest published version.
  • PromptCache API credentials (required) — Requires an API key with prompts:read scope and a configured API base URL.

Output shape

One item per input item, containing an object with promptId, contentSource, variables, and, for published reads, resolvedVersion.

Draft reads return the variables field from the prompt variables endpoint. Published reads return the selected version's variables, or an empty array if that field is absent or not an array. API and version resolution failures stop the operation unless n8n error handling is configured.

Examples

Example 1: Read variable definitions from the latest published prompt version.

Set Prompt ID and leave Content Source as Published and Version Number at 0.

Example 2: Read variable definitions from the live draft.

Set Prompt ID and choose Draft (Live); Version Number does not apply.

Links

Discussion