Skip to content

Commit ecd5bf8

Browse files
authored
docs: Restructure README and Move Sample Code to Docs (#11)
2 parents b3061fd + 80f85b0 commit ecd5bf8

File tree

5 files changed

+443
-57
lines changed

5 files changed

+443
-57
lines changed

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2022 n8n
1+
Copyright 2025 Jakub Slys
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of
44
this software and associated documentation files (the "Software"), to deal in

README.md

Lines changed: 67 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,82 @@
1-
![Banner image](https://user-images.githubusercontent.com/10284570/173569848-c624317f-42b1-45a6-ab09-f0ea3c247648.png)
1+
# n8n-nodes-substack
22

3-
# n8n-nodes-starter
3+
[![npm version](https://badge.fury.io/js/n8n-nodes-substack.svg)](https://badge.fury.io/js/n8n-nodes-substack)
4+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
45

5-
This repo contains example nodes to help you get started building your own custom integrations for [n8n](https://n8n.io). It includes the node linter and other dependencies.
6+
This n8n community node allows interaction with the Substack API, enabling you to automate content creation and management workflows directly from n8n.
67

7-
To make your custom node available to the community, you must create it as an npm package, and [submit it to the npm registry](https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry).
8+
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
89

9-
If you would like your node to be available on n8n cloud you can also [submit your node for verification](https://docs.n8n.io/integrations/creating-nodes/deploy/submit-community-nodes/).
10+
## Features
1011

11-
## Prerequisites
12+
- **Authenticate with Substack**: Secure API key authentication
13+
- **Create Notes**: Publish Substack notes programmatically
14+
- **Future Features** (coming soon):
15+
- Fetch subscribers and manage mailing lists
16+
- Create and publish full posts
17+
- Access publication statistics and analytics
1218

13-
You need the following installed on your development machine:
19+
## Quick Start
1420

15-
* [git](https://git-scm.com/downloads)
16-
* Node.js and npm. Minimum version Node 20. You can find instructions on how to install both using nvm (Node Version Manager) for Linux, Mac, and WSL [here](https://github.com/nvm-sh/nvm). For Windows users, refer to Microsoft's guide to [Install NodeJS on Windows](https://docs.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-windows).
17-
* Install n8n with:
18-
```
19-
npm install n8n -g
20-
```
21-
* Recommended: follow n8n's guide to [set up your development environment](https://docs.n8n.io/integrations/creating-nodes/build/node-development-environment/).
21+
Here's a simple workflow that creates a Substack note:
2222

23-
## Using this starter
23+
```json
24+
{
25+
"nodes": [
26+
{
27+
"name": "Create Substack Note",
28+
"type": "n8n-nodes-substack.substack",
29+
"parameters": {
30+
"resource": "note",
31+
"operation": "create",
32+
"title": "Hello from n8n!",
33+
"body": "This note was created automatically using n8n."
34+
},
35+
"credentials": {
36+
"substackApi": "your-credential-id"
37+
}
38+
}
39+
]
40+
}
41+
```
2442

25-
These are the basic steps for working with the starter. For detailed guidance on creating and publishing nodes, refer to the [documentation](https://docs.n8n.io/integrations/creating-nodes/).
43+
## Installation
2644

27-
1. [Generate a new repository](https://github.com/n8n-io/n8n-nodes-starter/generate) from this template repository.
28-
2. Clone your new repo:
29-
```
30-
git clone https://github.com/<your organization>/<your-repo-name>.git
31-
```
32-
3. Run `npm i` to install dependencies.
33-
4. Open the project in your editor.
34-
5. Browse the examples in `/nodes` and `/credentials`. Modify the examples, or replace them with your own nodes.
35-
6. Update the `package.json` to match your details.
36-
7. Run `npm run lint` to check for errors or `npm run lintfix` to automatically fix errors when possible.
37-
8. Test your node locally. Refer to [Run your node locally](https://docs.n8n.io/integrations/creating-nodes/test/run-node-locally/) for guidance.
38-
9. Replace this README with documentation for your node. Use the [README_TEMPLATE](README_TEMPLATE.md) to get started.
39-
10. Update the LICENSE file to use your details.
40-
11. [Publish](https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry) your package to npm.
45+
### n8n Cloud
4146

42-
## More information
47+
1. Go to **Settings** > **Community Nodes**
48+
2. Click **Install a community node**
49+
3. Enter `n8n-nodes-substack`
50+
4. Click **Install**
4351

44-
Refer to our [documentation on creating nodes](https://docs.n8n.io/integrations/creating-nodes/) for detailed information on building your own nodes.
52+
### Self-hosted n8n
53+
54+
Install the node in your n8n installation directory:
55+
56+
```bash
57+
npm install n8n-nodes-substack
58+
```
59+
60+
Then restart your n8n instance.
61+
62+
### Credentials Setup
63+
64+
1. Add the Substack node to your workflow
65+
2. Create new credentials with:
66+
- **Publication Address**: Your Substack domain (e.g., `myblog.substack.com`)
67+
- **API Key**: Your Substack API key
68+
69+
## Documentation
70+
71+
For comprehensive usage instructions, configuration options, and examples:
72+
73+
📖 **[Full Documentation](docs/n8n-usage.md)**
74+
75+
Additional resources:
76+
- [API Reference](docs/api-reference.md)
77+
- [Examples](docs/examples.md)
78+
- [Development Guide](docs/development.md)
4579

4680
## License
4781

48-
[MIT](https://github.com/n8n-io/n8n-nodes-starter/blob/master/LICENSE.md)
82+
[MIT](LICENSE.md)

docs/examples.md

Lines changed: 162 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,168 @@
11
# Examples
22

3-
This section provides practical examples of using the Substack API client in various scenarios.
3+
This section provides practical examples for both the n8n Substack node and the underlying API client.
4+
5+
## n8n Workflow Examples
6+
7+
### Basic Note Creation
8+
9+
Simple workflow to create a Substack note:
10+
11+
```json
12+
{
13+
"meta": {
14+
"instanceId": "your-instance-id"
15+
},
16+
"nodes": [
17+
{
18+
"parameters": {
19+
"resource": "note",
20+
"operation": "create",
21+
"title": "My First Note",
22+
"body": "This is the content of my note."
23+
},
24+
"id": "substack-node",
25+
"name": "Substack",
26+
"type": "n8n-nodes-substack.substack",
27+
"typeVersion": 1,
28+
"position": [250, 300],
29+
"credentials": {
30+
"substackApi": {
31+
"id": "your-credential-id",
32+
"name": "Substack API"
33+
}
34+
}
35+
}
36+
],
37+
"connections": {}
38+
}
39+
```
40+
41+
### Automated Content Publishing
42+
43+
Workflow that creates a note when a webhook is triggered:
44+
45+
```json
46+
{
47+
"meta": {
48+
"instanceId": "your-instance-id"
49+
},
50+
"nodes": [
51+
{
52+
"parameters": {
53+
"path": "publish-note",
54+
"options": {}
55+
},
56+
"id": "webhook-trigger",
57+
"name": "Webhook",
58+
"type": "n8n-nodes-base.webhook",
59+
"typeVersion": 1,
60+
"position": [100, 300],
61+
"webhookId": "your-webhook-id"
62+
},
63+
{
64+
"parameters": {
65+
"resource": "note",
66+
"operation": "create",
67+
"title": "={{$json.title}}",
68+
"body": "={{$json.content}}"
69+
},
70+
"id": "substack-node",
71+
"name": "Substack",
72+
"type": "n8n-nodes-substack.substack",
73+
"typeVersion": 1,
74+
"position": [400, 300],
75+
"credentials": {
76+
"substackApi": {
77+
"id": "your-credential-id",
78+
"name": "Substack API"
79+
}
80+
}
81+
}
82+
],
83+
"connections": {
84+
"Webhook": {
85+
"main": [
86+
[
87+
{
88+
"node": "Substack",
89+
"type": "main",
90+
"index": 0
91+
}
92+
]
93+
]
94+
}
95+
}
96+
}
97+
```
98+
99+
### Content Scheduling with Cron
100+
101+
Schedule regular content publication:
102+
103+
```json
104+
{
105+
"meta": {
106+
"instanceId": "your-instance-id"
107+
},
108+
"nodes": [
109+
{
110+
"parameters": {
111+
"rule": {
112+
"interval": [
113+
{
114+
"triggerAtHour": 9,
115+
"triggerAtMinute": 0,
116+
"weekdays": [1, 3, 5]
117+
}
118+
]
119+
}
120+
},
121+
"id": "cron-trigger",
122+
"name": "Cron",
123+
"type": "n8n-nodes-base.cron",
124+
"typeVersion": 1,
125+
"position": [100, 300]
126+
},
127+
{
128+
"parameters": {
129+
"resource": "note",
130+
"operation": "create",
131+
"title": "Weekly Update - {{$now.format('MMMM Do, YYYY')}}",
132+
"body": "Here's your weekly update for this week..."
133+
},
134+
"id": "substack-node",
135+
"name": "Substack",
136+
"type": "n8n-nodes-substack.substack",
137+
"typeVersion": 1,
138+
"position": [400, 300],
139+
"credentials": {
140+
"substackApi": {
141+
"id": "your-credential-id",
142+
"name": "Substack API"
143+
}
144+
}
145+
}
146+
],
147+
"connections": {
148+
"Cron": {
149+
"main": [
150+
[
151+
{
152+
"node": "Substack",
153+
"type": "main",
154+
"index": 0
155+
}
156+
]
157+
]
158+
}
159+
}
160+
}
161+
```
162+
163+
## API Client Examples
4164

5-
## Basic Usage
165+
## API Client Examples
6166

7167
### Initialize the Client
8168

docs/index.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
# Substack API Documentation
1+
# n8n Substack Node Documentation
22

3-
Welcome to the Substack API client documentation. This TypeScript library provides a simple interface to interact with Substack publications, posts, and comments.
3+
Welcome to the n8n Substack community node documentation. This node allows you to integrate Substack with your n8n workflows.
44

5-
## Features
5+
## For n8n Users
66

7-
- Fetch publication details
8-
- Get and search posts
9-
- Access comments
10-
- Pagination support
11-
- TypeScript support
12-
- Error handling
13-
- Configurable API version
7+
- **[n8n Usage Guide](n8n-usage.md)** - Complete guide for using the Substack node in n8n workflows
8+
- **[Installation](installation.md)** - How to install and set up the node
9+
- **[Examples](examples.md)** - Workflow examples and use cases
10+
11+
## For Developers
12+
13+
- **[Development Guide](development.md)** - Contributing to the node development
14+
- **[API Reference](api-reference.md)** - Technical API documentation
15+
- **[Changelog](changelog.md)** - Version history and updates
1416

1517
## Quick Links
1618

17-
- [GitHub Repository](https://github.com/jakub-k-slys/substack-api)
18-
- [NPM Package](https://www.npmjs.com/package/substack-api)
19-
- [Issue Tracker](https://github.com/jakub-k-slys/substack-api/issues)
19+
- [GitHub Repository](https://github.com/jakub-k-slys/n8n-nodes-substack)
20+
- [NPM Package](https://www.npmjs.com/package/n8n-nodes-substack)
21+
- [Issue Tracker](https://github.com/jakub-k-slys/n8n-nodes-substack/issues)
22+
- [n8n Community](https://community.n8n.io/)
2023

21-
## Contents
24+
## Support
2225

23-
- [Introduction](introduction.md)
24-
- [Installation](installation.md)
25-
- [Quickstart](quickstart.md)
26-
- [API Reference](api-reference.md)
27-
- [Examples](examples.md)
28-
- [Development](development.md)
29-
- [Changelog](changelog.md)
26+
For questions and support:
27+
- Check the [n8n Usage Guide](n8n-usage.md) for common issues
28+
- Visit the [n8n Community Forum](https://community.n8n.io/)
29+
- Report bugs in our [GitHub Issues](https://github.com/jakub-k-slys/n8n-nodes-substack/issues)

0 commit comments

Comments
 (0)