I’m creating a custom node for Oracle in n8n and hit a snag. The platform can’t find the test function for my credentials.
My setup:
credentials: [
{
name: 'oracleConn',
required: true,
testedBy: 'verifyConnection'
}
],
methods = {
dbOperations: {
queryTables
},
credentialTest: {
verifyConnection
}
};
The verifyConnection
function matches the ICredentialTestFunction interface. I’ve looked at other database nodes for reference, but mine still doesn’t work.
Any ideas why n8n isn’t picking up my test function? Am I missing something obvious here?
As someone who’s developed several custom nodes for n8n, I can relate to your frustration. One thing that often trips people up is the way n8n handles method registration. Have you tried explicitly registering your credential test function? In my experience, adding a separate methods
property specifically for credential tests can solve this issue. Try restructuring your code like this:
// ... other code ...
methods: {
loadOptions: {
// ... any load options ...
},
credentialTest: {
async oracleConn() {
return this.verifyConnection();
},
},
},
async verifyConnection() {
// Your verification logic here
}
// ... rest of your node code ...
This approach has worked well for me in the past. It explicitly tells n8n where to find the credential test function. If this doesn’t work, double-check your function’s error handling - sometimes a silent failure can make it seem like the function isn’t being called at all. Let me know if you need any more help!
Have you considered the possibility that the issue might be related to how the methods are structured in your code? In my experience developing custom nodes, I’ve found that n8n can be quite particular about method organization. Try moving your verifyConnection
function directly under the main methods object, rather than nested within a credentialTest
property. Something like this:
methods = {
dbOperations: {
queryTables
},
verifyConnection
};
This structure has worked consistently for me across various custom node implementations. If that doesn’t resolve the issue, you might want to double-check your node’s main export statement to ensure all components are properly included. Let us know if this helps or if you need further assistance troubleshooting.
hey FlyingEagle, i ran into a similar issue. check if ur verifyConnection
function is properly exported in the node file. also, make sure the function name in testedBy
matches exactly. sometimes it’s just a silly typo thats causing the problem. hope this helps!