I’ve been working on building a custom node for my n8n workflow but I’m having trouble getting it to show up in my local n8n instance. The build process seems to complete without errors, but when I open n8n in my browser, I can’t find the node anywhere in the node list. I’m not sure what step I might be missing in the setup process. Has anyone experienced something similar or know what could be causing this?
import { INodeType, INodeTypeDescription } from 'n8n-workflow';
export class ChatBot implements INodeType {
description: INodeTypeDescription = {
displayName: 'ChatBot Integration',
name: 'chatBotIntegration',
icon: 'file:chatbot.svg',
group: ['communication'],
version: 1,
description: 'Connect with ChatBot service',
defaults: {
name: 'ChatBot Integration',
},
inputs: ['main'],
outputs: ['main'],
credentials: [
{
name: 'chatBotCredentials',
required: true,
}
],
requestDefaults: {
baseURL: 'https://api.example.com',
headers: {
'Content-Type': 'application/json'
}
},
properties: [
{
displayName: 'Query Text',
name: 'queryText',
type: 'string',
placeholder: 'Type your query here',
required: true,
description: 'The text query to send',
routing: {
request: {
method: 'POST',
url: '/chat'
},
},
default: 'send',
},
]
};
}
Here’s my chatbot.node.json configuration:
{
"node": "n8n-nodes-custom.ChatBot",
"nodeVersion": "1.0",
"codexVersion": "1.0",
"categories": ["Communication"],
"resources": {
"credentialDocumentation": [],
"primaryDocumentation": []
}
}
And my credentials file looks like this:
import {
IAuthenticateGeneric,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
export class ChatBotCredentials implements ICredentialType {
name = 'ChatBotCredentials';
displayName = 'ChatBot API Credentials';
documentationUrl = 'https://docs.n8n.io/integrations/creating-nodes/';
properties: INodeProperties[] = [
{
displayName: 'Access Token',
name: 'accessToken',
type: 'string',
default: '',
},
];
authenticate = {
type: 'generic',
properties: {
headers: {
'Authorization': 'Bearer {{$credentials.accessToken}}'
}
},
} as IAuthenticateGeneric;
}