Package Information
Available Nodes
Documentation
n8n-nodes-cosense
This is an n8n community node. It lets you integrate Cosense (formerly Scrapbox) into your n8n workflows.
Cosense is a collaborative documentation platform that allows teams to create, share, and organize knowledge using a unique wiki-style interface with real-time collaboration features.
n8n is a fair-code licensed workflow automation platform.
Installation
Follow the installation guide in the n8n community nodes documentation.
npm
npm install n8n-nodes-cosense
n8n UI
- Open your n8n instance
- Go to Settings > Community Nodes
- Select Install
- Enter
n8n-nodes-cosensein the npm Package Name field - Agree to the risks of using community nodes
- Select Install
Authentication
This node supports two authentication methods:
1. Session Cookie Authentication (Default)
- Works for all operations (read and write)
- Requires a session ID from Cosense
How to get your Session ID:
- Log in to your Cosense account in a web browser
- Open Developer Tools (F12)
- Go to the Application/Storage tab
- Find Cookies for
scrapbox.io - Copy the value of
connect.sid
2. Service Account Authentication (Business Plan Only)
- Read-only access to Private Projects
- Available only for Business Plan users
- Limited to same-project API access
How to get your Service Account Key:
- Go to your Project Settings
- Navigate to the Service Accounts tab
- Generate a new Service Account Access Key
Operations
This node supports the following operations:
Get Page
Retrieve a specific page by title.
Parameters:
- Project Name (required)
- Page Title (required)
List Pages
Get a list of pages in a project.
Parameters:
- Project Name (required)
- Limit (optional, default: 100)
- Skip (optional, default: 0)
Search Pages
Search for pages using keywords.
Parameters:
- Project Name (required)
- Search Query (required)
- Search Type: Title Search or Full-text Search
- Limit (optional, default: 50)
Create Page
Create a new page in a project.
Parameters:
- Project Name (required)
- Page Title (required)
- Content (required)
Note: Requires Session Cookie authentication.
Insert Lines
Insert text at a specific line in an existing page.
Parameters:
- Project Name (required)
- Page Title (required)
- Line Number (required)
- Text to Insert (required)
Note: Requires Session Cookie authentication.
Example Usage
Basic Page Retrieval
- Add a Cosense node to your workflow
- Select "Get Page" as the operation
- Enter your project name and page title
- Execute the node
Batch Processing Pages
- Use List Pages to get all pages
- Connect to a Loop node
- Process each page individually
- Use Insert Lines to update pages with results
Search and Update Workflow
- Search Pages with specific keywords
- Filter results based on criteria
- Update matching pages with new content
Error Handling
The node includes comprehensive error handling:
- Authentication errors (401): Check your credentials
- Not found errors (404): Verify project name and page title
- Conflict errors (409): Page already exists (for Create Page)
- Rate limiting (429): Automatic retry with exponential backoff
- Maximum 3 retries
- Delays: 1s, 2s, 4s (up to 60s max)
- Transparent to workflow execution
Enable "Continue On Fail" in node settings to handle errors gracefully in your workflows.
Resources
Development
# Install dependencies
npm install
# Build the node
npm run build
# Run tests
npm test
# Run integration tests (requires .env configuration)
npm run test:integration
# Lint the code
npm run lint
Integration Tests
To run integration tests against the actual Cosense API:
- Copy
.env.exampleto.env - Fill in your Cosense credentials:
COSENSE_PROJECT_NAME: Your project nameCOSENSE_SID: Your session ID (for full access)COSENSE_SERVICE_ACCOUNT_KEY: Your service account key (optional, read-only)
- Run
npm run test:integration
Note: Integration tests will create test pages in your specified project. Make sure to use a test project.