Literal AI icon

Literal AI

Use the Literal AI API

Overview

This node integrates with the Literal AI API to perform various operations on different resources such as users, scores, projects, steps, files, threads, datasets, experiments, and prompts. Specifically, for the Prompt resource with the Get By ID operation, it retrieves a prompt's details by its unique identifier.

Common scenarios where this node is beneficial include:

  • Fetching detailed information about a specific prompt stored in the Literal AI system.
  • Integrating prompt data retrieval into automated workflows, e.g., to analyze or reuse prompt configurations.
  • Managing prompt lifecycle by querying existing prompts before updates or deletions.

Practical example:

  • You have a prompt ID from a previous step or external source and want to fetch all associated metadata and configuration of that prompt to use in subsequent processing or decision-making within your workflow.

Properties

Name Meaning
Prompt ID The unique identifier of the prompt to retrieve. This is a required string input.

Output

The node outputs a JSON object under the content field containing the full details of the requested prompt as returned by the Literal AI API. This typically includes all metadata, settings, tools, template messages, and other relevant prompt information.

If an error occurs during the API call and the node is configured to continue on failure, the output will contain an error field with the error message.

No binary data output is produced by this operation.

Example output structure (simplified):

{
  "content": {
    "id": "string",
    "name": "string",
    "templateMessages": [ /* array of message objects */ ],
    "settings": { /* optional settings object */ },
    "tools": { /* optional tools object */ },
    "metadata": { /* additional metadata if any */ }
  }
}

Dependencies

  • Requires an active connection to the Literal AI API via an API key credential.
  • The node expects the API key to be configured in n8n credentials prior to execution.
  • No other external dependencies are needed.

Troubleshooting

  • Common issues:

    • Invalid or missing Prompt ID: Ensure the Prompt ID provided is correct and exists in the Literal AI system.
    • Authentication errors: Verify that the API key credential is correctly set up and has sufficient permissions.
    • Network or API downtime: Check network connectivity and Literal AI service status.
  • Error messages:

    • "Prompt not found": The specified Prompt ID does not exist. Double-check the ID.
    • "Unauthorized" or "Invalid API key": The API key credential is invalid or expired. Update the credential.
    • Other HTTP or API errors: Review the error message for details; consider enabling "Continue On Fail" to handle gracefully.

Links and References

Discussion