Overview
This node allows users to execute a prompt on the LetPrompt platform by sending a request with specified parameters. It is useful for scenarios where you want to run predefined prompts hosted on LetPrompt and retrieve their results within an n8n workflow. For example, you might use this node to automate interactions with AI models or custom scripts defined as prompts on LetPrompt, passing dynamic variables and receiving structured output.
Properties
| Name | Meaning |
|---|---|
| Authentication | Method of authentication; currently supports "LetPrompt API" only. |
| Connector Token | A secret token associated with the connector/model used to authenticate the prompt run. |
| Prompt ID | The unique identifier of the prompt to be executed on LetPrompt. |
| Prompt Parameters | JSON object containing variables and parameters to pass into the prompt execution. |
Output
The node outputs a JSON array where each element corresponds to the result of executing the prompt for each input item. The structure of each output item depends on the response from LetPrompt:
- If the response
datafield is an array of objects, these objects are spread into the output array. - If the response
datais an array of non-object values, they are wrapped inside an object under thedatakey. - If the response
datais a single object, it is pushed directly. - Otherwise, the data is wrapped in an object under the
datakey.
No binary data output is produced by this node.
Dependencies
- Requires access to the LetPrompt API via an API key credential.
- The user must provide a valid connector token related to the model/prompt.
- The node uses HTTP POST requests to the LetPrompt API endpoint
/v1/run-prompt. - Proper configuration of the API base URL and authentication credentials in n8n is necessary.
Troubleshooting
- Invalid or missing Connector Token: The prompt execution will fail if the connector token is incorrect or not provided. Ensure the token matches the one assigned to your model on LetPrompt.
- Incorrect Prompt ID: Using an invalid prompt ID will cause errors or empty responses. Verify the prompt ID is correct.
- Malformed Prompt Parameters: The
paramsproperty expects valid JSON. Invalid JSON or incorrect variable names may cause the API to reject the request. - API Authentication Errors: If the API key credential is missing or invalid, the node will throw authentication errors. Check that the API key is correctly configured in n8n.
- Error Handling: If an error occurs during execution, the node either stops or continues based on the "Continue On Fail" setting. When continuing, the error details are included in the output for the failed item.
Links and References
- LetPrompt API Documentation (assumed based on base URL)
- n8n documentation on HTTP Request Node for understanding request options and authentication handling