Skip to content

Commit f386466

Browse files
Add n8n custom node for Codegen API integration
1 parent 5ba123b commit f386466

10 files changed

Lines changed: 647 additions & 0 deletions

File tree

n8n-node/LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Codegen
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+

n8n-node/README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# n8n-nodes-codegen
2+
3+
This is an n8n community node for integrating with the [Codegen](https://codegen.com) API. It allows you to interact with Codegen's AI-powered software engineering capabilities directly from your n8n workflows.
4+
5+
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
6+
7+
## Features
8+
9+
This node allows you to:
10+
11+
- Run Codegen agent tasks
12+
- Ask the Codegen expert system questions
13+
- Create new codemods
14+
15+
## Installation
16+
17+
Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
18+
19+
## Operations
20+
21+
### Agent
22+
23+
- **Run**: Run a Codegen agent task
24+
- **Ask Expert**: Ask the Codegen expert system a question
25+
- **Create Codemod**: Create a new codemod
26+
27+
## Credentials
28+
29+
To use this node, you need to create credentials for the Codegen API:
30+
31+
1. Get your API token from [Codegen](https://codegen.com)
32+
2. Use this token in the Codegen API credentials in n8n
33+
34+
## Resources
35+
36+
* [Codegen API Documentation](https://docs.codegen.com/introduction/api)
37+
* [n8n Community Nodes Documentation](https://docs.n8n.io/integrations/community-nodes/)
38+
39+
## Version history
40+
41+
- 0.1.0: Initial release
42+
43+
## License
44+
45+
[MIT](https://github.com/codegen-sh/codegen/blob/main/LICENSE.md)
46+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import {
2+
ICredentialType,
3+
INodeProperties,
4+
} from 'n8n-workflow';
5+
6+
export class CodegenApi implements ICredentialType {
7+
name = 'codegenApi';
8+
displayName = 'Codegen API';
9+
documentationUrl = 'https://docs.codegen.com/introduction/api';
10+
properties: INodeProperties[] = [
11+
{
12+
displayName: 'API Token',
13+
name: 'apiToken',
14+
type: 'string',
15+
typeOptions: {
16+
password: true,
17+
},
18+
default: '',
19+
required: true,
20+
description: 'The API token for Codegen API authentication',
21+
},
22+
];
23+
}
24+

n8n-node/gulpfile.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const { src, dest } = require('gulp');
2+
3+
// Copies the icon files from the nodes source folders to the dist folder
4+
function copyIcons() {
5+
return src('./nodes/**/*.svg')
6+
.pipe(dest('./dist/nodes/'));
7+
}
8+
9+
exports['build:icons'] = copyIcons;
10+

n8n-node/index.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
packageName: 'n8n-nodes-codegen',
3+
nodeTypes: {
4+
Codegen: {
5+
sourcePath: './dist/nodes/Codegen/Codegen.node.js',
6+
type: 'Codegen',
7+
},
8+
},
9+
credentialTypes: {
10+
CodegenApi: {
11+
sourcePath: './dist/credentials/CodegenApi.credentials.js',
12+
type: 'CodegenApi',
13+
},
14+
},
15+
};
16+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"node": "n8n-nodes-base.codegen",
3+
"nodeVersion": "1.0",
4+
"codexVersion": "1.0",
5+
"categories": [
6+
"Development",
7+
"AI"
8+
],
9+
"resources": {
10+
"credentialDocumentation": [
11+
{
12+
"url": "https://docs.codegen.com/introduction/api"
13+
}
14+
],
15+
"primaryDocumentation": [
16+
{
17+
"url": "https://docs.codegen.com/introduction/api"
18+
}
19+
]
20+
}
21+
}
22+

0 commit comments

Comments
 (0)