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 Step resource with the Get One operation, it retrieves detailed information about a single step by its unique identifier.

Common scenarios where this node is beneficial include:

  • Fetching metadata or results of a specific step in an AI workflow or pipeline.
  • Inspecting the details of a generation step to analyze outputs or debug issues.
  • Integrating step data retrieval into automated workflows for monitoring or reporting purposes.

For example, you might use this node to get the details of a particular generation step after it completes, then use that data downstream to trigger notifications or further processing.

Properties

Name Meaning
Step ID The unique identifier of the step to retrieve. This is required to specify which step's details to fetch.

Output

The node outputs a JSON object under the json field containing the full content of the requested step as returned by the Literal AI API. This typically includes all metadata and data associated with that step, such as identifiers, timestamps, status, and any generated content or results.

If the step involves binary data (not indicated explicitly here), it would be included accordingly, but based on the code, the output is primarily JSON content representing the step.

Example output structure (simplified):

{
  "content": {
    "id": "step-id",
    "status": "completed",
    "result": { /* step-specific data */ },
    "createdAt": "timestamp",
    "metadata": { /* additional info */ }
  }
}

Dependencies

  • Requires an API key credential for the Literal AI API to authenticate requests.
  • Uses the official Literal AI client library (@literalai/client) to interact with the API.
  • Needs proper configuration of credentials within n8n to function correctly.

Troubleshooting

  • Common Issues:

    • Invalid or missing Step ID: Ensure the Step ID provided is correct and exists in the Literal AI system.
    • Authentication errors: Verify that the API key credential is valid and has necessary permissions.
    • Network or API downtime: Check connectivity and Literal AI service status if requests fail unexpectedly.
  • Error Messages:

    • Errors from the API will be caught and can be output as error messages if "Continue On Fail" is enabled.
    • Typical errors include "Step not found" if the Step ID does not exist, or authentication failures indicating invalid API keys.
  • Resolution Tips:

    • Double-check input parameters for correctness.
    • Confirm API key validity and update if expired or revoked.
    • Use the node’s logging to inspect raw API responses for debugging.

Links and References

Discussion