Literal AI icon

Literal AI

Use the Literal AI API

Overview

This node integrates with the Literal AI API to manage and interact with various AI-related resources, including prompts. Specifically, for the Prompt - Get operation, it retrieves a particular version of a prompt by its name. This is useful when you want to fetch the details or configuration of an existing prompt in your AI workflows.

Common scenarios include:

  • Retrieving a specific prompt version to use as input for AI generation steps.
  • Auditing or reviewing prompt configurations stored in Literal AI.
  • Integrating prompt data into automated pipelines where prompt versions matter.

Example: You have multiple versions of a prompt named "CustomerSupportBot" and want to fetch version 3 to test or deploy it.

Properties

Name Meaning
Name The unique name identifier of the prompt to retrieve.
Version The version number of the prompt to fetch (default is 1).

Output

The node outputs a JSON object under the content field containing the prompt data retrieved from the Literal AI API. This typically includes all relevant prompt details such as template messages, settings, tools, metadata, and version information.

No binary data output is involved in this operation.

Example output structure (simplified):

{
  "content": {
    "name": "ExamplePrompt",
    "version": 1,
    "templateMessages": [...],
    "settings": {...},
    "tools": [...],
    "metadata": {...}
  }
}

Dependencies

  • Requires an API key credential for the Literal AI service configured in n8n.
  • Depends on the external @literalai/client library to communicate with the Literal AI API.

Troubleshooting

  • Error: Invalid API Key or Authentication Failed
    Ensure that the API key credential is correctly set up and has the necessary permissions.

  • Error: Prompt Not Found
    Verify that the prompt name and version exist in the Literal AI system.

  • JSON Parsing Errors
    Some properties expect JSON strings (e.g., additional fields in other operations). For the Get operation, this is not applicable, but ensure inputs are correct if extending usage.

  • Network or API Errors
    Check network connectivity and Literal AI service status.

Links and References

Discussion