Fetch Prompts
AI-generatedOverview
The Handit Prompt Fetcher node fetches active prompts from the Handit API for a specified agent. It converts the agent name to a camelCase slug, calls the API endpoint to retrieve production prompts, and outputs the prompts along with metadata. This node is useful for integrating dynamic prompt data into workflows, especially for use with language model nodes that require prompt variables.
Use Case Examples
- Fetch active prompts for an agent named 'My Agent Name' to dynamically update prompt variables in an LLM workflow.
- Use a custom API URL to fetch prompts from a different Handit API endpoint for a specific agent slug.
Properties
| Name | Meaning |
|---|---|
| Agent Name | The name of the agent, which is automatically converted to a camelCase slug used in the API request URL. |
| API URL | Custom API endpoint URL to fetch prompts. If left empty, the default Handit API endpoint is used, with the agent slug inserted. |
Output
JSON
agentName- The original agent name provided as input.agentSlug- The camelCase slug version of the agent name used in the API URL.fetchedAt- Timestamp when the prompts were fetched.prompts- The raw prompts object fetched from the Handit API.promptsJson- Stringified JSON representation of the prompts for easy viewing.
prompt_ - Individual prompt entries extracted from the prompts object, where is the prompt identifier.promptMetadataagentName- Agent name metadata.agentSlug- Agent slug metadata.apiEndpoint- The full API endpoint URL used to fetch the prompts.fetchedAt- Timestamp metadata for when the prompts were fetched.totalPrompts- Total number of prompts fetched.availableNodes- List of prompt keys available in the fetched prompts.
success- Boolean indicating if the fetch operation was successful.message- Success message detailing the number of prompts fetched and agent information.error- Error message if the fetch operation failed.timestamp- Timestamp of the error occurrence.
Dependencies
- Handit API credentials (API token)
Troubleshooting
- Ensure that valid Handit API credentials with an API token are provided; otherwise, the node will throw an error indicating missing credentials.
- If the API response is not a valid JSON object, the node will throw an error indicating an invalid response from the API.
- Check that the agent name is correctly provided and that the API URL contains the placeholder {agentSlug} if customized, as the agent slug is required for the API call.
Links
- Handit API Documentation - Official documentation for the Handit API endpoints and usage.