Actions15
Overview
This node interacts with Cosense (formerly Scrapbox) to read and write page data within projects. Specifically, the "Get Code Blocks" operation under the "Page" resource extracts all code blocks from a specified page in a given project.
Use cases include:
- Extracting programming code snippets or configuration blocks embedded in project pages for further processing or analysis.
- Automating documentation workflows by pulling out code examples from project notes.
- Integrating Cosense page content into other systems that require isolated code blocks.
Example: You have a project named "my-project" with a page titled "API Examples" containing multiple code blocks. Using this node operation, you can retrieve all those code blocks programmatically for use in automated testing or documentation generation.
Properties
| Name | Meaning |
|---|---|
| Project Name | The name of your Cosense/Scrapbox project where the page resides. |
| Page Title | The title of the page from which to extract all code blocks. |
Output
The output is an array of JSON objects, each representing a code block extracted from the specified page. Each object contains the raw content of a code block as stored in Cosense.
The output structure looks like:
[
{
"json": {
// code block content fields here
},
"pairedItem": {
"item": 0
}
},
...
]
json: Contains the code block data.pairedItem.item: References the input item index for traceability.
No binary data is output by this operation.
Dependencies
- Requires access to the Cosense API via an API key credential configured in n8n.
- The node uses an internal API client to communicate with Cosense endpoints.
- The user must provide valid project and page identifiers.
Troubleshooting
Common issues:
- Invalid or missing project name or page title will cause the API call to fail.
- Network connectivity problems may prevent communication with Cosense servers.
- Insufficient permissions or invalid API credentials will result in authorization errors.
Error messages:
"error": "Page not found": Verify the project name and page title are correct."error": "Unauthorized": Check that the API key credential is valid and has necessary permissions.- Timeout or network errors: Ensure stable internet connection and Cosense service availability.
To resolve errors, confirm input parameters, validate credentials, and retry.
Links and References
- Cosense Official Website
- Scrapbox Documentation (legacy)
- n8n Documentation on Creating Custom Nodes