Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

n8n node development: "No testing function found for this credential."

Tags:

n8n

I'm busy building my own node that connects to Oracle, and stumbled upon this problem...

I have a credentials file that does not contain any authentication or testing methods, as I am declaring a separate testing function in the node.ts file. When testing my node, it keeps saying that my credentials don't have a corresponding test function.

In my node.ts file I am stating that my credentials be tested by a function called testConnection:

credentials: [
            {
                name: 'myConnection',
                required: true,
                testedBy: 'testConnection'
            }
        ],

which is declared in my node's methods object like so:

methods = {
        listSearch: {
            searchTables
        },
                //the credential test function is declared here:
        credentialTest: {
            testConnection /** this function is imported from another file */
        }
    };

My test function follows the ICredentialsTestFunction interface signature that looks like this: export declare type ICredentialTestFunction = (this: ICredentialTestFunctions, credential: ICredentialsDecrypted) => Promise<INodeCredentialTestResult>;

I've checked how MySQL and other similar nodes are doing it and I expected my code to work correctly as theirs do, yet it does not recognize the test function.

What am I doing wrong?

like image 727
lucianblignaut Avatar asked Mar 20 '26 23:03

lucianblignaut


1 Answers

There is a bug in n8n. credentialTest doesn't work with custom nodes properly.

See this Github issue: https://github.com/n8n-io/n8n/issues/8188

like image 55
Heavy Avatar answered Mar 24 '26 22:03

Heavy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!