I’m developing a custom node for n8n and managed to compile it successfully. However, my local n8n environment fails to list the custom node, and I’m seeking advice to diagnose the problem.
Below are the updated code snippets for the node, configuration, and credentials:
import { INodeDefinition, INodeDefinitionDescription } from 'n8n-workflow';
export class CustomHandler implements INodeDefinition {
description: INodeDefinitionDescription = {
displayName: 'Custom Tool',
name: 'customTool',
icon: 'file:customIcon.svg',
group: ['data'],
version: 1,
description: 'Executes a custom tool action',
defaults: { name: 'Custom Tool Node' },
inputs: ['main'],
outputs: ['main'],
credentials: [{ name: 'customAuth', required: true }],
requestDefaults: {
baseURL: 'YOUR_API_ENDPOINT',
headers: {}
},
properties: [
{
displayName: 'Input Data',
name: 'inputData',
type: 'string',
placeholder: 'Enter input value',
required: true,
description: 'Provide the input value',
routing: {
request: {
method: 'GET',
url: 'YOUR_API_ENDPOINT'
}
},
default: 'defaultValue'
}
]
};
}
{
"node": "n8n-custom-nodes.CustomHandler",
"nodeVersion": "1.0",
"codexVersion": "1.0",
"categories": ["Utilities"],
"resources": {
"credentialDocumentation": [],
"primaryDocumentation": []
}
}
import { ICredentialAuth, ICredentialDefinition, INodeParameter } from 'n8n-workflow';
export class CustomAuth implements ICredentialDefinition {
name = 'CustomAuth';
displayName = 'Custom API Authentication';
documentationUrl = '';
properties: INodeParameter[] = [
{
displayName: 'API Token',
name: 'apiToken',
type: 'string',
default: ''
}
];
authenticate = {
type: 'generic',
properties: {
qs: { 'authorization': '={{$credentials.apiToken}}' }
}
} as ICredentialAuth;
}
Any suggestions to resolve the visibility issue would be greatly appreciated.