Cosense icon

Cosense

Read and write pages in Cosense (formerly Scrapbox)

Overview

This node interacts with Cosense (formerly Scrapbox) to retrieve the "smart context" of a page within a project. The "smart context" refers to related pages connected by links, either directly linked pages (1-hop) or pages linked from those pages as well (2-hop). This operation is useful for understanding the network of related content around a specific page, enabling users to explore contextual relationships and navigate through connected information efficiently.

Practical examples include:

  • Gathering all pages directly linked from a given page to analyze immediate references.
  • Expanding the context to two levels of linkage to discover broader related topics.
  • Using the smart context data to build visual maps of page relationships or to generate summaries based on related content.

Properties

Name Meaning
Project Name The name of your Cosense/Scrapbox project where the page resides.
Page Title The title of the page for which to retrieve the smart context.
Context Type The depth of related pages to retrieve: either "1 Hop Links" (directly linked pages) or "2 Hop Links" (pages linked from the current page and their linked pages).

Output

The output JSON contains:

  • text: A string representing the smart context content retrieved from Cosense for the specified page and context type.
  • contextType: The selected context depth ("1hop" or "2hop") indicating how many hops of linked pages were included.
  • pageTitle: The title of the page for which the smart context was fetched.

This output provides structured textual data about related pages, useful for further processing or display in workflows.

Dependencies

  • Requires an API key credential for authenticating with the Cosense API.
  • The node depends on the external Cosense API service to fetch page and project data.
  • Proper configuration of the API credentials in n8n is necessary for successful requests.

Troubleshooting

  • Common issues:

    • Invalid or missing API credentials will cause authentication failures.
    • Incorrect project name or page title may result in "page not found" errors.
    • Requesting a large context (2-hop) on pages with many links might lead to timeouts or rate limiting by the API.
  • Error messages:

    • Authentication errors typically indicate invalid or expired API keys; verify and update credentials.
    • Not found errors suggest checking the spelling and existence of the project and page titles.
    • Rate limit errors require reducing request frequency or contacting Cosense support.

Links and References

Discussion