This commit is contained in:
LawyZheng
2025-07-11 15:46:24 +08:00
committed by GitHub
parent 13c27c5178
commit 22063d01fd
3 changed files with 37 additions and 46 deletions

View File

@@ -85,11 +85,19 @@ export class Skyvern implements INodeType {
value: 'dispatchTask', value: 'dispatchTask',
action: 'Dispatch a task to execute asynchronously', action: 'Dispatch a task to execute asynchronously',
description: 'Dispatch a task to execute asynchronously', description: 'Dispatch a task to execute asynchronously',
},
{
name: 'Get a Task',
value: 'getTask',
action: 'Get a task by ID',
description: 'Get a task by ID',
},
],
routing: { routing: {
request: { request: {
baseURL: '={{$credentials.baseUrl}}', baseURL: '={{$credentials.baseUrl}}',
method: 'POST', method: '={{ $value === "dispatchTask" ? "POST" : "GET" }}' as IHttpRequestMethods,
url: '/v1/run/tasks', url: '={{"/v1/run/tasks"}}',
}, },
send: { send: {
preSend: [ preSend: [
@@ -97,6 +105,9 @@ export class Skyvern implements INodeType {
this: IExecuteSingleFunctions, this: IExecuteSingleFunctions,
requestOptions: IHttpRequestOptions, requestOptions: IHttpRequestOptions,
): Promise<IHttpRequestOptions> { ): Promise<IHttpRequestOptions> {
const taskOperation = this.getNodeParameter('taskOperation');
if (taskOperation === "getTask") return requestOptions;
const taskOptions = this.getNodeParameter('taskOptions') as IDataObject; const taskOptions = this.getNodeParameter('taskOptions') as IDataObject;
const legacy_engine = taskOptions['engine'] as string | null; const legacy_engine = taskOptions['engine'] as string | null;
if (legacy_engine === 'v1') { if (legacy_engine === 'v1') {
@@ -110,20 +121,6 @@ export class Skyvern implements INodeType {
}, },
}, },
}, },
{
name: 'Get a Task',
value: 'getTask',
action: 'Get a task by ID',
description: 'Get a task by ID',
routing: {
request: {
baseURL: '={{$credentials.baseUrl}}',
method: 'GET',
},
},
},
],
},
// Workflow Operations // Workflow Operations
{ {
displayName: 'Operation', displayName: 'Operation',
@@ -143,28 +140,21 @@ export class Skyvern implements INodeType {
value: 'getWorkflow', value: 'getWorkflow',
action: 'Get a workflow run by ID', action: 'Get a workflow run by ID',
description: 'Get a workflow run by ID', description: 'Get a workflow run by ID',
routing: {
request: {
baseURL: '={{$credentials.baseUrl}}',
method: 'GET',
},
},
}, },
{ {
name: 'Dispatch a Workflow Run', name: 'Dispatch a Workflow Run',
value: 'dispatchWorkflow', value: 'dispatchWorkflow',
action: 'Dispatch a workflow run to execute asynchronously', action: 'Dispatch a workflow run to execute asynchronously',
description: 'Dispatch a workflow run to execute asynchronously', description: 'Dispatch a workflow run to execute asynchronously',
},
],
routing: { routing: {
request: { request: {
baseURL: '={{$credentials.baseUrl}}', baseURL: '={{$credentials.baseUrl}}',
method: 'POST', method: '={{ $value === "dispatchWorkflow" ? "POST" : "GET" }}' as IHttpRequestMethods,
url: '={{"/api/v1/workflows/" + $parameter["workflowId"] + "/run"}}',
}, },
}, },
}, },
],
},
{ {
displayName: 'User Prompt', displayName: 'User Prompt',
description: 'The prompt for Skyvern to execute', description: 'The prompt for Skyvern to execute',
@@ -385,6 +375,7 @@ export class Skyvern implements INodeType {
}, },
routing: { routing: {
request: { request: {
url: '={{"/api/v1/workflows/" + $parameter["workflowId"] + "/run"}}',
body: { body: {
data: '={{$value["value"]}}', data: '={{$value["value"]}}',
}, },

View File

@@ -1,12 +1,12 @@
{ {
"name": "n8n-nodes-skyvern", "name": "n8n-nodes-skyvern",
"version": "0.0.6", "version": "0.0.7",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "n8n-nodes-skyvern", "name": "n8n-nodes-skyvern",
"version": "0.0.6", "version": "0.0.7",
"hasInstallScript": true, "hasInstallScript": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {

View File

@@ -1,6 +1,6 @@
{ {
"name": "n8n-nodes-skyvern", "name": "n8n-nodes-skyvern",
"version": "0.0.6", "version": "0.0.7",
"description": "Skyvern Node for n8n", "description": "Skyvern Node for n8n",
"keywords": [ "keywords": [
"n8n-community-node-package" "n8n-community-node-package"