Literal AI icon

Literal AI

Use the Literal AI API

Overview

This node integrates with the Literal AI API to manage various resources related to AI experiments, datasets, users, scores, and more. Specifically, for the Experiment - Create Item operation, it allows users to create a new experiment item by providing detailed fields such as dataset experiment ID, dataset item ID, experiment run ID, input data, output data, and associated scores.

This node is beneficial in scenarios where you want to programmatically track and log individual items within an AI experiment workflow, including their inputs, outputs, and evaluation metrics. For example, after running an experiment on a dataset, you can use this node to record each experiment item’s details into the Literal AI platform for further analysis or reporting.

Properties

Name Meaning
Dataset Experiment ID The identifier of the dataset experiment to which this item belongs.
Dataset Item ID The identifier of the specific dataset item involved in the experiment.
Experiment Run ID The identifier of the particular run of the experiment.
Input JSON object representing the input data used for this experiment item.
Output JSON object representing the output data generated from this experiment item.
Scores JSON array containing score objects that evaluate or rate this experiment item.

Output

The node outputs a JSON object under the json field with a single property:

  • content: This contains the response from the Literal AI API after creating the experiment item. It typically includes details about the newly created experiment item such as its IDs, input/output data, scores, timestamps, and any other metadata returned by the API.

No binary data output is produced by this operation.

Dependencies

  • Requires an active connection to the Literal AI API.
  • Needs an API key credential configured in n8n to authenticate requests to the Literal AI service.
  • The node uses the official Literal AI client library (@literalai/client) bundled within the node code.

Troubleshooting

  • Invalid JSON in Input Fields: The properties input, output, and scores expect valid JSON strings. Malformed JSON will cause parsing errors. Ensure these fields contain properly formatted JSON.
  • Missing Required Fields: Omitting required identifiers like datasetExperimentId or datasetItemId may result in API errors. Verify all necessary IDs are provided.
  • API Authentication Errors: If the API key credential is missing or invalid, the node will fail to authenticate. Confirm the API key is correctly set up in n8n credentials.
  • Network Issues: Connectivity problems with the Literal AI API endpoint can cause timeouts or failures. Check network access and API availability.
  • Error Handling: If the node is set to continue on failure, errors will be returned in the output JSON under an error property; otherwise, execution will stop on the first error.

Links and References

Discussion