Custom node is not visible on n8n local - Stack Overflow

I am trying to creating a custom node for n8n. I've successfully built the node, but when I check

I am trying to creating a custom node for n8n. I've successfully built the node, but when I check the n8n local instance on my website, I don't see my custom node listed. Could anyone please help me troubleshoot this issue.

import { INodeType, INodeTypeDescription } from 'n8n-workflow';

export class Assistant implements INodeType {
    description: INodeTypeDescription = {
        // Basic node details will go here
        displayName: 'Assistant test',
        name: 'assistantTest',
        icon: 'file:test.svg',
        group: ['transform'],
        version: 1,
        description: 'Send a message to Assistant',
        defaults: {
            name: 'Assistant test',
        },
        inputs: ['main'],
        outputs: ['main'],
        credentials: [
            {
                name: 'assistantApi',
                required: true,
            }
        ],
        requestDefaults: {
            baseURL: 'API',
            headers: {
                // headers
            }
        },
        properties: [
        {
            displayName: 'Message',
            name: 'message',
            type: 'string',
            placeholder: 'Enter a message',
            required: true,
            description: 'Enter a message',
            routing: {
                request: {
                    method: 'GET',
                    url: 'API'
                    // qs: {
                    //     q: '{{$value}}'
                    // },
                },
            },
            default: 'get',
        }, 
        ]
    };
}


this is my assistant.node.ts file.
{
    "node": "n8n-nodes-test.Assistant",
    "nodeVersion": "1.0",
    "codexVersion": "1.0",
    "categories": ["Miscellaneous"],
    "resources": {
        "credentialDocumentation": [],
        "primaryDocumentation": []
    }
}

this is assistant.node.json file
import {
    IAuthenticateGeneric,
    ICredentialType,
    INodeProperties,
} from 'n8n-workflow';

export class AssistantApi implements ICredentialType {
    name = 'AssistantApi';
    displayName = 'Assistant API';
    // Uses the link to this tutorial as an example
    // Replace with your own docs links when building your own nodes
    documentationUrl = '/';
    properties: INodeProperties[] = [
        {
            displayName: 'API Key',
            name: 'apiKey',
            type: 'string',
            default: '',
        },
    ];
    authenticate = {
        type: 'generic',
        properties: {
            qs: {
                'x-access-token': '={{$credentials.apiKey}}'
            }
        },
    } as IAuthenticateGeneric;
}

this is assistant.credentials.ts file

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742296887a4417304.html

相关推荐

  • Custom node is not visible on n8n local - Stack Overflow

    I am trying to creating a custom node for n8n. I've successfully built the node, but when I check

    17小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信