Skip to content

Automate browser based workflows with AI

Fix Skyvern.node.ts for N8N Community Node (#2216)

dd3678f089b835f1
diff --git a/integrations/n8n/nodes/Skyvern/Skyvern.node.ts b/integrations/n8n/nodes/Skyvern/Skyvern.node.ts
index 028a738f4..690e525ab 100644
--- a/integrations/n8n/nodes/Skyvern/Skyvern.node.ts
+++ b/integrations/n8n/nodes/Skyvern/Skyvern.node.ts
@@ -1,18 +1,21 @@
import { FieldType, IDataObject, IExecuteSingleFunctions, IHttpRequestMethods, IHttpRequestOptions, ILoadOptionsFunctions, INodePropertyOptions, INodeType, INodeTypeDescription, NodeConnectionType, ResourceMapperField, ResourceMapperFields } from 'n8n-workflow';
import https from 'https';
+import http from 'http';
import { URL } from 'url';
async function makeRequest(url: string, options: any = {}): Promise<any> {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
+ const transport = parsedUrl.protocol === 'https:' ? https : http;
const requestOptions = {
hostname: parsedUrl.hostname,
path: parsedUrl.pathname + parsedUrl.search,
+ port: parsedUrl.port || (parsedUrl.protocol === 'https:' ? 443 : 80),
method: options.method || 'GET',
headers: options.headers || {},
};
- const req = https.request(requestOptions, (res) => {
+ const req = transport.request(requestOptions, (res) => {
let data = '';
res.on('data', (chunk) => {
@@ -476,4 +479,4 @@ export class Skyvern implements INodeType {
},
},
}
-}
\ No newline at end of file
+}