BookStack Tool icon

BookStack Tool

Access and search BookStack knowledge base content. Use this tool to search across all content types (books, pages, chapters, shelves) in BookStack.

Overview

This node provides a tool to perform a global search across all content types within a BookStack knowledge base, including books, chapters, pages, and shelves. It is useful for quickly finding relevant documentation, guides, or any stored content by keywords or phrases. The node supports filtering results by content type and can optionally retrieve full detailed content for each found item, providing richer context.

Practical examples:

  • Searching for "installation guide" to find all related pages, chapters, or books.
  • Filtering results to only show "Books Only" when looking for comprehensive manuals.
  • Enabling deep dive to get the full content of matched pages for further processing or AI analysis.

Properties

Name Meaning
Search Query Keywords, phrases, or terms to search for in the content. Supports AI expression auto-fill.
Content Type Filter Filter search results by specific content type: All Content, Books Only, Chapters Only, Pages Only, Shelves Only.
Result Limit Maximum number of results to return (between 1 and 500).
Deep Dive Whether to automatically retrieve full content details for all found items, increasing context but also execution time.

Output

The node outputs a JSON object with the following structure:

  • operation: The operation performed ("globalSearch").
  • query: The original search query string.
  • typeFilter: The content type filter applied.
  • resultLimit: The maximum number of results requested.
  • deepDiveEnabled: Boolean indicating if full content retrieval was enabled.
  • totalFound: Total number of items found by the search.
  • summary: A human-readable summary of the search results.
  • data: An array of result objects, each containing:
    • id, name, type, url, created_at, updated_at, preview (HTML preview), tags, book, chapter.
    • If deep dive is enabled and successful, a fullContent object with additional detailed fields depending on the content type:
      • For pages: priority, revision count, draft status, HTML and markdown content.
      • For chapters: priority, description HTML, pages list.
      • For books: description HTML, contents, cover image.
      • For shelves: description HTML, books list, cover image.
    • If full content retrieval fails, an error message field contentError is included.

The output is paired with the input item index for traceability.

Dependencies

  • Requires access to a BookStack API endpoint with appropriate authentication via an API key credential.
  • Uses internal helper functions to make authenticated HTTP requests to BookStack.
  • No additional external dependencies beyond the BookStack API and n8n environment.

Troubleshooting

  • Common issues:

    • Missing or invalid API credentials will cause authentication failures.
    • Exceeding the result limit or requesting too many deep dives may increase execution time or hit API rate limits.
    • Network connectivity problems can cause request failures.
  • Error messages:

    • "BookStack API Error" indicates a failure during API communication or parameter validation.
    • "Failed to fetch full content for this item" appears if detailed content retrieval for a specific result fails; this does not stop the entire execution.
  • Resolutions:

    • Verify that the API key credential is correctly configured and has sufficient permissions.
    • Adjust the Result Limit and disable Deep Dive if performance issues occur.
    • Check network connectivity and BookStack server availability.

Links and References

Discussion